I add a input ENUM_TIMEFRAMES TF. If it's equal to current chart (or PERIOD_CURRENT,) just do as normal.
If it's greater than the current chart, convert a shift via iBarShift to the proper timeframe and get the value via a recursive call to iCustom, where the second parameter is the TF wanted.
Adjust lookbacks:
How to do
your lookbacks correctly. Specifically #14
On MT4: Unless the current chart is that specific pair/TF referenced, you must handle 4066/4073 errors.
Download
history in MQL4 EA -
MQL4 and MetaTrader 4 - MQL4 programming forum
On MT5: you must Synchronize the terminal Data from the Server.
Timeseries and Indicators Access / Data Access -
Reference on algorithmic/automated trading language for MetaTrader 5
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
I would like to know what is the general process to convert a indicator into MTF, so that indicator behaviour from different time frames can be loaded onto same chart.
Regards,