
//+------------------------------------------------------------------+
//| MATime.mq4 |
//| Copyright 2023, AM2 |
//| https://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2023, AM2"
#property link "https://www.forexsystems.biz"
#property version "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 1
input double k=1.2;
input string t1="10:00";
input string t2="20:00";
double ma[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
SetIndexStyle(0,DRAW_LINE,0,2,Aqua);
SetIndexBuffer(0,ma);
//---
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<111; i++)
{
if(time[i]>StringToTime(t1) && time[i]<StringToTime(t2))
ma[i]=close[i+1]+k*(close[i]-close[i+1]);
}
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
Можно и это как-то исправить?посмотрел. индикатор корректно работает только на ТФ Н1
AM2