NexusFi: Find Your Edge


Home Menu

 





Gap Counter


Discussion in EasyLanguage Programming

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




 
Search this Thread

Gap Counter

  #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?
ZombieSqueeze
Platforms and Indicators
Exit Strategy
NinjaTrader
Honey, dont forget the gold bars at the store!
Commodities
Trade idea based off three indicators.
Traders Hideout
VFC turning around or continuing to fall?
Stocks and ETFs
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
My NQ Trading Journal
31 thanks
Diary of a simple price action trader
20 thanks
Daytrading ES & NQ
10 thanks
Coding money management strategies.
10 thanks
Robs Journal of trading shenanigans
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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts