Please help with : Draw Wingdings for Custom indicator

Erik Bakker  
#property strict
#property indicator_chart_window
#property indicator_buffers 10
#property indicator_plots 4

#property indicator_label1 "Start FVG Bull"
#property indicator_label2 "End FVG Bull"
#property indicator_label3 "Low FVG Bull"
#property indicator_type3 DRAW_ARROW
#property indicator_color3 clrGreen
#property indicator_label4 "High FVG Bull"
#property indicator_type4 DRAW_ARROW
#property indicator_color4 clrGreen 
#property indicator_label5 "Found FVG Bull"

#property indicator_label6 "Start FVG Bear"
#property indicator_label7 "End FVG Bear"
#property indicator_label8 "Low FVG Bear"
#property indicator_type8 DRAW_ARROW
#property indicator_color8 clrRed
#property indicator_label9 "High FVG Bear"    
#property indicator_type9 DRAW_ARROW 
#property indicator_color9 clrRed
#property indicator_label10 "Found FVG Bear"

double Start_FVG_Bull[];
double End_FVG_Bull[];
double High_FVG_Bull[];
double Low_FVG_Bull[];
double Found_FVG_Bull[];
double Start_FVG_Bear[];
double End_FVG_Bear[];
double High_FVG_Bear[];
double Low_FVG_Bear[];
double Found_FVG_Bear[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,Start_FVG_Bull,INDICATOR_DATA);
   SetIndexBuffer(1,End_FVG_Bull,INDICATOR_DATA);
   SetIndexBuffer(2,Low_FVG_Bull,INDICATOR_DATA);
   SetIndexBuffer(3,High_FVG_Bull,INDICATOR_DATA);
   SetIndexBuffer(4,Found_FVG_Bull,INDICATOR_DATA);
   SetIndexBuffer(5,Start_FVG_Bear,INDICATOR_DATA);
   SetIndexBuffer(6,End_FVG_Bear,INDICATOR_DATA);
   SetIndexBuffer(7,High_FVG_Bear,INDICATOR_DATA);
   SetIndexBuffer(8,Low_FVG_Bear,INDICATOR_DATA);
   SetIndexBuffer(9,Found_FVG_Bear,INDICATOR_DATA);
   IndicatorSetInteger(INDICATOR_DIGITS,5);
   PlotIndexGetInteger(2,PLOT_ARROW,160);
   PlotIndexGetInteger(3,PLOT_ARROW,160);
   PlotIndexGetInteger(7,PLOT_ARROW,160);
   PlotIndexGetInteger(8,PLOT_ARROW,160);
   
   //---
   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>rates_total; i--)
     {
      if(iHigh(NULL,PERIOD_CURRENT,3)<iClose(_Symbol,PERIOD_CURRENT,2) && iHigh(NULL,PERIOD_CURRENT,3)<iLow(_Symbol,PERIOD_CURRENT,1))
        {
         Start_FVG_Bull[i] = iTime(NULL,PERIOD_CURRENT,3);
         End_FVG_Bull[i] = iTime(NULL,PERIOD_CURRENT,1);
         High_FVG_Bull[i] = iHigh(_Symbol,PERIOD_CURRENT,3);
         Low_FVG_Bull[i] = iLow(_Symbol,PERIOD_CURRENT,1);
         Found_FVG_Bull[i] = 1;
         Print("Start FVG is: ",TimeToString(Start_FVG_Bull[i],TIME_DATE|TIME_MINUTES),"  | for bar i: ", i);
         Print("End FVG is: ",TimeToString(End_FVG_Bull[i],TIME_DATE|TIME_MINUTES),"  | for bar i: ", i);
         Print("High FVG is: ",High_FVG_Bull[i],"| for bar i: ", i);
         Print("Low FVG is: ",Low_FVG_Bull[i],"| for bar i: ", i);
        }
      else if(iLow(_Symbol,PERIOD_CURRENT,3)>iClose(_Symbol,PERIOD_CURRENT,2) && iHigh(_Symbol,PERIOD_CURRENT,1)<iLow(_Symbol,PERIOD_CURRENT,3))
        {
         Start_FVG_Bear[i] = iTime(NULL,PERIOD_CURRENT,3);
         End_FVG_Bear[i] = iTime(NULL,PERIOD_CURRENT,1);
         High_FVG_Bear[i] = NormalizeDouble(iHigh(_Symbol,PERIOD_CURRENT,1),6);
         Low_FVG_Bear[i] = NormalizeDouble(iLow(_Symbol,PERIOD_CURRENT,3),6);
         Found_FVG_Bear[i] = 1;
         Print("Start FVG is: ",TimeToString(Start_FVG_Bear[i],TIME_DATE|TIME_MINUTES),"  | for bar i: ", i);
         Print("End FVG is: ",TimeToString(End_FVG_Bear[i],TIME_DATE|TIME_MINUTES),"  | for bar i: ", i);
         Print("High FVG is: ",High_FVG_Bear[i],"| for bar i: ", i);
         Print("Low FVG is: ",Low_FVG_Bear[i],"| for bar i: ", i);
        }
      else
        {
         Start_FVG_Bull[i] = 0;
         End_FVG_Bull[i] = 0;
         High_FVG_Bull[i] = 0;
         Low_FVG_Bull[i] = 0;
         Found_FVG_Bull[i] = -1;
         Start_FVG_Bear[i] = 0;
         End_FVG_Bear[i] = 0;
         High_FVG_Bear[i] = 0;
         Low_FVG_Bear[i] = 0;
         Found_FVG_Bear[i] = -1;
        }
      //Comment("Start FVG = ", TimeToStr(Start_FVG_Bull[i],TIME_DATE|TIME_MINUTES)," |  End FVG = ",TimeToStr(End_FVG_Bull[i],TIME_DATE|TIME_MINUTES)," |  High_FVG_Bull[i] = ",High_FVG_Bull[i]," |  Low_FVG_Bull[i] = ",Low_FVG_Bull[i], " |  i = ",i," |  Found_FVG_Bull = ",Found_FVG_Bull[i]);
      //Comment("Start FVG = ", TimeToStr(Start_FVG_Bear[i],TIME_DATE|TIME_MINUTES)," |  End FVG = ",TimeToStr(End_FVG_Bear[i],TIME_DATE|TIME_MINUTES)," |  High_FVG_Bear[i] = ",High_FVG_Bear[i]," |  Low_FVG_Bear[i] = ",Low_FVG_Bear[i], " |  i = ",i," |  Found_FVG_Bear = ",Found_FVG_Bear[i]);
     }
