I'm having a senior moment - help needed!

 
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Blue
#property indicator_maximum 2
#property indicator_minimum -2

int TestBuffer[];

//+------------------------------------------------------------------+
//| Init 
//+------------------------------------------------------------------+
int init()
   {
   SetIndexBuffer(0,TestBuffer);
   SetIndexLabel(0,"TestResult");
   return(0);
   }
   
//+------------------------------------------------------------------+
//| Finish 
//+------------------------------------------------------------------+
int deinit()
   {
   return(0);
   }
   
//+------------------------------------------------------------------+
//| Main Program
//+------------------------------------------------------------------+
int start()
   {  
   int ChangedBars = Bars - IndicatorCounted();
   
   for(int i=0; i<ChangedBars; i++)
      {
      if(Close[i] >= Open[i])
         {
         TestBuffer[i] = 1;
         }
      else
         {
         TestBuffer[i] = -1;
         }
      
      }  //Next i
      
      
   return;
   }

Hi everyone.

I was coding something which worked before I went to bed and didn't work when I got up. This can happen when you get older.

The code contained here produces an empty (but properly scaled) window and no result in the "Data Window". Can anyone see why I have no curve in my chart. 

 

Hello onedognight,

Have you tried checking the mt4 journal for errors?

Thank you.

 
WhooDoo22:

Hello onedognight,

Have you tried checking the mt4 journal for errors?

Thank you.


Yes: "loaded successfully" but showing nothing.
 
onedognight:

Yes: "loaded successfully" but showing nothing.

Try to add SetIndexStyle()
 
phi.nuts:

Try to add SetIndexStyle()

I got a result when I changed the buffer to double.
 
onedognight:

I got a result when I changed the buffer to double.

Ups, I didn't notice that integer  :D.

What's the display result, line or histogram ? 

 
phi.nuts:

Ups, I didn't notice that integer  :D.

What's the display result, line or histogram ? 


Plot is a line. Thanks, everyone.
Reason: