Download MetaTrader 5

How to plot data into the future

To add comments, please log in or register
Harry
10
Harry  

This question has been asked before on this forum, but I haven’t seen an answer.

I’m trying to model financial assets into the future. To use these type of tools I need to be able to plot ahead of the current date. For example, if my model is y=sin(x) where is x is time, or the number or bars or whatever, and today is say 19 November 2015, I need to be able to plot, for example, values on 20 November 2015 to 15 February 2016 or further ahead. How do I do this? 

So to be absolutely clear, it is not an indicator that is shifted forward.

Help is appreciated.

Carl Schreiber
6791
Carl Schreiber  

You can't use negative indexes like Time[-1].

But you can place objects in the future by setting their time 'into' the future e.g. TimeCurrent()+3600 - an hour later.

Harry
10
Harry  
calli:

You can't use negative indexes like Time[-1].

But you can place objects in the future by setting their time 'into' the future e.g. TimeCurrent()+3600 - an hour later.

Thanks call.

Yes I know how to place Objects into the future. This can be done via Scripts and using, for example, OBJ_HLINE, or OBJ_VLINE or whatever object you want. However, there is no OBJ_LINE or so that plots a line like a moving average and thus I’m forced (I think) to make use of Indicators where there is a #property indicator DRAW_LINE which works up and till the current bar, but I can’t get it passed the current bar. If I try using your idea, I get an array overflow message during debugging. 

To add comments, please log in or register