Hello,
So what im trying to do is... When 50 points are reached, move my stop to break even.
But what ends up happening, it moves my stop to breakeven, but then every pip it goes up so does my stop. Like a trailing stop. BUT, if it goes down.. my stop moves down too ... thus pointless... How do I get this to run once without it moving with the current price?
SelectTrailingStopValue = 50 pips say ..
if (SelectTrailingStop == "Yes")
{
for(int x=0;x<=OrdersTotal();x++)
{
OrderSelect(x,SELECT_BY_POS,MODE_TRADES);
if(OrderMagicNumber() == 16384)
{
// OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,CLR_NONE);
if (OrderProfit() > SelectTrailingStopValue)
{
//Move stop to BE
OrderModify(OrderTicket(),OrderOpenPrice(),Ask-SelectTrailingStopValue*Point,OrderTakeProfit(),0,Blue);
}
}
}
}
So what im trying to do is... When 50 points are reached, move my stop to break even.
But what ends up happening, it moves my stop to breakeven, but then every pip it goes up so does my stop. Like a trailing stop. BUT, if it goes down.. my stop moves down too ... thus pointless... How do I get this to run once without it moving with the current price?
SelectTrailingStopValue = 50 pips say ..
if (SelectTrailingStop == "Yes")
{
for(int x=0;x<=OrdersTotal();x++)
{
OrderSelect(x,SELECT_BY_POS,MODE_TRADES);
if(OrderMagicNumber() == 16384)
{
// OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,CLR_NONE);
if (OrderProfit() > SelectTrailingStopValue)
{
//Move stop to BE
OrderModify(OrderTicket(),OrderOpenPrice(),Ask-SelectTrailingStopValue*Point,OrderTakeProfit(),0,Blue);
}
}
}
}
Know your indicators!