Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
How do I close the trade to take partial profit in MT4? For example sell 0.4 lot, take profit for 0.1 lot at 20 pips, 0.1 lot at 40 pips, 0.1 lot at 60 pips and 0.1 lot at 80 pips. The terminal only shows TP for the whole order (i.e. 0.4 lot).
How do I close the trade to take partial profit in MT4? For example sell 0.4 lot, take profit for 0.1 lot at 20 pips, 0.1 lot at 40 pips, 0.1 lot at 60 pips and 0.1 lot at 80 pips. The terminal only shows TP for the whole order (i.e. 0.4 lot).
Thanks in advance
bdandi
Close the order after u change the lot value. U can overwrite the lot value in any numbe u want (up to the order lot value)
Close the order after u change the lot value. U can overwrite the lot value in any numbe u want (up to the order lot value)
Thanks elihayun,
I've managed to close as you suggested for Instant Execution but I still haven't figure out for Pending Execution (i.e. I want the partial order to close once the TP is reached without waiting at the computer).
I've managed to close as you suggested for Instant Execution but I still haven't figure out for Pending Execution (i.e. I want the partial order to close once the TP is reached without waiting at the computer).
I think u can't do that. Instead open 3 pending orders with the lot size and T/P that u like
If you enter a trade with 0.4 lot and like to have seperate TP for each 0.1 lot, just make 4 limit order, 0.1 lot each, for each TP. Then when you get back to your PC, close any limit order that filled with CLOSE-BY command. I think this feature can also coded to a script. Hope this help
__________________ David Michael H
"Trader helps traders with sincerity, honesty and integrity"
// This variable is used for taking lots
double ls = Lots; // 0.4
// Lets start closing say our sell position after some 1st Tp,2nd TP etc.
total = OrdersTotal();
for(cnt = 0; cnt<OrdersTotal(); cnt++)
{
OrderSelect(cnt,Select_BY_POS, Mode_Trades);
if(OrderSymbol() == Symbol() && OrderType() == OP_SELL )
{
// Close the First Lot at 20 TP..
if(Bid>(OrderOpenPrice()+firstTp*Point)&& ls>= 0.4) //(1)
OrderClose(OrderTicket(),OneLot,Bid,3,CLR_NONE);
// You could now modify the SL to be placed at the price you opened
//the order or as you wish how you want to trail.
ls--;
return(0);
}
}
}
(1). I am using ls as a control variable to decrease the lot each time we meet our tp.. Note that i am using every time 0.4,0.3etc( just to show how one can compare with the total lots .
(2). This is how you would close the second lot see i am checking as <= (less or equals)
else if(Bid>(OrderOpenPrice()+secondTP*Point)&& ls <= 0.3)
{
OrderClose(OrderTicket(),OneLot,Bid,3,CLR_NONE);
ls--;
return(0);
}
Ofcourse there are better ways to write this code but this is my first attempt.
// This variable is used for taking lots
double ls = Lots; // 0.4
// Lets start closing say our sell position after some 1st Tp,2nd TP etc.
total = OrdersTotal();
for(cnt = 0; cnt<OrdersTotal(); cnt++)
{
OrderSelect(cnt,Select_BY_POS, Mode_Trades);
if(OrderSymbol() == Symbol() && OrderType() == OP_SELL )
{
// Close the First Lot at 20 TP..
if(Bid>(OrderOpenPrice()+firstTp*Point)&& ls>= 0.4) //(1)
OrderClose(OrderTicket(),OneLot,Bid,3,CLR_NONE);
// You could now modify the SL to be placed at the price you opened
//the order or as you wish how you want to trail.
ls--;
return(0);
}
}
}
(1). I am using ls as a control variable to decrease the lot each time we meet our tp.. Note that i am using every time 0.4,0.3etc( just to show how one can compare with the total lots .
(2). This is how you would close the second lot see i am checking as <= (less or equals)
else if(Bid>(OrderOpenPrice()+secondTP*Point)&& ls <= 0.3)
{
OrderClose(OrderTicket(),OneLot,Bid,3,CLR_NONE);
ls--;
return(0);
}
Ofcourse there are better ways to write this code but this is my first attempt.
regards
EACAN
One thing more which i wrote is that we could modify the stoploss everytime we close the last order and place it as we wish