Taking partial profits?
How would you do this in MT3?
I have tried just about everything I can think of.
It won't let me assign Lots to anything and if I make another defined variable smaller than Lots it gives me weird errors...
So how would I do this???... here is some code for example... {this code doesn't work as soon as I remove the close order line the errors disappear.}
I have tried just about everything I can think of.
It won't let me assign Lots to anything and if I make another defined variable smaller than Lots it gives me weird errors...
So how would I do this???... here is some code for example... {this code doesn't work as soon as I remove the close order line the errors disappear.}
Lots: 0.30
Defines: LotTP1(0.10);
If Bid-OrderValue(cnt,VAL_OPENPRICE)>40*Point AND Reset2==0 AND
Bid-OrderValue(cnt,VAL_OPENPRICE)<75*Point and OrderValue(cnt,VAL_LOTS)>LotTP1 Then
{
CloseOrder(OrderValue(cnt,VAL_TICKET,LotTP1,Bid,3,LawnGreen);
Reset2=1;
Exit;
};
well I might have figured it out finally......
If Reset2==2 and OrderValue(cnt,VAL_LOTS)>LotTP Then
{
CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_LOTS)/2,Bid,3,RoyalBlue);
Exit;
};
If Reset2==2 and OrderValue(cnt,VAL_LOTS)>LotTP Then
{
CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_LOTS)/2,Bid,3,RoyalBlue);
Exit;
};
My strategy requeires that I take partial profits along the way. So if I enter an order (long) with say 3 lots, how do I set the "take profits" order to only sell 1 lot, instead of closing the whole position?
Thanks!
Erik