Disliked{quote} Unfortunately it is decompiled code so it is unlikely anyone on this Forum will work with it.Ignored
#property strict
datetime lastUpdateTime = 0;
double highArray[];
double lowArray[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
ArraySetAsSeries(highArray, true);
ArraySetAsSeries(lowArray, true);
SetIndexBuffer(0, highArray);
SetIndexBuffer(1, lowArray);
SetIndexStyle(0, DRAW_LINE);
SetIndexStyle(1, DRAW_LINE);
SetIndexLabel(0, "High Line");
SetIndexLabel(1, "Low Line");
SetIndexDrawBegin(0, 3); // Start drawing from the fourth bar
SetIndexDrawBegin(1, 3);
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[])
{
if (TimeDayOfYear(time[0]) != TimeDayOfYear(lastUpdateTime))
{
ArraySetAsSeries(highArray, false);
ArraySetAsSeries(lowArray, false);
for (int i = 0; i < 3; i++)
{
highArray[i] = high[i];
lowArray[i] = low[i];
}
ArraySetAsSeries(highArray, true);
ArraySetAsSeries(lowArray, true);
lastUpdateTime = time[0];
}
return(rates_total);
}
trying to run an indicator that connects the high and low of the last 3 candles on a daily tf with a line.