Page 69 of 158

Re: Coding Help

Posted: Thu Apr 12, 2018 12:19 pm
by shaileshm
hi guys,

I am trying to code a simple indicator showing the uptick and downtick histo seperately. Unfortunatels it seems it shows only the upticks. This is the code i am using

Code: Select all

#property indicator_separate_window
#property indicator_buffers 2


#property indicator_color1 ForestGreen
#property indicator_color2 OrangeRed




double Uptick[];
double Dntick[];



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

  
   SetIndexStyle(0,DRAW_HISTOGRAM,0,2);
   SetIndexStyle(1,DRAW_HISTOGRAM,0,2);

   

  
   
   return(0);
  }
  
//+------------------------------------------------------------------+
//| indicator deinitialization                                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   return(0);
  }
 
//+------------------------------------------------------------------+
//| indicator function                                               |
//+------------------------------------------------------------------+ 
int start()
  {
   int counted_bars=IndicatorCounted();
   int i,limit;
//----
   if(counted_bars==0)
      limit=Bars-1;
   if(counted_bars>0)
      limit=Bars-counted_bars;
   limit--;
   for(i=limit; i>=0; i--)

         Uptick[i]=(Volume[i]+(Close[i]-Open[i])/Point)/2;
         Dntick[i]=-Volume[i]+(Volume[i]+(Close[i]-Open[i])/Point)/2;
         


//----
   return(0);
  }
//+------------------------------------------------------------------+
can someone please correct the code so that it shows both the histo?

Re: Coding Help

Posted: Fri Apr 13, 2018 4:40 am
by tayna13
Is it possible to make the arrow not disappear??

Re: Coding Help

Posted: Fri Apr 13, 2018 5:38 am
by mntiwana
tayna13 wrote: Fri Apr 13, 2018 4:40 am Is it possible to make the arrow not disappear??
Mq4 format files (not decompiled) required to see the code for any alteration

Re: Coding Help

Posted: Sat Apr 14, 2018 1:47 am
by PriyaPandian
mrtools wrote: Thu Apr 12, 2018 4:19 am

Added all the averages.
Hi mrtools,

I need the nonlagma coding part as I am getting error as Out of range error. Please share that nonlagma for this file

Re: Coding Help

Posted: Sat Apr 14, 2018 3:21 am
by mrtools
PriyaPandian wrote: Sat Apr 14, 2018 1:47 am

Hi mrtools,

I need the nonlagma coding part as I am getting error as Out of range error. Please share that nonlagma for this file
Not getting that error on the version i posted

Re: Coding Help

Posted: Sat Apr 14, 2018 3:23 am
by mrtools
tayna13 wrote: Fri Apr 13, 2018 4:40 am Is it possible to make the arrow not disappear??
Can't do anything with an ex4 file.

Re: Coding Help

Posted: Tue Apr 17, 2018 3:20 am
by shaileshm
I am trying to plot the number of upticks and downticks in a candle seperately . And I want the value to be updated every tick. Can someone tell me if this commands are alright or if I need to use something else here.

Code: Select all

 
 Uptick[i]=(Volume[i]+(Close[i]-Open[i])/Point)/2;
 Dntick[i]=-Volume[i]+(Volume[i]+(Close[i]-Open[i])/Point)/2;
  

Re: Coding Help

Posted: Tue Apr 17, 2018 4:00 am
by mrtools
shaileshm wrote: Tue Apr 17, 2018 3:20 am I am trying to plot the number of upticks and downticks in a candle seperately . And I want the value to be updated every tick. Can someone tell me if this commands are alright or if I need to use something else here.

Code: Select all

 
 Uptick[i]=(Volume[i]+(Close[i]-Open[i])/Point)/2;
 Dntick[i]=-Volume[i]+(Volume[i]+(Close[i]-Open[i])/Point)/2;
  
Maybe something like this

Code: Select all

 upTicks[i] = (Volume[i]+(Close[i]-Open[i])/Point) / 2.0;
  dnTicks[i] = (Volume[i] - upTicks[i]);
  

Re: Coding Help

Posted: Wed Apr 18, 2018 1:13 pm
by thiru
Can someone help to migrate this code to support the new MT builts?

The code looks quite heavy.

thanks in advance


Re: Coding Help

Posted: Wed Apr 18, 2018 3:01 pm
by mntiwana
thiru wrote: Wed Apr 18, 2018 1:13 pm Can someone help to migrate this code to support the new MT builts?

The code looks quite heavy.

thanks in advance


BJF-AdaptiveCyberCycle-3.2.mq4
Try now - 100 plus errors removed and max number of bars reduced from 2000 to 500,if needed reduce more