Why do you have the y variable in your for loop statement ?
Sorry, the code is in the following context:
ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),D1_Period); for(i=(limit-1),y=(limit-1);i>0;i--) { if (Time[i]<TimeArray[y]) y++; if(iClose(NULL,D1_Period,y+2)>....) SellBuffer[i+(D1_Period/Period())] = .. }
RaptorUK:
Why do you have the y variable in your for loop statement ?
OK, one of the subtleties of mql4 I hadn't appreciated.
Why do you have the y variable in your for loop statement ?
Do you mean, I can't do that??
sunshineh:
Do you mean, I can't do that??
No, I mean you can do that . . . but I thought it was wrong.
Do you mean, I can't do that??
sunshineh:
I've always programmed my mtf-indicator with this loop:
ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),D1_Period); limit=Bars-counted_bars; for(i=0,y=0;i<limit;i++) { if (Time[i]<TimeArray[y]) y++; .... }
limit=Bars-counted_bars; for(i=0;i<limit;i++) { int iD1 = iBarShift(NULL, PERIOD_D1, Time[i]); double clD1 = iClose(NULL, PERIOD_D1, iD1); .... }
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
I've always programmed my mtf-indicator with this loop:
but know I have an indicator which shows a widget for the valid time f.e. the whole day. Therefore I only want the signal on the start of the day.
When I programm this with the loop above, I only get the signal on the end of the day, because it calculates from now to the past.
But I also doesn't work when I turn around the for-loop:
for(i=(limit-1),y=(limit-1);i>0;i--)
Why?