How to draw a custom indicator line into the future

 

I am trying to write an indicator which projects a line from the current bar into the future (it is a price prediction). Obviously I can draw a line by setting ExtMapBuffer1[i] to a value where i is the index from 0 into the chart history. What I need to do is draw the line into the future i.e. as if I was able to make a negative index into the array such as ExtMapBuffer1[-1] to draw one bar into the future. I can't seem to figure out how to do it.


I'm good with writing EAs but this is my first indicator so I may be missing some of the tricks.


Cheers,


58s

 
Depends on the indicator, but normally it's the shift parameter. Look at it on an MA.
 
jmca:
Depends on the indicator, but normally it's the shift parameter. Look at it on an MA.

SetIndexShift(), thanks for the pointer :)

Reason: