no indicator history

 

I am still learning to code and I wrote this basic indicator which graphs the difference between the closes plus the volume. The problem is I can't get it to load the historical chart data. I think I am just misusing the loop function but can't figure it out. Thank you for any help.


//+------------------------------------------------------------------+
//|                                                         DVTT.mq4 |
//|                                                                  |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright ""
#property link      ""

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- input parameters
extern int       Timecount=60;
//---- buffers
double DVTTBuffer[];
string DVT;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
  IndicatorBuffers(1);

//---- indicators
   SetIndexBuffer(0,DVTTBuffer);
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,3);
   
   DVT="DVTT("+DVTTBuffer[0]+")";
   IndicatorShortName(DVT); 
   
//----
   return(0);
  }

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    i,counted_bars=IndicatorCounted();
   double volumecount;
   double distancecount;
   double DVTT;
   int limit;
   
   limit=Bars-counted_bars-1;
   while(i>=0)                      
     {
      DVTT=0;
      distancecount=0;
      volumecount=0;
      for(i=limit; i>=0; i--)
      {
         distancecount= Close[1] - Close[0];
         volumecount = Volume[0];
         DVTT = (distancecount+volumecount);
       } 
   
   
      DVTTBuffer[0]= DVTT;
      
     
      }
   
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
 
jhtumblin:

I am still learning to code and I wrote this basic indicator which graphs the difference between the closes plus the volume. The problem is I can't get it to load the historical chart data. I think I am just misusing the loop function but can't figure it out. Thank you for any help.


I figured it out thanks though.

Reason: