готово: www.opentraders.ru/downloads/2110/
индикатор начинает искать максимум между последними 2-я минимумами
//+------------------------------------------------------------------+
//| Gisto.mq4 |
//| Copyright 2018, AM2 |
//| http://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, AM2"
#property link "http://www.forexsystems.biz"
#property version "1.00"
#property strict
#property indicator_separate_window
#property indicator_buffers 2
double up[];
double dn[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
SetIndexStyle(0,DRAW_HISTOGRAM,0,4,Lime);
SetIndexStyle(1,DRAW_HISTOGRAM,0,4,Red);
SetIndexBuffer(0,up);
SetIndexBuffer(1,dn);
//---
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=1;i<1000;i++)
{
if(close[i]-open[i]>0) up[i]=(close[i]-open[i])/_Point/i;
if(close[i]-open[i]<0) dn[i]=(close[i]-open[i])/_Point/i;
}
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
делим каждую разницу цены на номер вычисляемого бара
В течение дня сделки не активировались. На ночь компьютер выключаю
AM2