The below codes are in Indicator, and I want to know the difference when I change a little
About this Indicator, I don't want to draw any indicator in Terminal, I just want to select some points in Indicator and call this indicator in EA by iCustom();
Below codes include two case: one case is just as the below codes, another case is delete all "//" in the below codes; I test the two cases, very different, in the fact I want to know why? In indicator, " int Counted_Bars=IndicatorCounted();" must be used?
extern int Seek_Period=15,Mini_Swing=60,Trade_Range=90;
// int Counted_Bars=IndicatorCounted();
// if(Counted_Bars==0) Counted_Bars--;
// int Limit=Bars-Counted_Bars;
// for(int i=Limit-1;i>0;i--)
int G_i=iHighest(NULL,0,MODE_HIGH,P_CNT,0); /* the second case: the last 0 of this line should be i;*/
vx0532: In indicator, " int Counted_Bars=IndicatorCounted();" must be used?
Of course its very different, if you took the back off your tv and pulled out some random parts without having first learned what they do would you expect the tv to work the same as before ?
I recommend you read Creation of Custom Indicators. There is a section all about IndicatorCounted().
why is come from how to change with time changing.
suggest to read https://book.mql4.com/samples/icustom to understand the relation between of time and index i
Please enable the necessary setting in your browser, otherwise you will not be able to log in.