Quote:
|
Originally Posted by Sonic
hi cardio.
i am also in process creating my ea and woking for same kind of functionality.
take this as an example.
double exit1 = 30;
double exit2 = 60;
double exit3 = 90;
// above three lines are there for profit levels..
//
if(OrderType() == OP_SELL) and if(OrderType() == OP_BUY)
you must have this code for buy and sell where you close your open positions right?
below these lines you need to add the condition to close the above 3 exits
lets use for sell and only 1
///
static int lots = { number of lots } // this is just to control the lots..
if{ normal stuff}
else if ( Ask < OrderOpenPrice() - exit1 ) * Point && lots >= {number} )
{
CloseOrder{}...
lots--;
}
-- more else if'sssss
////
this is one way to do it
hope this helps..!
-sonic.
|
Ok to add to above desc what i am doing is to decrease a pos after 30 pip and then 60 and then 90 . but might not be exactly what you are looking for but you could get a idea from this ..
-sonic.