Well, it looks good to me but is not working at all.
I'm trying to code a Trailing Stop Loss that will move upon a predetermined profit. Pretty standard concept but my coding has been going around in circles.
Here's what I have on this ...
// ------------------------------------
//+------------------------------------------------------------------+
// Move stop loss - Long |
//+------------------------------------------------------------------+
if (OrderFind(magicnolong))
{//open order
OrderSelect(glbOrderTicket,SELECT_BY_TICKET,MODE_TRADES);
if (glbOrderType==OP_BUY) //long open
{
if(Bid-TrailingStopLoss>OrderOpenPrice() && OrderStopLoss()<Bid-TrailingStopLoss)
OrderModify(glbOrderTicket, OrderOpenPrice(),
NormalizeDouble(Bid-TrailingStopLoss*Point,Digits), OrderTakeProfit(), 0, CLR_NONE);
}
}
// -------------------------------------
The EA compiles fine but this part simply doesn't work.
Would appreciate if someone could spot where I'm missing the mark here and let me know.
Thank you...
Pip Parade
I'm trying to code a Trailing Stop Loss that will move upon a predetermined profit. Pretty standard concept but my coding has been going around in circles.
Here's what I have on this ...
// ------------------------------------
//+------------------------------------------------------------------+
// Move stop loss - Long |
//+------------------------------------------------------------------+
if (OrderFind(magicnolong))
{//open order
OrderSelect(glbOrderTicket,SELECT_BY_TICKET,MODE_TRADES);
if (glbOrderType==OP_BUY) //long open
{
if(Bid-TrailingStopLoss>OrderOpenPrice() && OrderStopLoss()<Bid-TrailingStopLoss)
OrderModify(glbOrderTicket, OrderOpenPrice(),
NormalizeDouble(Bid-TrailingStopLoss*Point,Digits), OrderTakeProfit(), 0, CLR_NONE);
}
}
// -------------------------------------
The EA compiles fine but this part simply doesn't work.
Would appreciate if someone could spot where I'm missing the mark here and let me know.
Thank you...
Pip Parade