Forum on trading, automated trading systems and testing trading strategies
MetaQuotes, 2024.09.13 11:36
MetaTrader 5 Client Terminal
- Terminal: 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 disabledThe 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 enabledIf 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
- www.mql5.com
Thanks for the information guys.
I hesitate to work through the object functions. Correct operation of the EA then depends on certain settings of the chart.
Possibly I will log into the account on a separate terminal where the signal is off. Then I will have the data and functions I need available if I understand correctly.
I hesitate to work through the object functions. Correct operation of the EA then depends on certain settings of the chart.
You can programmatically set the desired chart settings.
- CHART_SHOW_TRADE_LEVELS – property of displaying trade levels on the chart (levels of open positions, Stop Loss, Take Profit and pending orders).
- www.mql5.com
Thank you for the suggestion.
I think it is indeed possible to solve it that way and I don't see a better option either.
The information I want to export is available in the objects(ticket id, position type, volume, price, symbol). I am going to have to do a lot of string operations here to retrieve the information though, hopefully this is not going to load the CPU too much.
The old way was easier anyway :-)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello Everyone,
Since build 4570 of MT5, I have had the problem that the function PositionsTotal() returns 0. In build 4410 this is not the case. I need the function to export data in an EA so I am looking for a solution.
This problem occurs on an account with a signal subscription.
The problem starts when I turn on “enable real-time signal subscription” in the options window under the signals tab.
When I turn this off the problem does not occur but that is not an option since I want to use the signal.
What can I do to solve this problem?
Currently I am using build 4410 but I don't see that as a permanent solution.
Any help is appreciated