Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

BullVol VS BearVol with percentae(%) for Amibroker (AFL)

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

HI ALL,

I have just modified the bull vol vs bear vol afl to show the percentage.

I hope that will help you.

Thanks.

Similar Indicators / Formulas

Febo RSI ..real indicator
Submitted by abhinavsingh about 13 years ago
Trading Volume Statistic
Submitted by tuanstock1 over 10 years ago
Ergodic Oscillator
Submitted by dljtrader about 14 years ago
3 Days Track
Submitted by janet0211 over 14 years ago
Chande Momentum Oscillator
Submitted by klimpek about 14 years ago

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Bull vs Bear");
SetChartBkColor(colorTeal);
//Plot( C, "Close", colorLightGrey, styleCandle, Zorder = 1);
SetChartOptions(0,chartShowArrows | chartShowDates);
/* basic variable defs 
 ud: up-Day (Close up from Open)
 dd: down-Day (Close down from Open)
 uc: up-Close (Close up from previous Close)
 dc: down-Close: (Close down from previous Close)
*/ 
C1 = Ref(C, -1);
uc = C > C1; dc = C <= C1;
ud = C > O; dd = C <= O;
 
/*
Volume Day types:
 green: up-day and up-close
 yellow: up-day but down-close
 red: down-day and down-close
 blue: down-day but up-close
 white: close equals open, close equals previous close
 
(currently unused vtypes are for future enhancements)
*/
green = 1; blue = 2; yellow = 3; red = 4; white = 5;
VType = IIf(ud,            
            IIf(uc, green, yellow),
         IIf(dd,
            IIf(dc, red, blue), white));
 
/* green volume: up-day and up-close*/
gv = IIf(VType == green, V, 0);
/* yellow volume: up-day but down-close */
yv = IIf(VType == yellow, V, 0);
/* red volume: down-day and down-close */
rv = IIf(VType == red, V, 0);
/* blue volume: down-day but up-close */
bv = IIf(VType == blue, V, 0);
 
/* split up volume of up-close days from down-close days - (for the purposes of
this volume display indicator, up-days that closed down from the previous close
are considered bearish volume days, and conversely, down-days that nevertheless
closed up from the previous close are considered bullish volume days - my
testing indicates this is more accurate than using ordinary up-days and
down-days) */
uv = gv + bv; uv1 = Ref(uv, -1); /* up volume */
dv = rv + yv; dv1 = Ref(dv, -1); /* down volume */
 
/* create moving average period parameters */
VolPer = Param("Adjust Vol. MA per.", 34, 1, 255, 1);
ConvPer = Param("Adjust Conv. MA per.", 9, 1, 255, 1);
 
/* create triple exponential moving avearges of separate up and down volume
moving averages */
MAuv = TEMA(uv, VolPer ); mauv1 = Ref(mauv, -1);
MAdv = TEMA(dv, VolPer ); madv1 = Ref(madv, -1);
MAtv = TEMA(V, VolPer );//total volume

/* Switch for Horizontal lines indicating current level of positive and
negative volume for ease in comparing to past highs/lows - toggle via
parmameter window */
OscillatorOnly = Param("Show Oscillator Only", 0, 0, 1, 1);
CompareBullVolume = Param("Show Bull Level", 1, 0, 1, 1);
if(CompareBullvolume AND !OscillatorOnly){
//Plot(SelectedValue(MAuv), "", colorGreen, styleLine);
}
 
CompareBearVolume = Param("Show Bear Level", 1, 0, 1, 1);
if(CompareBearVolume AND !OscillatorOnly){
//Plot(SelectedValue(MAdv), "", colorRed, styleLine);
}
 
/* Volume Segment Switches - toggle via parameter window */
bullvolume = Param("Show Bull Volume", 1, 0, 1, 1);
bearvolume = Param("Show Bear Volume", 1, 0, 1, 1);
totalvolume = Param("Show Total Volume", 1, 0, 1, 1);
 
