mt4 or mt5?
Ahmet Metin Yilmaz:
mt4 or mt5?
At this moment I accept any of them...
mt4 or mt5?
this close at profit not a predefined price
you can change its code or use in this way
https://www.mql5.com/en/code/10597

Close at Profit
- www.mql5.com
CloseAtProfit is an EA that I use only to close orders after defined profit, or loss, you can define if to close only trades on current symbol or to close all orders on all symbols, to close only opened trades or also delete pending orders. I am using it in live trading. I have closed with it more than 200 trades at once, without any problem...
Ahmet Metin Yilmaz:
This might work! I have to do some testing, but thank you, it's a good bet.
this close at profit not a predefined price
you can change its code or use in this way
https://www.mql5.com/en/code/10597
FabioLinhares:
This might work! I have to do some testing, but thank you, it's a good bet.
This might work! I have to do some testing, but thank you, it's a good bet.
youre welcome
I use MT5. Hope this code is usefull..
#include <Trade\Trade.mqh> CTrade Trd; input double TargetPrice = 0; //fill with the price target. void OnTick() { double v_price = SymbolInfoDouble(_Symbol,SYMBOL_LAST); if ( v_price == TargetPrice ) { Trd.PositionClose(_Symbol); CancelOrders(); } } void CancelOrders() { CTrade mytrade; int o_total = OrdersTotal(); for(int j=o_total-1; j>=0; j--) { ulong o_ticket = OrderGetTicket(j); string sym = OrderGetString(ORDER_SYMBOL); if( o_ticket!=0 && sym == _Symbol ) { // delete the pending order mytrade.OrderDelete(o_ticket); Print(_Symbol," Pending order ",o_ticket," deleted sucessfully!"); } } }
Fernando Lima:
I use MT5. Hope this code is usefull..
I actually need to close all orders if 1 of 2 prices are reached. Can you add this to the code ?

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
Do you know of any EA that closes all open trades and pending orders if a predetermined price is reached ?
Thanks.