программист что это за абра-кадабра?
//+------------------------------------------------------------------+
//| TrendLine.mq5 |
//| Copyright 2024, AM2. |
//| http://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2024, AM2."
#property link "http://www.forexsystems.biz"
#property version "1.00"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots 2
#property indicator_color1 clrLime
#property indicator_color2 clrRed
#property indicator_width1 4
#property indicator_width2 4
#property indicator_type1 DRAW_LINE
#property indicator_type2 DRAW_LINE
#property strict
double up[];
double dn[];
input int Count = 10;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
SetIndexBuffer(0,up,INDICATOR_DATA);
SetIndexBuffer(1,dn,INDICATOR_DATA);
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| 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[])
{
//---
for(int i=0; i<rates_total; i++)
{
double hi=iHighest(NULL,0,MODE_HIGH,Count,i);
double lo=iLowest(NULL,0,MODE_LOW,Count,i);
if(close[i]>(hi+lo)/2)
{
up[i]=(hi+lo)/2;
}
if(close[i]<(hi+lo)/2)
{
dn[i]=(hi+lo)/2;
}
}
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
AM2