Trend setting

Back to topics list To post a new topic, please log in or register
avatar
2
Poty007 2015.10.23 18:28
 

Hi,

does anybody got some idea how to fix the trend in custom indicator ??

For example, If indicator made six lines above value 100, say there is Uptrend. 

Then I need program, to do not get back to upper functuion "if"  unless Uptrend is cancelled by some event in the indicator..

thank you for all ideas... 

avatar
13012
WHRoeder 2015.10.23 18:35 #
 
Don't look for a level, look for a change in signal
static bool uptrend = false;
bool upTrendPrev = uptrend; uptrend = YOURCONDITION;
if(upTrend && ! upTrendPrev) CHANGED;

avatar
2
Poty007 2015.10.23 18:41 #
 

I got it, thanks :)

 

Back to topics list  

To add comments, please log in or register