Attachments forums

List of attachments posted on this forum.


All files on forums: 159943

Re: Coding Help

mrtools, Fri Apr 27, 2018 5:30 pm

shaileshm wrote: Thu Apr 26, 2018 6:16 pm hi someone please help..i am trying to see the ticks as compared to those for a few candles back.

This is what I have coded

Code: Select all

#property indicator_separate_window
#property indicator_buffers 1


#property indicator_color1 ForestGreen





double DUptick1[];
double DUptick[];


extern int PeriodOC=5;

//+------------------------------------------------------------------+
//| indicator initialization                                         |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorShortName("VolumeDif("+Symbol()+")");
  
   SetIndexBuffer(0,DUptick);


  
   SetIndexStyle(0,DRAW_HISTOGRAM,0,4);


   

  
   
   return(0);
  }
  

 
//+------------------------------------------------------------------+
//| indicator function                                               |
//+------------------------------------------------------------------+ 
int start()
  {
   int counted_bars=IndicatorCounted();
   int i,limit;
//----
   if(counted_bars==0)
      limit=Bars-PeriodOC;
   if(counted_bars>0)
      limit=Bars-counted_bars;
   limit--;
   for(i=limit; i>=0; i--)

         DUptick1[i]= ((Volume[i]+(Close[i]-Open[i])/Point)/2);
         DUptick[i]= DUptick1[i]-DUptick1[i+PeriodOC];

         


//----
   return(0);
  }
//+------------------------------------------------------------------+
Unfortunately it does not display anything. Please some tell me how to code it correctly.
Looking at the name guessing you were trying something like this one, also posting a version of blau tvi which uses a smoothed volume, maybe that will help
All files in topic