Your alert is reporting the runtime error, but you are not reporting the trade server error which will explain the reason, which will also be reported in the logs which you don't seem to be analysing.
So, in the case of your code, also report the "myTradingControlPanel.ResultRetcode()".
EDIT: Also note that you are not checking the return status of the "PositionOpen" method, which returns a boolean.
Yes I know. It gives this error on weekdays as well. I am not stupid.
You posted just after the markets closure, and you are using a loop with sleep(), so with the information you posted, it could perfectly be a problem of "market close".
Anyway, error 4756 is useless, as Fernando said you need to print the ResultRetcode to know the real reason.
Your alert is reporting the runtime error, but you are not reporting the trade server error which will explain the reason, which will also be reported in the logs which you don't seem to be analysing.
So, in the case of your code, also report the "myTradingControlPanel.ResultRetcode()".
EDIT: Also note that you are not checking the return status of the "PositionOpen" method, which returns a boolean.
yes, I added the code and got error code 10026. "Automatic trading has been disabled by the server"
I don't know which loop is the problem. can you show me the part i need to fix?
yes, I added the code and got error code 10026. "Automatic trading has been disabled by the server"
I don't know which loop is the problem. can you show me the part i need to fix?
https://www.metatrader5.com/en/metaeditor/help/development/debug
https://www.mql5.com/en/articles/654
https://www.mql5.com/en/articles/35
https://www.mql5.com/en/articles/2041
https://www.mql5.com/en/articles/272
https://www.mql5.com/en/articles/150
- www.metatrader5.com
10026 | TRADE_RETCODE_SERVER_DISABLES_AT | Autotrading disabled by server |
This could mean that your broker (or that type of account) does not allow trading with automation, such as with a Expert Advisor (EA) and that It only allows manual trading.
Speak to your broker about it or change to a different broker.- 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 friends, I mentioned earlier that I am working on a strategy that opens a buy trade on every drop. I supported Thank you to everyone who helped. The system works smoothly in strategy mode, but does not open trading on demo and real account. Can experts examine the codes and tell where the error is? Thank you from now. In all codes section;
The error is as follows;
Error code 4756 "Failed to send the trade request."
I would be glad if you help.