//+++++++++++++++++++++++++++++УСТАНОВКА ФЛАГОВ BUY & SELL
extern bool AlertON = true;
extern bool DrawARROW = true;
double diClose=iClose(NULL,0,1);
double diOpen=iOpen(NULL,0,0);
double diLow=iLow(NULL,0,0);
double diHigh=iHigh(NULL,0,0);
double diTime=iTime(NULL,0,0);
int Signal;
//+++++++++++++++++++++++++++++УСТАНОВКА ФЛАГА BUY
if ((diOpen<ma)&&(diClose>ma))
{
if (DrawARROW && Signal==0)
{
ObjectDelete("BUY");
ObjectCreate("BUY",OBJ_ARROW,0,diTime,diHigh,0,0,0,0);
ObjectSet ("BUY",OBJPROP_ARROWCODE,236);
ObjectSet ("BUY",OBJPROP_COLOR, Blue);
Signal=1;
}
if (AlertON&&(diOpen<ma)&&(diClose>ma)) Alert(Symbol()+ " ПРОБИТ УРОВЕНЬ"+ LineName1+ "\n"+
"РЕКОМЕНДУЕТСЯ ПОКУПКА");
}
//+++++++++++++++++++++++++++++УСТАНОВКА ФЛАГА SELL
if ((diOpen>ma)&&(diClose<ma))
{
if (DrawARROW && Signal==0)
{
ObjectDelete("SELL");
ObjectCreate("SELL",OBJ_ARROW,0,diTime,diLow,0,0,0,0);
ObjectSet ("SELL",OBJPROP_ARROWCODE,238);
ObjectSet ("SELL",OBJPROP_COLOR, Red);
Signal=-1;
}
if (AlertON&&(diOpen>ma)&&(diClose<ma)) Alert(Symbol()+ " ПРОБИТ УРОВЕНЬ"+ LineName1+ "\n"+
"РЕКОМЕНДУЕТСЯ ПРОДАЖА");
}