.


Re: Coding help ...

#682
alpha24 wrote:
Thu Apr 12, 2018 3:42 am
Dear Mrtools ,
I tried to add NLMA in this code there is no error but can not displayed on chart.
Please correct it. if there is already awesome oscillator with all averages and prices
please give me link.(searched everywhere but can't get)
Added all the averages.
Attachments
awesome avgs.png
Awesome (arrows + alerts + mtf) 1.04.ex4
(146.39 KiB) Downloaded 111 times
https://www.myfxbook.com/portfolio/mt4-34359973/2590095

Re: Coding help ...

#683
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?
Know Thy Setup. Know Thyself.


Re: Coding help ...

#686
mrtools wrote:
Thu Apr 12, 2018 4:19 am
alpha24 wrote:
Thu Apr 12, 2018 3:42 am
Dear Mrtools ,
I tried to add NLMA in this code there is no error but can not displayed on chart.
Please correct it. if there is already awesome oscillator with all averages and prices
please give me link.(searched everywhere but can't get)
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 ...

#689
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;
  
Know Thy Setup. Know Thyself.

Re: Coding help ...

#690
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]);
  
https://www.myfxbook.com/portfolio/mt4-34359973/2590095


Who is online

Users browsing this forum: No registered users and 1 guest