Market Closed?

 
Please help, How can I find out wether the marked is closed?
 
sarged:
Please help, How can I find out wether the marked is closed?

ENUM_SYMBOL_TRADE_MODE SymbolInfoInteger(string name, int prop_id);

ENUM_SYMBOL_TRADE_MODE

Identifier

Description

SYMBOL_TRADE_MODE_DISABLED

Trade is disabled for the symbol

SYMBOL_TRADE_MODE_LONGONLY

Allowed only long positions

SYMBOL_TRADE_MODE_SHORTONLY

Allowed only short positions

SYMBOL_TRADE_MODE_CLOSEONLY

Allowed only position close operations

SYMBOL_TRADE_MODE_FULL

No trade restrictions

 Trade is disabled while the market is closed, if I remember.

Another option is using the standard library CSymbolInfo class, which can save you some time writing functions.

There's an article related to verifying and checking limitations of your EA.

Cheers,
Lugs 

 

Sorry but  this doesn't work! Altough it's sunday and the marked it OBVIOUSLY should be closed - the function returns SYMBOL_TRADE_MODE_FULL.

Then again if I'll try to open an order it will return error: Market Closed!

Please help someone, I can't believe there is no such function.

 
Documentation on MQL5: Market Info / SymbolInfoSessionTrade
  • www.mql5.com
Market Info / SymbolInfoSessionTrade - Documentation on MQL5
 
 
Lugner:

d'oh

Thanks, that'll help 

Did it help you? What session index to use to get the info for the current session? If I use 0, it gets me some 1970 dates, if I use any other number it fails to get session info.