/* plot volume lines and histograms if toggled on: */
bearToFront = Param("Show Bear Vol in Front", 0, 0, 1, 1);
if(bearToFront AND !OscillatorOnly){
//Plot(MAdv, "", colorRed, styleHistogram|styleNoLabel);
}
if(bullvolume AND !OscillatorOnly){
//Plot(MAuv, "Average Bull Volume", colorGreen, styleHistogram|styleNoLabel);
}
if(bearvolume AND !OscillatorOnly){
//Plot(MAdv, "Average Bear Volume", colorRed, styleHistogram|styleNoLabel);
}
if(totalVolume AND !OscillatorOnly){
//Plot(MAtv, "Total Volume", colorYellow, styleHistogram|styleNoLabel);
//Plot(MAtv, "", colorBlack, styleLine);
}
if(bullvolume AND !OscillatorOnly){
Plot(MAuv, "", colorBrightGreen, styleLine);
}
if(bearvolume AND !OscillatorOnly){
Plot(MAdv, "", colorRed, styleLine);
}
 
/* better visibility of zero line: */

Buy = Cross(MAuv,MAdv);

Sell = Cross(MAdv,MAuv);

Plot(0, "", colorBlue, 1);
PlotShapes(IIf(Buy AND bullvolume AND !OscillatorOnly ,shapeUpArrow,shapeNone),colorBlue,0);
PlotShapes(IIf(Sell AND bearvolume AND !OscillatorOnly,shapeDownArrow,shapeNone),colorRed,0);
/* Rise/Fall Convergence variables:  */
Converge = (TEMA(MAuv - MAdv, ConvPer));
Converge1 = Ref(Converge, -1);
ConvergeUp = Converge > Converge1;
ConvergeOver = Converge > 0;
rising = ConvergeUp AND ConvergeOver;
falling = !ConvergeUp AND ConvergeOver;

/* Rise/Fall Convergence Oscillator Switch  - toggle via parameter window -
(provides a better view of resulting combination of battling bull/bear volume
forces) */
convergenceOscillator = Param("Show Oscillator", 0, 0, 1, 1);
if(convergenceOscillator OR OscillatorOnly){
Plot(Converge, "Bull/Bear Volume Convergence/Divergence", colorViolet,
1|styleLeftAxisScale|styleNoLabel|styleThick);
Plot(0,"", colorYellow, 1|styleLeftAxisScale|styleNoLabel);
}
 
/********************************************************
 Convergence Rise/Fall Shadows:
 
 (provides a more easily visible display of rising and falling  bull/bear
volume convergence) - toggle via parameter window
 
-posiitive Volume exceeding negative Volume: Light shadow
-negative volume exceeding positive volume: dark shadow
-if you use standard gray background - best shadows are:
-my greys: 14 = (216, 216, 216); 15 = (168, 168, 168));
-best substitute? using AB color constants?
-light: colorpalegreen; dark: colorRose;?
-(depends on your color scheme - customize to your tastes)
**********************************************************/
 
/* uncomment if you use my custom color greys: */
riseFallColor = IIf(rising, 14,15); //my custom shadow greys
 
/* comment out if you use my custom color gray shadows: */
/* riseFallColor = IIf(rising, colorPaleGreen,colorRose); */
 
/* Rise/Fall Convergence Plot Switch - toggle via parameter window */
riseFallShadows = Param("Show RiseFallShadows", 0, 0, 1, 1);
if(riseFallShadows){
Plot(IIf(rising OR falling, 1, 0), "", riseFallColor,
styleHistogram|styleArea|styleOwnScale|styleNoLabel);
}
GraphXSpace = 0.5;
_SECTION_END();
_SECTION_BEGIN("Magnified Market Price");
FS=Param("Font Size",20,20,600,1); 
GfxSelectFont("Arial", FS, 700, italic = False, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorBlack));
Hor=Param("Horizontal Position",450,470,650,650);
Ver=Param("Vertical Position",22,22,22,22);
xx=Prec((MAuv /MAtv )*100,2);
yy=Prec((MAdv /MAtv )*100,2);

GfxSelectFont("Arial", 12, 750, italic = False, underline = False, True );
GfxSetBkMode( colorBlack );
GfxSetTextColor(ParamColor("Color",colorYellow) );
GfxTextOut("BULL - "+xx+"%", Hor-50, Ver );
GfxTextOut("BEAR - "+yy+"%", Hor+125, Ver );
_SECTION_END();

2 comments

1. akerstkh

Pretty cool indicator. :-)

2. rajathtrader

nice job

Leave Comment

Please login here to leave a comment.

Back