Restricted access to MQL5 trading and history functions if the account is subscribed to a signal.
When a signal subscription is detected on the account (regardless of whether copying is enabled in the current terminal), any MQL5 trading function
calls are prohibited, including receiving open orders and positions,
receiving history, and performing trading operations. A corresponding
warning is logged in the journal:
'XXX': signal subscription detected, trading and history access functions in MQL5 and Python disabled
The restrictions also apply to Python trading functions:
positions_total, positions_get, orders_total, orders_get,
history_orders_total, history_orders_get, history_deals_total,
history_deals_get, order_check, and order_send.
If a signal
subscription is canceled on the account or you connect to another
account without a signal subscription, the restriction is lifted, and
the following message is logged:
'XXX': no signal subscription detected, trading and history access functions in MQL5 and Python enabled
If the restriction is active on the account, MQL5 functions will return the following response codes:
- OrderSend and OrderSendAsync return RET_REQUEST_AT_DISABLED_CLIENT
- OrdersTotal and PositionsTotal return 0
- PositionGetSymbol, PositionSelect, PositionSelectByTicket, and PositionGetTicket return ERR_MQLAPI_TRADE_POSITION_NOT_FOUND
- OrderGetTicket and OrderSelect returns ERR_MQLAPI_TRADE_POSITION_NOT_FOUND
- HistorySelect returns ERR_MQLAPI_TRADE_DEAL_NOT_FOUND