Skip to main content

% AD (Accumulation Distribution Oscillator) for Amibroker (AFL)

prasadbrao about 14 years ago Amibroker (AFL)

  • Rating:
    4 / 5 (Votes 11)
  • Tags:
    oscillator, amibroker

My never ending quest for technical analysis made me reject my own work a hundred times.

Nevertheless sky is the limit.

In technical analysis volumes play a major role. But there are only a few volume indicators available. After lots of digging i was able to design 3 to four volume based indicators which can be used in charts to predict the moves.

The accumulation distribution is one such volume indicator. Merely using the formula of Accumulation Distribution to draw a chart shows u a line which is difficult to predict.

After going through various books I got this idea of designing the Accumulation Distribution Oscillator also known a % AD.

Thus this oscillator provides a more rationale visual trend as compared to the traditional Accumulation Distribution Line.

Using single indicators can prove dangerous and erode you hard earned money. Always use indicators in combination to other indicators.

The Accumulation Distribution Oscillator can be used with %B of Bollinger Band to predict correct moves and abstain from false and fake signals.

I shall post the other volume based indicators in my further posts.

Regards,

Prasad Rao.

Screenshots

Indicator / Formula

Copy & Paste Friendly
SetChartBkColor( ParamColor("Chart Color", colorBlack));
_SECTION_BEGIN("BACKGROUD LTRS");
SetChartOptions(0,chartShowArrows|chartShowDates);
GfxSetOverlayMode(1);
GfxSetTextAlign( 6 );// center alignment
GfxSetTextColor( ParamColor("Text Color", ColorHSB( 42, 42, 42 ) ));
GfxSetBkMode(0); // transparent
GfxSelectFont("Tahoma", Status("pxheight")/12);
GfxTextOut( "PRASAD ANALYTICS ©", Status("pxwidth")/2, Status("pxheight")/14);
GfxSelectFont("Tahoma", Status("pxheight")/9 );
GfxTextOut( Name(), Status("pxwidth")/2, Status("pxheight")/4.1 );
GfxSelectFont("Arial Narrow", Status("pxheight")/28 );
GfxTextOut( "prasad9rao@gmail.com", Status("pxwidth")/2, Status("pxheight")/1.5);
GfxSelectFont("arial narrow", Status("pxheight")/27 );
GfxTextOut( "Dedicated to MY FATHER : BALKRISHNA RAO", Status("pxwidth")/2, Status("pxheight")/1.15);
_SECTION_END();
k = (GetPerformanceCounter()/100)%256; 
printf("GetPerformance Counter %g",k);
GfxSelectFont("Arial Narrow", 10,700 ); 
GfxSetBkMode(1); 
GfxSetTextColor(colorYellow); 
//GfxTextOut("Dedicated to the loving memory of MY FATHER",100+k ,26); 

RequestTimedRefresh(1); 
_SECTION_END();
VOLDAYS1 = Param("AD DAYS",20,1,50,1);
AD_PER = Sum((Close-Open)/(High-Low)*Volume,VOLDAYS1)/Sum(Volume,VOLDAYS1);
mycolorAD =IIf  (AD_PER<0,ColorRGB(252,255,200) , IIf( AD_PER>0,ColorRGB(252,255,0),ColorRGB(125,84,11)));
Plot(AD_PER,"AD%",mycolorAD ,styleHistogram);
GfxSetTextAlign( TA_left = 0);
GfxSelectFont("Tahoma", 11, 700 ); 
GfxSetTextColor(ColorRGB(209,191,255)); 
GfxTextOut("PRASAD ANALYTICS - % Accu Dist",07, 0); 
GfxSetTextAlign( TA_LEFT = 0 );
GfxSelectFont("Tahoma", 11, 700 ); 
GfxSetTextColor(ColorRGB(255,180,61)); 
GfxTextOut(Name()+ "   " + Date(),07,30); 
GfxSetTextColor(ColorRGB(109,101,255)); 
GfxTextOut("AD[ "+VOLDAYS1+" ]"+" = "+NumToStr(AD_PER,1.2),07, 14); 
Title = " "; 

10 comments

2. classy
about 14 years ago
thanks a lot for nice afl sharing.1st afl looking cool…bro is it possible to share 1st afl?
3. hotaro3
about 14 years ago

unfortunatly in my chart nothing appearing and always AD (20) shows EMPTY

about 14 years ago

@hotaro3…..

Try this and see.. U have to get it in ur amibroker

SetChartBkColor( ParamColor("Chart Color", colorBlack));
_SECTION_BEGIN("BACKGROUD LTRS");
SetChartOptions(0,chartShowArrows|chartShowDates);
GfxSetOverlayMode(1);
GfxSetTextAlign( 6 );// center alignment
GfxSetTextColor( ParamColor("Text Color", ColorHSB( 42, 42, 42 ) ));
GfxSetBkMode(0); // transparent
GfxSelectFont("Tahoma", Status("pxheight")/12);
GfxTextOut( "PRASAD ANALYTICS ©", Status("pxwidth")/2, Status("pxheight")/14);
GfxSelectFont("Tahoma", Status("pxheight")/9 );
GfxTextOut( Name(), Status("pxwidth")/2, Status("pxheight")/4.1 );
GfxSelectFont("Arial Narrow", Status("pxheight")/28 );
GfxTextOut( "prasad9rao@gmail.com", Status("pxwidth")/2, Status("pxheight")/1.5);
GfxSelectFont("arial narrow", Status("pxheight")/27 );
GfxTextOut( "Dedicated to MY FATHER : BALKRISHNA RAO", Status("pxwidth")/2, Status("pxheight")/1.15);SECTION_END();
VOLDAYS1 = Param("AD DAYS",20,1,50,1);
AD_PER = Sum((Close-Open)/(High-Low)*Volume,VOLDAYS1)/Sum(Volume,VOLDAYS1);
mycolorAD =IIf  (AD_PER<0,ColorRGB(252,255,200) , IIf( AD_PER>0,ColorRGB(252,255,0),ColorRGB(125,84,11)));
Plot(AD_PER,"AD%",mycolorAD ,styleHistogram);
GfxSetTextAlign( TA_left = 0);
GfxSelectFont("Tahoma", 11, 700 ); 
GfxSetTextColor(ColorRGB(209,191,255)); 
GfxTextOut("PRASAD ANALYTICS - % Accu Dist",07, 0); 
GfxSetTextAlign( TA_LEFT = 0 );
GfxSelectFont("Tahoma", 11, 700 ); 
GfxSetTextColor(ColorRGB(255,180,61)); 
GfxTextOut(Name()+ "   " + Date(),07,30); 
GfxSetTextColor(ColorRGB(109,101,255)); 
GfxTextOut("AD[ "+VOLDAYS1+" ]"+" = "+NumToStr(AD_PER,1.2),07, 14); 
Title = " ";
over 10 years ago

I applied ur indicator. On some stocks its showing histogram but on many of the stocks its not showing histogram. How to rectify this. Pls suggest

about 9 years ago

Thank you for your indicator. I have applied it and i had the same problem as sushant09in.

Leave Comment

Please login here to leave a comment.