Hello you can use
iTime(_Symbol,PERIOD_CURRENT,0);
No need to write your own, MT5 has iTime, iOpen, iHigh, iLow, iClose, iVolume, iBars, iBarShift, iLowest, iHighest,
iRealVolume, iTickVolume, iSpread
New MetaTrader 5 Platform beta build 1845: MQL5 functions for operations with bars and Strategy Tester improvements - Options Trading Strategies - General - MQL5 programming forum 2018.06.08 13:02
New MetaTrader 5 Platform beta build 1845: MQL5 functions for operations with bars and Strategy Tester improvements - Options Trading Strategies - General - MQL5 programming forum 2018.06.08 13:02
Yeah why don't you add some more then ?
//+------------------------------------------------------------------+ int TimeHour(datetime time) { MqlDateTime tm; TimeToStruct(time,tm); return(tm.hour); } //+------------------------------------------------------------------+There is still need to write your own and it's a lot actually.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
I am trying to write a function that emulates Time[] of MQL4 in MQL5:
Can you help please?