//--- return value of prev_calculated for next call
   return(rates_total);

Can someone please help me understand why I don't get any Drawing on my chart with this mql5 custom indicator. The arrays show de necessary values... Please help.. I am missing something...

William Roeder  

What are you getting? Why are you getting? Why are you ignoring the result?

   PlotIndexGetInteger(2,PLOT_ARROW,160);
   PlotIndexGetInteger(3,PLOT_ARROW,160);
   PlotIndexGetInteger(7,PLOT_ARROW,160);
   PlotIndexGetInteger(8,PLOT_ARROW,160);
Erik Bakker  
William Roeder #:

What are you getting? Why are you getting? Why are you ignoring the result?

Sorry william, you speak in riddles to me...
Fernando Carreiro  
Erik Bakker: Can someone please help me understand why I don't get any Drawing on my chart with this mql5 custom indicator. The arrays show de necessary values... Please help.. I am missing something...

Then please show screenshots of what you are getting and explain in detail what you are expecting.

Also, why are you using this ...

if(iHigh(NULL,PERIOD_CURRENT,3)<iClose(_Symbol,PERIOD_CURRENT,2) && iHigh(NULL,PERIOD_CURRENT,3)<iLow(_Symbol,PERIOD_CURRENT,1))
{
   Start_FVG_Bull[i] = iTime(NULL,PERIOD_CURRENT,3);

... when the data has already been passed to you by the OnCalculte() parameters ...

if( high[3] < close[2] && high[3] < low[1] )
{
   Start_FVG_Bull[i] = time[3];

Also, use Prints() very sparingly and in a controlled way in Indicators, or preferably use the Debugger in MetaEditor.

The way you are doing it is going to make your indicator extremely slow and fill up the logs quickly and create tremendously large log files.

William Roeder  
Erik Bakker #: Sorry william, you speak in riddles to me...

Look at the code in #1 very carefully. The key word was "get".

Tobias Johannes Zimmer  
Have you started with MQL5/Indicators/Examples/Fractals? If not start with this code and change it step by step to your requiremebts.