//+------------------------------------------------------------------+
if(f_IsNewBar()==true)
{
if(Open[1]-Close[1]>0 && Open[2]-Close[2]>0 && Open[3]-Close[3]>0)
{
ticket1 = OrderSend(_Symbol,OP_BUY,UstLot(),Ask,Slippage,Stop(0),Prof(0),NULL,Magic,clrAqua);
ticket2 = OrderSend(_Symbol,OP_SELL,UstLot(),Bid,Slippage,Stop(1),Prof(1),NULL,Magic,clrAqua);
}
}
//+------------------------------------------------------------------+
double Stop(int order_type=-1)
{
double sl =0.0;
if(order_type==0) sl = NormalizeDouble(Bid-MarketInfo(Symbol(),MODE_STOPLEVEL)*Point,Digits);
if(order_type==1) sl = NormalizeDouble(Ask+MarketInfo(Symbol(),MODE_STOPLEVEL)*Point,Digits);
return(sl);
}
//+------------------------------------------------------------------+