On Chart Accumulation Distribution

 
BarrowBoy:

E

Its there, see https://docs.mql4.com/indicators/iAD

Or https://www.mql5.com/en/search

Also see On Balance Volume

Good Luck

-BB-

hi,

I'm looking for the indicator of accumulation/distribution that shows on chart not in a separate window. None of those links has it that i'm aware of and i already did an extensive search though this site and google. maybe mt4 doesn't have one but i thought it did. i'm not a coder so i would not know how to modify the regular indicator or i would.

 
//+------------------------------------------------------------------+
//| Accumulation.mq4 |
//| Copyright © 2005, MetaQuotes Software Corp. |
//| http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/"

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 LightSeaGreen
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorShortName("A/D");
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Accumulation/Distribution |
//+------------------------------------------------------------------+
int start()
{
int i,counted_bars=IndicatorCounted();
//----
i=Bars-counted_bars-1;
while(i>=0)
{
double high =High[i];
double low =Low[i];
double open =Open[i];
double close=Close[i];
ExtMapBuffer1[i]=(close-low)-(high-close);
if(ExtMapBuffer1[i]!=0)
{
double diff=high-low;
if(0==diff)
ExtMapBuffer1[i]=0;
else
{
ExtMapBuffer1[i]/=diff;
ExtMapBuffer1[i]*=Volume[i];
}
}
if(i<Bars-1) ExtMapBuffer1[i]+=ExtMapBuffer1[i+1];
i--;
}
//----
return(0);
}
//+------------------------------------------------------------------+
 

i changed the code to:

#property indicator_chart_window


but it produced horizontal straight lines on the screen that weren't of any use.

any suggestions?

Reason: