I do not understand were the problem is

 

I have a source code here that is not working, however I don't quite understand the problem. According to the compiler it does not handle the two bool functions at the bottom. Low, high, open and close are not defined. I thank you already for the help.

//+------------------------------------------------------------------+
//|                                                 HammerSignal.mq5 |
//|                                        Copyright 2022, Arthur S. |
//|                    https://www.mql5.com/en/users/michael12345678 |
//+------------------------------------------------------------------+
#property copyright "Copyright 2022, Arthur S."
#property link      "https://www.mql5.com/en/users/michael12345678"
#property version   "1.00"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots 2

#property indicator_label1 "Arrow - Up"
#property indicator_type1 DRAW_ARROW
#property indicator_color1 clrYellow

#property indicator_label2 "Arrow - Down"
#property indicator_type2 DRAW_ARROW
#property indicator_color2 clrAqua

double UpBuffer[];
double DownBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
{
   SetIndexBuffer(0,UpBuffer,INDICATOR_DATA);
   PlotIndexSetInteger(0,PLOT_ARROW,233);
   SetIndexBuffer(1,DownBuffer,INDICATOR_DATA);
   PlotIndexSetInteger(1,PLOT_ARROW,234);
   
   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[])
{
   MqlRates m_Rates[];
   CopyRates(_Symbol,_Period,0,rates_total,m_Rates);
   ArraySetAsSeries(m_Rates,true);
   
   ArraySetAsSeries(UpBuffer,true);
   ArraySetAsSeries(DownBuffer,true);
   ArraySetAsSeries(open,true);
   ArraySetAsSeries(close,true);
   ArraySetAsSeries(high,true);
   ArraySetAsSeries(low,true);
   
   for(int i=rates_total-2;i>=0;i--)
   {
      UpBuffer[i]=0;
      DownBuffer[i]=0;
      
      if(BullishHammer(i)==true)
      {
         UpBuffer[i]=low[i];
      }
      if(BearishHammer(i)==true)
      {
         DownBuffer[i]=high[i];
      }
   }
   
   return(rates_total);
}
//+------------------------------------------------------------------+
bool BullishHammer(int i)
  {
   double body_size = close[i] - open[i];
   if(body_size <= 0)                    return(false); // reject (a bearish or doji candle)
   double candle_range = high[i] - low[i];
   if(body_size < candle_range/3)        return(false); // reject (body is less than 1/3)
   if(open[i] < low[i] + candle_range/2) return(false); // reject (body is in lower 1/2)
   return(true);
  }

bool BearishHammer(int i)
  {
   double body_size = open[i] - close[i];
   if(body_size <= 0)                    return(false); // reject (a bullish or doji candle)
   double candle_range = high[i] - low[i];
   if(body_size < candle_range/3)        return(false); // reject (body is less than 1/3)
   if(open[i] > low[i] + candle_range/2) return(false); // reject (body is in upper 1/2)
   return(true);
  }
 
Arthur Singer: I have a source code here that is not working, however I don't quite understand the problem. According to the compiler it does not handle the two bool functions at the bottom. Low, high, open and close are not defined. I thank you already for the help.

Why are you copying the rates again, when the OnCalculate function is already supplying all the rates history for you?

And on top of that you are copying it on every single tick and you don't even reference ever again.

Also in your other functions, you are trying to reference the arrays provided by OnCalculate, but you never pass them to those functions at all?