I've got an EA in place which carries a "Move Stop Loss" function. The idea is to get to break-even asap then secure a small profit before allowing the trade to run. Unfortunately, it (they) don't seem to trigger consistently.
Would appreciate analysis/suggestions by the programmers in the group. Parts of the code is below:
//---- input parameters
extern int TargetMoveStopPipsA=15;
extern int StopMovePipsA=0;
extern int TargetMoveStopPipsB=30;
extern int StopMovePipsB=5;
------------------------------------------
if (OrderFind(magicno))
{//open order
if (glbOrderType==OP_BUY)
{//long open
if (Bid-glbOpenPrice>TargetMoveStopPipsA*Point && glbStopPrice<glbOpenPrice)OrderModify(glbOrderTicket,
OrderOpenPrice(), NormalizeDouble(glbOpenPrice+StopMovePipsA*Point,Digits), OrderTakeProfit( ) , 0, Orange) ;
}
-----------------------------------------
if (OrderFind(magicno))
{//open order
if (glbOrderType==OP_BUY)
{//long open
if (Bid-glbOpenPrice>TargetMoveStopPipsB*Point && glbStopPrice<glbOpenPrice)OrderModify(glbOrderTicket,
OrderOpenPrice(), NormalizeDouble(glbOpenPrice+StopMovePipsB*Point,Digits), OrderTakeProfit( ) , 0, Orange) ;
}
Thanks ...
Would appreciate analysis/suggestions by the programmers in the group. Parts of the code is below:
//---- input parameters
extern int TargetMoveStopPipsA=15;
extern int StopMovePipsA=0;
extern int TargetMoveStopPipsB=30;
extern int StopMovePipsB=5;
------------------------------------------
if (OrderFind(magicno))
{//open order
if (glbOrderType==OP_BUY)
{//long open
if (Bid-glbOpenPrice>TargetMoveStopPipsA*Point && glbStopPrice<glbOpenPrice)OrderModify(glbOrderTicket,
OrderOpenPrice(), NormalizeDouble(glbOpenPrice+StopMovePipsA*Point,Digits), OrderTakeProfit( ) , 0, Orange) ;
}
-----------------------------------------
if (OrderFind(magicno))
{//open order
if (glbOrderType==OP_BUY)
{//long open
if (Bid-glbOpenPrice>TargetMoveStopPipsB*Point && glbStopPrice<glbOpenPrice)OrderModify(glbOrderTicket,
OrderOpenPrice(), NormalizeDouble(glbOpenPrice+StopMovePipsB*Point,Digits), OrderTakeProfit( ) , 0, Orange) ;
}
Thanks ...