Hi
I want to get time portion out of datetime.. please help
ie, 2017.0.15 15:30:00 to just 15:30
The idea is to close trades after 15:30. Please let me know how to achieve this.
Thanks
int i_Hours = TimeHour(TimeCurrent()); int i_Minutes = TimeMinute(TimeCurrent()); int i_Seconds = TimeSeconds(TimeCurrent());
Hi Denis
But in MQL5, the functions you have mentioned are not avaibalble.
I want to know how to check whether the current time is greater than 15:30, for that first i have to get 15:30 out from date time
Thanks
Satheesh
Hi Denis
But in MQL5, the functions you have mentioned are not avaibalble.
I want to know how to check whether the current time is greater than 15:30, for that first i have to get 15:30 out from date time
Thanks
Satheesh
- www.mql5.com
I have to take the time from the bar..
MqlRates priceInfo[];
datetime barTime = priceInfo[0].time;
it is this barTime, i have to split to get the Hour and Minute.
- Use reply if you are posting a comment in reply to another post.
- Use SRC when you are pasting source code.
- Please spend time reading replies and MQL5 documentation and also provided links.
Here's what you need:
MqlDateTime barTime; TimeToStruct(priceInfo[0].time, barTime); int hour = barTime.hour; int minute = barTime.min;
- 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
I want to get time portion out of datetime.. please help
ie, 2017.0.15 15:30:00 to just 15:30
The idea is to close trades after 15:30. Please let me know how to achieve this.
Thanks