You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
//here is the attempt to move stop to even once price is achieved 10 pips away from open price.......
if(AccountProfit()>=10)
{
for(k=OrdersTotal()-1;k>=0;k--)
{
if((OrderSelect(k,SELECT_BY_POS,MODE_TRADES))&& OrderType()==OP_BUY)
{
if(Bid >= (OrderOpenPrice()+10*Point))
{
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Orange);
GlobalVariableSet("MOD",1);
Print("Risk eliminated-stop moved to even");
}
}
if((OrderSelect(k,SELECT_BY_POS,MODE_TRADES))&& OrderType()==OP_SELL)
{
if(Ask <= (OrderOpenPrice()-10*Point))
{
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Orange);
GlobalVariableSet("MOD",1);
Print("Risk eliminated-stop moved to even");
}
}
}
}
}