Detailed info about errors https://www.mql5.com/ en/docs/constants/ errorswarnings/errorcodes
NOTE: Traders and coders are working for free:
- if it is interesting for them personally, or
- if it is interesting for many members on this forum.
Freelance section of the forum should be used in most of the cases.

- www.mql5.com
I'm using a freely available source code that calucate risk percent and set auto lot sizing with a trading panel from [edited].com
However the project is not able to open any trades. I have made a test by inserting the open trade codes to it, it gives the error 4014.
I can able to use the same code in another project on the same trade without any issues.
Any ideas what is the issue?
The code likely omits several MqlTradeRequest required fields ( Trade Request Structure - Data Structures - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5).

- www.mql5.com
The code likely omits several MqlTradeRequest required fields ( Trade Request Structure - Data Structures - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5).
The exact MqlTradeRequest code is working fine in other project, so the fields are not a problem
The exact MqlTradeRequest code is working fine in other project, so the fields are not a problem
Error 4014 appears to be a web request error. Have a look at:
WebRequest MQL5: error 4014 even though I have maintained the Url in "tools / options" - Indices - General - MQL5 programming forum
- 2022.03.18
- KjLNi
- www.mql5.com
Are you perhaps trying to run your code in an Indicator or perhaps on an account that follows a signal?
4014 | Function is not allowed for call |

- www.mql5.com
Are you perhaps trying to run your code in an Indicator or perhaps on an account that follows a signal?
4014 | Function is not allowed for call |
I'm running the code on EA, I want to add open trades functions to the project (files attached in my first post). So I put in the open trade codes to test but it gives error, but the code is proven to work if I create a new EA project. The project is working perfectly fine with auto lot sizing and adjusting SL lines. I am not following any signals
Error 4014 appears to be a web request error. Have a look at:
WebRequest MQL5: error 4014 even though I have maintained the Url in "tools / options" - Indices - General - MQL5 programming forumPlease identify which lines give the error and show the log output.
void OpenTrade() { //--- declare and initialize the trade request and result of trade request MqlTradeRequest request={}; MqlTradeResult result={}; //--- parameters of request request.action =TRADE_ACTION_DEAL; // type of trade operation request.symbol =Symbol(); // symbol request.volume =0.1; // volume of 0.1 lot request.type =ORDER_TYPE_BUY; // order type request.price =SymbolInfoDouble(Symbol(),SYMBOL_ASK); // price for opening request.deviation=5; // allowed deviation from the price //request.magic =EXPERT_MAGIC; // MagicNumber of the order //--- send the request if(!OrderSend(request,result)) PrintFormat("OrderSend error %d",GetLastError()); // if unable to send the request, output the error code //--- information about the operation //PrintFormat("retcode=%u deal=%I64u order=%I64u",result.retcode,result.deal,result.order); } I got the error from this code. if(!OrderSend(request,result)) PrintFormat("OrderSend error %d",GetLastError()); // if unable to send the request, output the error code
I call this function OnInit() . The system does not generate it's own error, no trade are opened.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
However the project is not able to open any trades. I have made a test by inserting the open trade codes to it, it gives the error 4014.
I can able to use the same code in another project on the same trade without any issues.
Any ideas what is the issue?