Anil Varma:
Hi
Please help me how to avoid this warning message 'invalid date'
Thanks in advance
it's in the documentation
https://www.mql5.com/en/docs/basis/types/integer/datetime
Documentation on MQL5: Language Basics / Data Types / Integer Types / Datetime Type
- www.mql5.com
Datetime Type - Integer Types - Data Types - Language Basics - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Paul Anscombe:
it's in the documentation
https://www.mql5.com/en/docs/basis/types/integer/datetime
Thanks for reply Paul.
Paul Anscombe:
it's in the documentation
https://www.mql5.com/en/docs/basis/types/integer/datetime
Hi Paul
I am still getting invalid date error though modified the Code to include the date. Any idea what is wrong ?
void CTradeState::Set_TradeState() { //--- FRIDAY, no new position to open after 20.00 Hrs Set_TradeState(D'2021.01.01 20:00', D'2021.01.01 23.59', FRIDAY, TRADE_NO_NEW_ENTRY); //--- Asian Session Position Open NOT Allowed Set_TradeState(D'2021.01.01 00:00', D'2021.01.01 06:59', ALL_DAYS_OF_WEEK, TRADE_WAIT); //--- London, UK Opening Session Position Open allowed Set_TradeState(D'2021.01.01 07:00', D'2021.01.01 09:59', ALL_DAYS_OF_WEEK, TRADE_BUY_AND_SELL_UKExchange); //--- London, UK General Session Position Open allowed Set_TradeState(D'2021.01.01 10:00', D'2021.01.01 15:44', ALL_DAYS_OF_WEEK, TRADE_BUY_AND_SELL); //--- New York Session Position Open allowed Set_TradeState(D'2021.01.01 15:45', D'2021.01.01 19:59', ALL_DAYS_OF_WEEK, TRADE_BUY_AND_SELL_USExchange); Set_TradeState(D'2021.01.01 20:00', D'2021.01.01 23:39', ALL_DAYS_OF_WEEK, TRADE_BUY_AND_SELL); //--- FRIDAY, last trading day of week. EA switches to trade_STOP mode at 23.40 to close all open positions Set_TradeState(D'2021.01.01 23:40', D'2021.01.01 23:59', FRIDAY, TRADE_STOP); Set_TradeState(D'2021.01.01 00:00', D'2021.01.01 23:59', SATURDAY, TRADE_WAIT); Set_TradeState(D'2021.01.01 00:00', D'2021.01.01 23:59', SUNDAY, TRADE_WAIT); }
Anil Varma:
Please be more careful, the separator between hour and minute is a ":" not a dot "."
Hi Paul
I am still getting invalid date error though modified the Code to include the date. Any idea what is wrong ?
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
Hi
Please help me how to avoid this warning message 'invalid date'
Thanks in advance