Hello,
i search any solutions for close one or more order opened manualy with my EA manager following the instruction "CLOSE ALL ORDER WITH COMMENT...".
Example: I have a very good and profitable manual strategy with one or more position on markets...
In a manual trading is not possible specifi a ID number...now is possible to enter a comment before open the order.
For manage my multiple open position i want to take a comment "EURUSDstrategy1"...
I have other position opened in the same pair...
How to close only this opened position with this comment taken the other open???
Thanks.
YOU DON'T. NEVER EVER USE THE COMMENT SECTION OF A TICKET FOR ORDER TRACKING.
The comment field on tickets is a dynamic field and is subject to modification by the broker.
Track your tickets via the Symbol and Magic number.
MT4
https://docs.mql4.com/trading/ordermagicnumber
MT5
There is additional information on the trade structure and such in the documentation.
- docs.mql4.com
YOU DON'T. NEVER EVER USE THE COMMENT SECTION OF A TICKET FOR ORDER TRACKING.
The comment field on tickets is a dynamic field and is subject to modification by the broker.
Track your tickets via the Symbol and Magic number.
MT4
https://docs.mql4.com/trading/ordermagicnumber
MT5
There is additional information on the trade structure and such in the documentation.
Ok but...
My order is manualy opened...OK.
My expert advisors is only for manage my opened position.
If i have more than one position opened in a same simbol with a different strategies exsample.....Strategie1 and Strategie2
If the order are placed manualy how my expert manager identify how order are to close and how NOT...in the identic simbol...???
If i place the order manualy the order not have magic number...
i search any solutions for close one or more order opened manualy with my EA manager following the instruction "CLOSE ALL ORDER WITH COMMENT...".
Example: I have a very good and profitable manual strategy with one or more position on markets...
In a manual trading is not possible specifi a ID number...now is possible to enter a comment before open the order.
For manage my multiple open position i want to take a comment "EURUSDstrategy1"...
I have other position opened in the same pair...
How to close only this opened position with this comment taken the other open???
As @Jack Thomas has correctly stated, never use the Comment field as it can easily be changed by your broker - use the Magic Number instead.
Since, in manual trading, you can't set the Magic Number, use an EA assistant or "Order Manager" to place the orders for you with the Magic Number you wish to use. @whroeder1 has shared such a tool on the forum (I attached it too), based on an original in the CodeBase - Indicators: 'Money Manager Graphic Tool' indicator by 'takycard' Forum - Page 5
Then you can modify its code and add functionality to this tool to automate your closing of all trades for that specific "magic number". See the original CodeBase entry for instructions on how to use it: Money Manager Graphic Tool
- votes: 39
- 2015.09.10
- takycard
- www.mql5.com
Ok but...
...
If i place the order manualy the order not have magic number...
Ok but...
My order is manualy opened...OK.
My expert advisors is only for manage my opened position.
If i have more than one position opened in a same simbol with a different strategies exsample.....Strategie1 and Strategie2
If the order are placed manualy how my expert manager identify how order are to close and how NOT...in the identic simbol...???
If i place the order manualy the order not have magic number...
Create 2 scripts. One for buy and one for sell.
Script #1: BUY.mq4
This will create a buy ticket with 0.01 lots, and it will have the magic number of 123
void OnStart(){ int ticket=OrderSend(Symbol(),OP_BUY,0.01,Ask,6,0,0,"",123,0,clrNONE); Alert("Ticket #"+(string)ticket+" BUY order created."); }
Script #2: SELL.mq4
Copy the above example code, and change it to sell.
Bind the scripts to their individual hot-keys.
Set the BUY hotkey to ALT-B
Set the SELL hotkey to ALT-S
Set the Magic number in the script, and it will create tickets with the required magic number assignment.
Then you just need to set your EA to manage any ticket with the magic number of 123 or whatever.
- Jack
- 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,
i search any solutions for close one or more order opened manualy with my EA manager following the instruction "CLOSE ALL ORDER WITH COMMENT...".
Example: I have a very good and profitable manual strategy with one or more position on markets...
In a manual trading is not possible specifi a ID number...now is possible to enter a comment before open the order.
For manage my multiple open position i want to take a comment "EURUSDstrategy1"...
I have other position opened in the same pair...
How to close only this opened position with this comment taken the other open???
Thanks.