//---- buy
if(Close[1]-Open[1]>0 && p<1)
{
res=OrderSend(Symbol(),OP_BUY,Lot,Ask,5,Ask-StopLoss*Point,Ask+TakeProfit*Point,"",MAGIC,0,Blue);
}
//---- sell
if(Open[1]-Close[1]>0 && p<1)
{
res=OrderSend(Symbol(),OP_SELL,Lot,Bid,5,Bid+StopLoss*Point,Bid-TakeProfit*Point,"",MAGIC,0,Red);
}
AM2