Forex
Google
New signals service!

Go Back   Forex Trading > Discussion Areas > General Discussion


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-27-2006, 07:49 AM
Junior Member
 
Join Date: Oct 2005
Posts: 10
bdandi is on a distinguished road
How to partial close an open position.....

Dear All,

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-27-2006, 08:05 AM
elihayun's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 350
elihayun is on a distinguished road
Quote:
Originally Posted by bdandi
Dear All,

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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-27-2006, 10:07 AM
Junior Member
 
Join Date: Oct 2005
Posts: 10
bdandi is on a distinguished road
Quote:
Originally Posted by elihayun
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).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-27-2006, 10:33 AM
elihayun's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 350
elihayun is on a distinguished road
Quote:
Originally Posted by bdandi
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 think u can't do that. Instead open 3 pending orders with the lot size and T/P that u like
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-27-2006, 11:21 AM
DanielTyrkiel's Avatar
Senior Member
 
Join Date: Nov 2005
Posts: 176
DanielTyrkiel is on a distinguished road
Perhaps there could be a script written for it?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 06-27-2006, 11:39 AM
firedave's Avatar
Senior Member
 
Join Date: Nov 2005
Location: Jakarta, Indonesia
Posts: 416
firedave is on a distinguished road
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"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 06-27-2006, 01:56 PM
Senior Member
 
Join Date: Jun 2006
Posts: 313
EACAN is on a distinguished road
Hi,

My first attempt would be


// lets difine our ea variables only what we need to get the lots functionality

extern double Lots = 0.4; // the total order size you need.
extern double OneLot = 0.1; // How many lots you want to take off.

// lets define Tp
extern double firstTP = 20;
extern double secondTP = 40;
extern double thirdTP = 60;
extern double fourthTP = 80;


int start()
{

// 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 06-27-2006, 02:01 PM
Senior Member
 
Join Date: Jun 2006
Posts: 313
EACAN is on a distinguished road
Quote:
Originally Posted by EACAN
Hi,

My first attempt would be


// lets difine our ea variables only what we need to get the lots functionality

extern double Lots = 0.4; // the total order size you need.
extern double OneLot = 0.1; // How many lots you want to take off.

// lets define Tp
extern double firstTP = 20;
extern double secondTP = 40;
extern double thirdTP = 60;
extern double fourthTP = 80;


int start()
{

// 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 06-27-2006, 02:34 PM
Junior Member
 
Join Date: Oct 2005
Posts: 10
bdandi is on a distinguished road
Thanks elihayun and Firedave for your advice.

bdandi
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 07-09-2006, 11:53 PM
babarmughal's Avatar
Senior Member
 
Join Date: Apr 2006
Posts: 315
babarmughal is on a distinguished road
Smile How to partial close an open position.....

Hi Guys,

How can I partially close an open position when the price reaches a certain point...

Thanks
Babar
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Close Position(s) when Price hits MA zhu28ming Setup Questions 2 01-18-2007 06:34 AM
Managing your position after its open... Kurka Fund Expert Advisors - Metatrader 4 2 11-30-2006 11:10 PM
Alarm or close current position when price hit a MA. zhu28ming Expert Advisors - Metatrader 4 1 09-26-2006 11:04 PM
close open position one shot manually dreamer Setup Questions 1 07-07-2006 01:08 PM
Checking for open position caldolegare Metatrader 4 1 01-26-2006 07:00 PM


All times are GMT. The time now is 06:58 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.