Agent86: What is expected to happen when you select a static enum_timeframe for your
indicator but switch charts to a time frame that does not match the enum_timeframe ?
On MT4: Unless the current chart is that specific pair/TF referenced, you must handle 4066/4073
errors before accessing candle values. Or in your case, indicator values.Download history in MQL4 EA - Forex Calendar - MQL4 programming forum - Page 3 #26 № 4
The function linked to, opens a hidden chart for the symbol/TF in question (if not already open,) thus updating history, and temporarily placing the symbol on Market Watch (if not already there,) so SymbolInfoDouble(symbol, SYMBOL_BID) or MarketInfo(symbol, MODE_BID) don't also return zero on the first call.
William Roeder:
On MT4: Unless the current chart is that specific pair/TF referenced, you must handle 4066/4073 errors before accessing candle values. Or in your case, indicator values.
Download history in MQL4 EA - Forex Calendar - MQL4 programming forum - Page 3 #26 № 4
Thanks, On MT4: Unless the current chart is that specific pair/TF referenced, you must handle 4066/4073 errors before accessing candle values. Or in your case, indicator values.
Download history in MQL4 EA - Forex Calendar - MQL4 programming forum - Page 3 #26 № 4
The function linked to, opens a hidden chart for the symbol/TF in question (if not already open,) thus updating history, and temporarily placing the symbol on Market Watch (if not already there,) so SymbolInfoDouble(symbol, SYMBOL_BID) or MarketInfo(symbol, MODE_BID) don't also return zero on the first call.
I think I understand this
So that explains why "TimeFrame=5" will only work on 5min chart but not on 1hr TF
I'll work on it some more, thanks again

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
https://www.mql5.com/en/docs/constants/chartconstants/enum_timeframes
EI: imomentum
https://www.mql5.com/en/docs/indicators/imomentum
Question:
Where noted and regarding the time frames. What is expected to happen when you select a static enum_timeframe for your indicator but switch charts to a time frame that does not match the enum_timeframe ?
I assume that no matter what time frame chart I view that the indicator will use the static enum_timeframe that I use and not a dynamic timeframe that you normally get when you use enum_timeframe "0".
Please correct me on this if I'm wrong about this.
The reason for my question is because currently my code is not alerting when switching the chart to a different timeframe such as 1hr. It only alerts when I switch back to the time frame that matches my static enum_timeframe. IE (5)
Please advise thanks