You are running through the loop and then applying a value only to index[Bars-1]
for(int i=0; i<Bars;i++) { barTime=iTime(NULL,0,i); shift_Buffer[i]=iBarShift(NULL,0,barTime); }
Use curly braces to define the loop
Maybe just an exercise. but you achieve the same with the simpler
for(int i=0; i<Bars;i++) { shift_Buffer[i]=i; }
try it
You may also want to set indicator digits to 0
your suggestion works thank you very much

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
For manual back testing I need the " Data Window " to show candle shift . The above code doesn't work . Any idea ?
thank you