Help or cost of indicator

 

Peter Goodier 09.03.07 05:39

FROM peter_zyn
9th Mar 2007

I need a simple indicator that places the results of an algorithm calculated one bar at a time, 5 bars ahead.
Consequently the current bars will place its results 5 bars into the future.

Example bar Algorithm (HIGH[0] - LOW[15] + OPEN[3]) result placed 5 bars ahead
Requires manipulation of past selected data

In the following the CURRENT TIME = 14:00
Following shows only the last 5 bars. Working algorithm will work with all bars.

10:00bar places result @ 15:00
11:00bar places result @ 16:00
12:00bar places result @ 17:00
13:00bar places result @ 18:00
14:00bar CURRENT places result @ 19:00

I can't get any indicator display, forward of the current Bar

Also is it possible to only calculate a specific bar (eg current bar) and place its result 5 bars ahead
Is this possible in MQL4?

Regards

peter_zyn

 
try this function in your indicator: SetIndexShift()

It is set in init() together with all other stuff such as SetIndexBuffer() etc.
Reason: