NexusFi: Find Your Edge


Home Menu

 





Gap Counter


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,729 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 skiman721 
North Bay
 
Experience: Intermediate
Platform: NT, ToS, MulitCharts
Broker: NT, TD
Trading: ES, CL
Posts: 39 since Nov 2011
Thanks Given: 10
Thanks Received: 9

I'm trying to count the number of consecutive daily up or down gaps but having trouble with the code. I'm not sure how to increase or decrease the variables.

 
Code
vars: 
newday(false),
openingPrice(0),
ydayClose(0),
ydayRange(0),
GapDown(0),
GapUp(0),
GapPresent(0);

// SET VARS
if date[1] < date then begin
	newday=true;
	ydayRange=(HighD(1)-LowD(1));
	ydayClose=CloseD(1);
	openingPrice=OpenD(0);
end;

//GAP COUNTER
if newday and openingPrice < (ydayClose - (ydayRange*0.1)) then begin
         GapDown +=1;
         GapUp = 1;
         GapPresent +=1;
     end;


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Trump Media to sell instant access to market-moving soci …
Traders Hideout
Datafeed for Atas
Platforms and Indicators
EA
Platforms and Indicators
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
My Rant with AMP Futures
Trading Reviews and Vendors
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Mes vs MNQ
6 thanks
NexusFi site changelog and issues/problem reporting
5 thanks
BERN ALGOS algo trading journal
3 thanks
Johnnys Journal
2 thanks
TopStep Trader disappointment
2 thanks
  #3 (permalink)
juanman
Miami Florida
 
Posts: 7 since Apr 2015
Thanks Given: 1
Thanks Received: 4


I think that when ever your code get executed all your var are initialized again, so try using
Intrabarpersists int GapCount(0); ..... so if you set a new value its remain in your vars, then see what are your results,


Reply With Quote




Last Updated on April 10, 2015


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts