или подскажите что нужно здесь поменять еще кроме (iHigh на iOpen: iLow на iClose).
Так как нужно еще условие на открытие ордера --бай всегда выше тела свечи на n- пунктов, а сел -- всегда ниже свечи на n- пунктов
if (buy<1&&TimeBarbuy!=TimeDay(CurTime()))
{
MaxPrice=iHigh(NULL,Period1,LastDay)+NormalizeDouble(Delta*Point,Digits);
if (Ask+STOPLEVEL*Point>MaxPrice) MaxPrice = NormalizeDouble(Ask+STOPLEVEL*Point,Digits);
if (TP!=0) TrPr = NormalizeDouble(MaxPrice + TP * Point,Digits);
if (SL!=0) StLo = NormalizeDouble(MaxPrice - SL * Point,Digits);
error=OrderSend(Symbol(),OP_BUYSTOP ,Lot,MaxPrice,3,StLo,TrPr,"BUYSTOP BLD",magic,expiration,Blue);
if (error==-1) Alert("Error BUYSTOP ",GetLastError()," ",Symbol()," Lot ",Lot," Price ",MaxPrice," SL ",StLo," TP ",TrPr," expiration ",expiration);
else TimeBarbuy=TimeDay(CurTime());
}
if (sel<1&&TimeBarSell!=TimeDay(CurTime()))
{
MinPrice=iLow(NULL,Period1,LastDay)-NormalizeDouble(Delta*Point,Digits);
if (Bid-STOPLEVEL*Point<MinPrice) MinPrice = NormalizeDouble(Bid-STOPLEVEL*Point,Digits);
if (TP!=0) TrPr = NormalizeDouble(MinPrice - TP * Point,Digits);
if (SL!=0) StLo = NormalizeDouble(MinPrice + SL * Point,Digits);
error=OrderSend(Symbol(),OP_SELLSTOP,Lot,MinPrice,3,StLo,TrPr,"SELLSTOP BLD",magic,expiration,Red );
if (error==-1) Alert("Error SELLSTOP ",GetLastError()," ",Symbol()," Lot ",Lot," Price ",MinPrice," SL ",StLo," TP ",TrPr," expiration ",expiration);
else TimeBarSell=TimeDay(CurTime());
}