Allows receiving time of beginning and end of the specified quoting sessions for a specified symbol and day of week. | |
Allows receiving time of beginning and end of the specified trading sessions for a specified symbol and day of week. |

- www.mql5.com
This is how to use any of the above two functions in your code:
for(uint day_of_week=0; day_of_week<7; day_of_week++) { string str=""; uint session_index=0; datetime from,to; while(SymbolInfoSessionTrade(symbol,(ENUM_DAY_OF_WEEK)day_of_week,session_index++,from,to)) { str+=TimeToString(from,TIME_MINUTES)+"-"+TimeToString(to,TIME_MINUTES)+" "; } PrintFormat("%10s: %s",EnumToString((ENUM_DAY_OF_WEEK)day_of_week),str); }
Allows receiving time of beginning and end of the specified quoting sessions for a specified symbol and day of week. | |
Allows receiving time of beginning and end of the specified trading sessions for a specified symbol and day of week. |
Thanks a lot @Fernando Carreiro
Also thanks for suggesting OrderCalcMargin() in one of my earlier post. At that time I could not understood how you wanted me to use it for currency conversion. However yesterday as I was researching about currency conversion, I got idea as how to use it to calculate 'Amount Invested' in the positions for PortfolioVaR. I needed a little bit of extra code to define ORDER_TYPE (for open positions, it is POSITION_TYPE) as well as code to maintain nominal value as -ve for SHORT positions. It seems to be working fine for now and will back test few strategies to confirm the accuracy.
Regards,

- 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 Fellow Members
How can I programmatically get the Symbols trading session timings for different assets I plan to trade in?
So if I want to trade in AMZN Stock, I need to know the timings and programmatically restrict POSITION open and POSITION close just before 'Trade' Hours Close e.g. close at 22:45 Hrs
Looked at Symbol Properties, but could find any one to return me these values.
Highly appreciate the sooner reply.