OnCalculate beyond [rates_total-1]

 

Hello,


Since trading is all based on a forecast about the future, being able to draw indicators' plots

beyond current bar [rates_total-1] would be nice.


The idea came to me while thinking of MAs and timing moves. Especially for higher period MAs,

a visual representation of the nearby future with a distinguished dashed-lined could be very useful for traders.


If there is a way to do that atm, I'm not aware of it and would be thankful of any tips.




 
Panteleimon Mar Andreadis: Since trading is all based on a forecast about the future, being able to draw indicators' plots beyond current bar [rates_total-1] would be nice.

Research displaced moving averages, the Aligator and Ichimoku. All can draw past the end of the chart.

 
William Roeder:

Research displaced moving averages , the Aligator and Ichimoku. All can draw past the end of the chart.

Thats right.. thanks for noting Will.

 
int OnInit()
{
    //...

    PlotIndexSetInteger(0, PLOT_SHIFT, shift);

    //...

    return(INIT_SUCCEEDED);
}

You can displace the plots (not the buffers) and they will be displayed in the "future"

However, the indexes of the buffers won't change its numeration so be careful if you try to access values from code

 
If you are drawing objects with coordinates given in price and time, you can pass future times to the function.
 
Dominic Egertger :
If you are drawing objects with coordinates given in price and time, you can pass future times to the function.

I'm considering if it should be an object yes, because as Manuel said above the buffers do get messed up

when trying to make space for those extra bar calculations.

It is also a visual requirement, demanding visual solution, such as drawing an object.

Reason: