Error Code 6 - How to fix?

 

Hello,

I'm coding up an EA.

In the EA, I get the following error while trying to modify an order: 


0 12:35:41.007 Algorithm1 XAUUSD,H1: Failed. Order Modified 1.5To3 SLOrder #664704280, TPOrder #664695196, false 2025.94 2026.0. Error Code: 6

2 12:35:41.007 Algorithm1 XAUUSD,H1: ExpertRemove function called

bool modifyorderboolean = OrderModify(SLOrderTicket, OrderOpenPrice(), CaseC_Rise_1Point5to3_MaxPrice - ThirdStepSLOrder_StopLossMark, 0, 0);

What does this error mean? And what's the fix for it?

Cheers,
Eashan

Documentation on MQL5: Common Functions / ExpertRemove
Documentation on MQL5: Common Functions / ExpertRemove
  • www.mql5.com
ExpertRemove - Common Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 

Is this MT5 or MT4?

You posted in the MQL5 section but I suspect you are using MT4.

If this is the case, then please don't post randomly in any section. MT4/mql4 has it's own section on the forum.

I will move your topic to the correct section later, please don't create an other topic.

 
Fernando Carreiro #:

Is this MT5 or MT4?

You posted in the MQL5 section but I suspect you are using MT4.

If this is the case, then please don't post randomly in any section. MT4/mql4 has it's own section on the forum.

I will move your topic to the correct section later, please don't create an other topic.


I saw the section for Expert Advisors and Automated Trading and posted there. 

Sure, thanks for moving my topic to MT4.

 
Any update on th fix for this error code 6? Should I just retry the order modification? Is that the only solution?
 
eashanm #:
Any update on th fix for this error code 6? Should I just retry the order modification? Is that the only solution?
Nobody can help you unless you post the code… you should isolate code blocks one by one to see where is the problem…
Which part is causing the terminal to freeze … I believe that without that EA, your platform works fine ? 
 
Daniel Cioca #:
Nobody can help you unless you post the code… you should isolate code blocks one by one to see where is the problem…
Which part is causing the terminal to freeze … I believe that without that EA, your platform works fine ? 


bool modifyorderboolean = OrderModify(SLOrderTicket, OrderOpenPrice(), CaseC_Rise_1Point5to3_MaxPrice - ThirdStepSLOrder_StopLossMark, 0, 0);


I inserted the code where I'm gettting the error, while trying to modify an order. 

Is error 6 because of terminal freezing due to other parts of code? 

After the error, if I retry it, it works fine.

 
eashanm #:



I inserted the code where I'm gettting the error, while trying to modify an order. 

Is error 6 because of terminal freezing due to other parts of code? 

After the error, if I retry it, it works fine.

If you don’t use this function, the terminal works fine? If yes, then stop using it… print every parameter on that function to see what is the outcome… 
Reason: