да то что нужно, что за поручитель на форуме новичок много не понимаю
//+------------------------------------------------------------------+
//| Open.mq4 |
//| Copyright 2019, AM2 |
//| http://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, AM2"
#property link "http://www.forexsystems.biz"
#property version "1.00"
#property strict
#property indicator_chart_window
input int p1=50;
input int p2=100;
input int p3=150;
input int p4=300;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Горизонтальная линия |
//+------------------------------------------------------------------+
void PutHLine(string name,double p,color clr)
{
ObjectDelete(0,name);
ObjectCreate(0,name,OBJ_HLINE,0,0,p);
//--- установим цвет линии
ObjectSetInteger(0,name,OBJPROP_COLOR,clr);
//--- установим толщину линии
ObjectSetInteger(0,name,OBJPROP_WIDTH,1);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
//---
double op=iOpen(NULL,PERIOD_MN1,0);
PutHLine("op",op,Blue);
PutHLine("opp1",op+p4*_Point,Red);
PutHLine("opm1",op-p4*_Point,Red);
if(open[0]<op+p4*_Point && Bid>op+p4*_Point) Alert(_Symbol+" Пересечение линии!");
if(open[0]>op-p4*_Point && Bid<op-p4*_Point) Alert(_Symbol+" Пересечение линии!");
if(high[0]>op+p4*_Point && Bid==high[0]-p1*_Point) Alert(_Symbol+" Откат от уровня + "+(string)p1);
if(low[0]<op+-p4*_Point && Bid==low[0]+p1*_Point) Alert(_Symbol+" Откат от уровня - "+(string)p1);
if(high[0]>op+p4*_Point && Bid==high[0]-p2*_Point) Alert(_Symbol+" Откат от уровня + "+(string)p2);
if(low[0]<op-p4*_Point && Bid==low[0]+p2*_Point) Alert(_Symbol+" Откат от уровня - "+(string)p2);
if(high[0]>op+p4*_Point && Bid==high[0]-p3*_Point) Alert(_Symbol+" Откат от уровня + "+(string)p3);
if(low[0]<op-p4*_Point && Bid==low[0]+p3*_Point) Alert(_Symbol+" Откат от уровня - "+(string)p3);
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
AM2