Not drawing arrows

 

Hi everyone, please tell me what is wrong why it doesnt draw any arrows? It is mql5

//+------------------------------------------------------------------+
//|                                                      testing.mq5 |
//|                                  Copyright 2023, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_plots 1
#property indicator_type1 DRAW_ARROW
#property indicator_width1 3
#property indicator_color1 clrRed
//--- indicator buffers
double         sellBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,sellBuffer,INDICATOR_DATA);
//--- setting a code from the Wingdings charset as the property of PLOT_ARROW
   PlotIndexSetInteger(0,PLOT_ARROW,234);
   //PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,10);
   //PlotIndexSetInteger(0,PLOT_ARROW_SHIFT,15);
   
//---
   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<100;i++)
     {
   sellBuffer[i]=iClose(NULL,PERIOD_CURRENT,i);
   }
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+


Thanks

Files:
testing.mq5  3 kb
 
Hgu Gh:

Hi everyone, please tell me what is wrong why it doesnt draw any arrows? It is mql5


Thanks

sellBuffer[i]=iClose(NULL,PERIOD_CURRENT,i);

Your buffer is not set as series, but iClose works as series.

You are possibly getting arrows on the very beginning of the chart.

Reason: