Custom Indicator not drawing lines, but data Prints out in Experts tab - page 3

Ernst Van Der Merwe
7791
Ernst Van Der Merwe  
omega13lives:

This is driving me crazy!  I modified my code to what you posted and I STILL don't see the lines on my chart.  I even removed it, recompiled and put it back on the chart... nothing.  It shows in the list but does not show in the Data window either.  What could I possibly be doing wrong?  The 2 indicators mentioned here show on the screen and the Fractal_Channel indi from MetaQuotes shows on the screen, but uses different calculations, but mine does not.  Any ideas?

Maybe add some checks to see if it actually initializes.

int OnInit()
  {
   //firstTime=true;
//--- Create handle of the Indicator Fractals 
   if((FractalsHandle=iFractals(_Symbol,_Period))==INVALID_HANDLE)
      {
       Print("Initialization failed!");
       return(INIT_FAILED);
      }
   //Print("FractalsHandle = ",FractalsHandle); 
//---- drawing settings
//--- Set the arrays as timeseries 
   //ArrayResize(Ups,numberOfBars,0);
   ArraySetAsSeries(Ups,true); 
   //ArrayResize(Downs,numberOfBars,0);
   ArraySetAsSeries(Downs,true); 
   
   IndicatorSetInteger(INDICATOR_DIGITS,Digits());
  
   SetIndexBuffer(0,v1,INDICATOR_DATA);
   ArraySetAsSeries(v1,true);
   //PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,998);//i-1);
    

   SetIndexBuffer(1,v2,INDICATOR_DATA);
   ArraySetAsSeries(v2,true);
   //PlotIndexSetInteger(1,PLOT_DRAW_BEGIN,998);//i-1);
   Print(INIT_SUCCEEDED);
   return(INIT_SUCCEEDED);
  }
omega13lives
40
omega13lives  
Ernst Van Der Merwe:

Maybe add some checks to see if it actually initializes.

I get errors Void returns a value.  Then I noticed I had set OnInit to void, not int.  Ouch.  Fixed and got no error from the handle and INIT_SUCCEEDED is 0 which the documentation says is a success.

Ernst Van Der Merwe
7791
Ernst Van Der Merwe  
omega13lives:

I get errors Void returns a value.  Then I noticed I had set OnInit to void, not int.  Ouch.  Fixed and got no error from the handle and INIT_SUCCEEDED is 0 which the documentation says is a success.

The attached indicator is doing what I assume you want?

If it's not working then I don't know what could be wrong.


Files:
omega13lives
40
omega13lives  
Ernst Van Der Merwe:

The attached indicator is doing what I assume you want?

If it's not working then I don't know what could be wrong.


Yes, this one works fine, thanks.  I just can't figure out why mine won't display on the screen since you said it does for you.  Hopefully I'll figure it out so I can learn something.