NexusFi: Find Your Edge


Home Menu

 





Gap Counter


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,589 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?
CFTC Opens First COT Report Review in 20 Years -- Asks W …
Traders Hideout
Roland Garros Final Day: $3M on Zverev at 80.5% -- Leban …
Prediction Markets & Event Contracts
Weekend Update: First Qatari LNG Transit Attempted -- IR …
Traders Hideout
Warsh Rate Hike at 40%, Iran June 15 Expires Tonight at …
Prediction Markets & Event Contracts
June 15 Peace Odds Surge From 3.6% to 12.25% After Trump …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 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