Dear Coder,
I need your help to explain me how to use the function of Time[] in MT5 which is exit in MT4 but not in MT5. How can I fix it in MT5?
Dear Coder,
I need your help to explain me how to use the function of Time[] in MT5 which is exit in MT4 but not in MT5. How can I fix it in MT5?
"In MQL5 chart period constants changed, and some new time periods (M2, M3, M4, M6, M10, M12, H2, H3, H6, H8, H12) were added."
Thanks this article really helps
check this one too
https://www.mql5.com/en/articles/66
- 2010.07.28
- Vasily
- www.mql5.com
I mean seriously... compare this code to express the same idea.. and are you still wondering why MQL5 has been a failure? Why change it to copy time or not make some compatibility so we dont have to rewrite all indicators? Omg...
MQL4:
Alert(Time[0]);
MQL5:
//--- variables for function parameters int start = 0; // bar index int count = 1; // number of bars datetime tm[]; // array storing the returned bar time //--- copy time CopyTime(_Symbol,PERIOD_D1,start,count,tm); //--- output result Alert(tm[0])
I agree.
Why not, simply use:
iTime(_Symbol,_Period,0);???
Why not, simply use:
???These were added somewhat later.
#define DEFINE_TIMESERIE(NAME, T) \ class CLASS##NAME \ { \ public: \ T operator[]( const int iPos ) const \ { \ return(::i##NAME(_Symbol, _Period, iPos)); \ } \ }; \ \ CLASS##NAME NAME; DEFINE_TIMESERIE(Volume, long) DEFINE_TIMESERIE(Time, datetime) DEFINE_TIMESERIE(Open, double) DEFINE_TIMESERIE(High, double) DEFINE_TIMESERIE(Low, double) DEFINE_TIMESERIE(Close, double) #undef DEFINE_TIMESERIE
Forum on trading, automated trading systems and testing trading strategies
Luis Alejandro Diaz Vidal, 2018.03.04 16:37
MQL4:
Alert(Time[0]);
MQL5:
Alert(Time[0]);
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Dear Coder,
I need your help to explain me how to use the function of Time[] in MT5 which is exit in MT4 but not in MT5. How can I fix it in MT5?