I am not sure if one can script the historical price data or
if one can draw a fake bar on the chart, that way all indicators recognize that fake bar in their calculations.
It is easy to draw a projected bar on the chart, but the indicators will not recognize it.
It is a little more complex to write the projected bar on the hst file, but then the other indicators can recognize it.
To avoid collisions with the server's datas, I think that you should work on your own hst file with another name for the pair.
So you need to write an indicator and attach it for example on a EURUSD M5 chart.
This indic has to copy the EURUSD5.hst file to another file named for example P_EURUSD5.hst, which has to be opened "offline".
This indic replaces inside the hst file the current bar by the fake one, and when a new bar occurs, replaces the fake by the real one which is just closed and then compute the next fake.
This indic has also to send a window "message" to the offline chart P_EURUSD M5 to trigger the indicators or EA which are attached on, like if a new tick was incomming.
It migh looks difficult but it is not.
I suggest you to analyse the code of the "Period_Converter" script and "Period_Converter Opt" EA or indic to understand the structure of the hst files.
I also suggest that you write an indicator, not a script nor an EA,
because you can use IndicatorCounted() func to know if there is anything wrong with the datas (after a deconnexion for example) and then re-write the whole file.
Thanks for your comment Michel.
It sounds still a bid complicated.
I am thinking now to rewrite the indicators (CCI and Stoch) to do the job of predicting the next bar.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use