What are you trying to do?
Thank you.
I believe your EA must select each order individually using the OrderSelect() function in order to close it's orders individually and in order. There might be a way of selecting the group of orders to close them all at once, but I
am not familiar with that practice.
Are you familiar with the OrderSelect() function?
Thank you.
NOT without coding it....
Show your attempt no mindreaders here
For the way how to do see https://www.mql5.com/en/forum/139654
This works in scripts but not in EA.
Comment( Commentary + " | Closing All Orders, please wait ..." );
CloseAll( "None", 0, OP_ALL ,MaxRetry, Slippage, Commentary );
Comment("");
When compiling EA it gives error 'OP_ALL' variable not defined. I just started learning mql4, any help is appreciated.
Where is your function CloseAll() coming from ? include file ? in your mq4 file ? can you show it please . . . OP_ALL is probably a constant, have you defined it ?
void start() { int MaxRetry = 10; // If the Order Fails - How many time do we retry? int Slippage = 10; string Commentary = "Close ALL orders"; Comment( Commentary + " | Closing All Orders, please wait ..." ); CloseAll( "None", 0, OP_ALL ,MaxRetry, Slippage, Commentary ); Comment(""); return; }
CloseAll( "None", 0, OP_ALL ,MaxRetry, Slippage, Commentary ); ??????
. 'OP_ALL' - variable not defined C:\.....
For the way how to do close and delete all see https://www.mql5.com/en/forum/139654
I told you before.... looks like you didn't learn yourself nothing go read again and try something
Good that you just learn mql4 :)
You need an mql4 function to close position which is OrderClose() (https://docs.mql4.com/trading/OrderClose), however OrderClose() need to be selected first by OrderSelect() (https://docs.mql4.com/trading/OrderSelect)
Also read these https://www.mql4.com/search keyword=close all module=mql4_module_forum
This works in scripts but not in EA.
Comment( Commentary + " | Closing All Orders, please wait ..." );
CloseAll( "None", 0, OP_ALL ,MaxRetry, Slippage, Commentary );
Comment("");
When compiling EA it gives error 'OP_ALL' variable not defined. I just started learning mql4, any help is appreciated.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
This works in scripts but not in EA.
Comment( Commentary + " | Closing All Orders, please wait ..." );
CloseAll( "None", 0, OP_ALL ,MaxRetry, Slippage, Commentary );
Comment("");
When compiling EA it gives error 'OP_ALL' variable not defined. I just started learning mql4, any help is appreciated.