


The indicator (MY_INDICATOR) that feed to the trading EA is
int limit=rates_totalprev_calculated; if(limit<0) limit=2; if(prev_calculated>0) limit++; // //BUY SECTION for(int i=1;i<limit;i++) { cobom4roc[i]= iCustom(NULL,0,"H_roc",H_roc_windowshort,200,0,i) + iCustom(NULL,0,"H_roc",H_roc_windowshort,200,0,i) ; if(combo4roc[i]>0.01) feedbuffer[i]=2;}
And the original H_roc indicator is: int limit=rates_totalprev_calculated; if(limit<0) limit=2; if(prev_calculated>0) limit++; for(int i=1;i<=limit && (i+shortwindow)<rates_total;i++) { roc_short=Close[i]/Close[i+shortwindow]1; }


scfx: I find that this trading will run correctly if in my indicator there is an EQUAL sign on limit condition int limit=rates_totalprev_calculated;
if(limit<0) limit=2;



WHRoeder: 3) I dont think the return value of OnCalculate does anything. You can return(0) and it still functions the same as return(rates_total).



Good morning,
I write a simple EA below to run my indicator
I find that this trading will run correctly if in my indicator there is an EQUAL sign on limit condition
int limit=rates_totalprev_calculated; if(limit<0) limit=2;
......
Without that EQUAL sign, it still trade but the entry is wrong in many occasion.
Can you tell me why it is like that?
Many thanks,
SCFX