Candle refresh in Multitimeframe mode

1
Hi everyone!

Maybe someone can give me an advice for an issue.

How is possible to refresh the candles in the indicator OnInit function on any timeframe, ( multitimeframe mode) so when the first OnCalculate function runs, all the Candle data from the given timeframe will be available?
( the F2 download are not a solution because this should be an automatic function )

if anyone have an idea or a solution, that will be appreciated..


Re: Candle refresh in Multitimeframe mode

2
ritutibi wrote: Wed Aug 16, 2017 7:12 am Hi everyone!

Maybe someone can give me an advice for an issue.

How is possible to refresh the candles in the indicator OnInit function on any timeframe, ( multitimeframe mode) so when the first OnCalculate function runs, all the Candle data from the given timeframe will be available?
( the F2 download are not a solution because this should be an automatic function )

if anyone have an idea or a solution, that will be appreciated..
You can not wait for that from init
Instead you do the following :

- "ask" the target time frame how many bars should be calculated
- use the answer at the chart time frame to refresh / recalculate all the bars of the target time frame that need to be recalculated
- and so on ... on each tick

that is the only reliable way to avoid repainting or calculating errors
You can see that method in all the multi time frame versions of indicators that are posted at this forum


Who is online

Users browsing this forum: Amazon [Bot] and 28 guests