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

VSA with Spiker and Traded % for Amibroker (AFL)

3 / 5 (Votes 5)
amibroker, volume

This formula is a combination of the Volume Spread Analysis (VSA), Spiker Volume and Traded Percent volume indicators. It provided a complete overview on a stocks volume.


Similar Indicators / Formulas

Kavach Of Karna v2
Submitted by hbkwarez almost 6 years ago
Advanced Elliott Waves
Submitted by MarcosEn over 8 years ago
3_6Day GuaiLiLv
Submitted by motorfly over 8 years ago
Williams Alligator System
Submitted by durgesh1712 over 8 years ago
*Level Breakout system*
Submitted by Tinych over 8 years ago
Horizontal Live Priceline Tool
Submitted by northstar over 8 years ago

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Traded % Oscillator");
//Public Shares
TotalShares = Prec((GetFnData("SharesOut")/100000),2); //// Total Shares (Lacs)
Float = 100 - (GetFnData("InsiderHoldPercent")); //// Director Holdings
Public = GetFnData("sharesfloat"); //// Public Shares (Lacs)
FloatShare = Prec (Float * TotalShares/100,2);
PublicShare = Prec (Public * TotalShares/100,2);
//7 Days Volume
TradeIndicator = ParamToggle("Traded %", "Dekhao|Dekhiona",0);
n = Param("Last n Days Trade", 4, 1, 30, 1 );
VolMA = Prec ((MA(V,n)*n)/100000,2);
// Trade
TotalTrade= Prec (VolMA * 100  / TotalShares,2);
PublicTrade = Prec (VolMA * 100  / PublicShare,2);
FloatTrade = Prec (VolMA * 100  / FloatShare,2);
Style = ParamStyle("Style",styleLine|styleDots|styleThick|styleOwnScale,maskAll);
if( TradeIndicator == 0) {
Plot(FloatTrade, "Floating Shares Trade", ParamColor("Floating Shares Color",colorBlue), Style);
//Plot(PublicTrade, "Public Holding Trade", ParamColor("Public Holding Color",colorred), Style);
//Plot(TotalTrade, "Total Trade", ParamColor("Total Trade Color",colorGreen), Style);

_SECTION_BEGIN("Volume Price Analysis");
D= Param("WMA Vol Period", 15, 1, 500, 1 );
DTL=Param("Linear regression period",60,10,100,10); 
wbf=Param("WRB factor",1.5,1.3,2.5,.1);
nbf=Param("NRB factor",0.7,0.3,0.9,0.1);
TL=LinRegSlope(MA(C, DTL),2); 
Vlp=Param("Volume lookback period",30,20,300,10);
St = StDev(Vrg,Vlp); 
Vp3 = Vrg + 3*st; 
Vp2 = Vrg + 2*st;;
Vp1 = Vrg + 1*st;;
Vn1 = Vrg -1*st; 
Vn2 = Vrg -2*st; 
Vl=V<Ref(V,-1) AND V<Ref(V,-2);
Vh=V>Ref(V,-1) AND Ref(V,-1)>Ref(V,-2);
Vb=V>Vrg OR V>Ref(V,-1);
mcls=x1<2.2 AND x1>1.8 ;
TLL=LinRegSlope(j,40) ;
Tlm=LinRegSlope(j,15) ;

utbar=wrb AND dcls AND tls>0 ;
utcond1=Ref(utbar,-1) AND dnbar ;
utcond2=Ref(utbar,-1) AND dnbar AND V>Ref(V,-1);
utcond3=utbar AND V> 2*Vrg;
trbar=Ref(V,-1)>Vrg  AND Ref(upbar,-1) AND Ref(wrb,-1) AND dnbar AND dcls AND wrb AND tll>0 AND H==HHV(H,10);
Hutbar=Ref(upbar,-1) AND Ref(V,-1)>1.5*Vrg AND dnbar AND dcls AND NOT wrb AND NOT utbar;
Hutcond=Ref(Hutbar,-1) AND dnbar AND dcls AND NOT utbar;
tcbar=Ref(upbar,-1) AND H==HHV(H,5)AND dnbar AND (dcls OR mcls) AND V>vrg AND NOT wrb AND NOT Hutbar ;
Scond1=(utcond1 OR utcond2 OR utcond3) ;
scond=scond1 AND scond2;
stdn0= tll<0 AND V>Ref(V,-1) AND Ref(dnbar,-1) AND upbar AND (ucls OR mcls) AND tls<0 AND tlm<0;
stdn= V>Ref(V,-1) AND Ref(dnbar,-1) AND upbar AND (ucls OR mcls) AND tls<0 AND tlm<0;
stdn1= tll<0 AND V>(vrg*1.5) AND Ref(dnbar,-1) AND upbar AND (ucls OR mcls)AND tls<0 AND tlm<0;
stdn2=tls<0 AND Ref(V,-1)<Vrg  AND upbar AND vhcls AND V>Vrg;
bycond1= stdn OR stdn1;
bycond= upbar  AND Ref(bycond1,-1);
stvol= L==LLV(L,5)  AND (ucls OR mcls) AND V>1.5*Vrg AND tll<0;
ndbar=upbar AND nrb AND Vl  AND dcls ;
nsbar=dnbar AND nrb AND Vl  AND dcls ;
nbbar= C>Ref(C,-1) AND Vl AND nrb AND x1<2;
nbbar= IIf(C>Ref(C,-1) AND V<Ref(V,-1) AND V<Ref(V,-2) AND x1<1.1,1,0);
lvtbar= vl AND L<Ref(L,-1) AND ucls;
lvtbar1= V<Vrg AND L<Ref(L,-1) AND ucls AND tll>0 AND tlm>0 AND wrb;
lvtbar2= Ref(Lvtbar,-1) AND upbar AND ucls;
dbar= V>2*Vrg AND dcls AND upbar AND tls>0 AND tlm>0 AND NOT Scond1 AND NOT utbar;
eftup=H>Ref(H,-1) AND L>Ref(L,-1) AND C>Ref(C,-1) AND C>=((H-L)*0.7+L) AND rg>arg AND V>Ref(V,-1);
eftupfl=Ref(eftup,-1) AND (utbar OR utcond1 OR utcond2 OR utcond3);
eftdn=H<Ref(H,-1) AND L<Ref(L,-1) AND C<Ref(C,-1) AND  C<=((H-L)*0.25+L) AND rg>arg AND V>Ref(V,-1);

SetChartBkGradientFill( ParamColor("BgTop", colorBlack),
ParamColor("BgBottom", colorBlack),ParamColor("Titleblock",colorBlack ));

upcolor=ParamColor("UpCandleColor",colorBlack );
downcolor=ParamColor("DownCandleColor",colorBlack );

//Volume Change

//GraphXSpace = Param("Xspace", 10, 2, 20, 1);
// vol with std
LBP = Param("Look Back", 15, 0, 150,1 );
Mean = MA(ln(V),LBP);
StD = StDev(ln(V),LBP);
xp3 = exp(mean + 2*std); //3 band
xp2 = exp(mean + 1.5*std); //2 nd band
xp1 = exp(mean + 1*std); // 1st band
xm = exp(mean); // avg
xn1 = exp(mean - 1*std); // -1 band
xn2 = exp(mean - 1.5*std); //-2 band

Plot(Volwma, "AvgVol", ParamColor( "AvgColor", colorGold ),ParamStyle("AvgStyle",styleLine|styleThick|styleDots,maskAll),1|4096);

upbar = C > Ref(C,-1);
downbar = C< Ref(C,-1);
barcolor2=IIf(downbar,colorRed, IIf(upbar, colorGreen,19));

upbar = C > Ref(C,-1);
downbar = C< Ref(C,-1);

O = IIf(downbar, V, 0); 
C = IIf(downbar, 0,V);
H = V;

ColorHighliter = IIf(upbar, upcolor,IIf(downbar, downcolor,colorDarkGreen));
SetBarFillColor( ColorHighliter );

PlotOHLC( O,H,L,C, "", barColor2, ParamStyle("CandleStyle",styleCandle,maskAll));


C1 = Ref(C, -1);
uc = C > C1; dc = C <= C1;
ud = C > O; dd = C <= O;

green = 1; blue = 2; yellow = 3; red = 4; white = 5;
VType = IIf(ud,          
         IIf(uc, green, yellow),
         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); 

uv = gv + bv; uv1 = Ref(uv, -1); /* up volume */
dv = rv + yv; dv1 = Ref(dv, -1); /* down volume */

VolPer = Param("Adjust Vol. MA per.", 10, 1, 255, 1);
ConvPer = Param("Adjust Conv. MA per.", 4, 1, 255, 1);

MAuv = TEMA(uv, VolPer ); mauv1 = Ref(mauv, -1);
MAdv = TEMA(dv, VolPer ); madv1 = Ref(madv, -1);
MAtv = TEMA(V, VolPer );//total volume

Converge = (TEMA(MAuv - MAdv, ConvPer));
Converge1 = Ref(Converge, -1);
ConvergeUp = Converge > Converge1;
ConvergeOver = Converge > 0;
rising = ConvergeUp AND ConvergeOver;
falling = !ConvergeUp AND ConvergeOver;

/*convergenceOscillator = Param("Show Oscillator", 0, 0, 1, 1);
OscillatorOnly = Param("Show Oscillator Only", 0, 0, 1, 1);
if(convergenceOscillator OR OscillatorOnly){
Plot(Converge, "Bull/Bear Volume Convergence/Divergence", colorViolet,
Plot(0,"", colorYellow, 1|styleLeftAxisScale|styleNoLabel);

upshadow=ParamColor("UpShadowColor",colorDarkYellow );
downshadow=ParamColor("DownShadowColor",colorDarkGrey );
riseFallColor = IIf(rising, upshadow,downshadow); 

riseFallShadows = Param("Show RiseFallShadows", 1, 0, 1, 1);
Plot(IIf(rising OR falling, 1, 0), "", riseFallColor,ParamStyle("ShadeStyle",styleHistogram|styleArea|styleThick|styleOwnScale|styleNoLabel,maskAll));

/*Plot(IIf(rising OR falling, 1, 0), "", riseFallColor,

//GraphXSpace =5;


_SECTION_BEGIN("Volume Oscillator");

PlusDM= IIf(High>Ref(High,-1) AND Low>=Ref(Low,-1), High-Ref(High,-1),
                 IIf(High>Ref(High,-1) AND Low<Ref(Low,-1)
                 AND High-Ref(High,-1)>Ref(Low,-1)-Low,

Buy= (C-L)*Vm+ (H-O)*Vm + 
         IIf(C>O,(C-O)*Vm,0) + PlusDM*Vm + 

MinDM = IIf(Low<Ref(Low,-1)   AND  High<=Ref(High,-1), Ref(Low,-1)-Low,
               IIf(High>Ref(High,-1) AND Low<Ref(Low,-1)
               AND High-Ref(High,-1)<Ref(Low,-1)-Low, Ref(Low,-1)-Low, 0));

Sell= (H-C)*Vm + (O-L)*Vm + 
         IIf(C<O,(O-C)*Vm,0) + MinDM*Vm + 



PlotShapes( IIf( Buy, shapeHollowSmallCircle, shapeNone ), colorOrange, layer = 0, yposition = H, offset = 4);
PlotShapes( IIf( Buy, shapeHollowSmallCircle, shapeNone ), colorWhite, layer = 0, yposition = H, offset = 10);
Title = Name() + " " + WriteVal(V, 1.0) +   WriteIf(Buy,"  |\\c33 Volume :- Buy","");

Title = Name() 
+ "   " +EncodeColor(colorWhite) +Date()
+ "   " +EncodeColor(colorWhite)+ "Total Vol:  " +EncodeColor(colorYellow)+WriteVal(V,format=1) 
+ "   " +EncodeColor(colorWhite)+ "Vol Change : " + WriteIf(Vol>0,EncodeColor(colorBrightGreen),EncodeColor(colorRed)) +WriteVal(Vol,format=1.2)+ "%  "  
+ "   " +EncodeColor(colorWhite) + "V-Spiker : " +WriteIf(Buy,EncodeColor(colorBrightGreen)+"Buy"," ")+WriteIf(Sell,EncodeColor(colorRed)+"Sell"," ")

+"\n"+EncodeColor(colorWhite)+ D +" WMA Vol: "+EncodeColor(colorYellow)+WriteVal(Volwma,format=1)
+EncodeColor(colorBrightGreen)+WriteIf(V > Volwma,"  Today's Volume is("+WriteVal(Volchange,format=1.2)+")% ABOVE","")
+EncodeColor(colorRed)+WriteIf(V < Volwma, "  Today's Volume is("+WriteVal(Volchange,format=1.2)+")% BELOW","")
+"\n"+EncodeColor(colorWhite) + "Last " +n +" Days Trade : "  + WriteIf(PublicTrade>15,EncodeColor(colorBrightGreen),EncodeColor(colorRed)) + PublicTrade +"%" +EncodeColor(colorWhite)+ " of " +EncodeColor(colorYellow) + PublicShare +EncodeColor(colorWhite)+ " Lacs Public Shares"  
+"\n"+EncodeColor(colorWhite) + "Last " +n +" Days Trade : "  + WriteIf(FloatTrade>10,EncodeColor(colorBrightGreen),EncodeColor(colorRed)) + FloatTrade +"%" +EncodeColor(colorWhite)+ " of " +EncodeColor(colorYellow) + FloatShare +EncodeColor(colorWhite)+ " Lacs Float Shares"
+"\n"+EncodeColor(colorWhite) + "Last " +n +" Days Trade : "  + WriteIf(TotalTrade>5,EncodeColor(colorBrightGreen),EncodeColor(colorRed)) + TotalTrade +"%" +EncodeColor(colorWhite)+ " of " +EncodeColor(colorYellow) + TotalShares +EncodeColor(colorWhite)+ " Lacs Total Shares"
+"\n"+EncodeColor(colorWhite)+ "Volume Price Analysis" + " - " + EncodeColor(colorYellow) +

WriteIf (utbar, " An Upthrust Bar. A sign of weakness. ","")+
WriteIf (utcond1, " A downbar after an Upthrust. Confirm weakness. ","")+
WriteIf (utcond2 AND NOT utcond1, " A High Volume downbar after an Upthrust. Confirm weakness.","")+
WriteIf (utcond3, "This upthrust at very High Voume, Confirms weakness","")+
WriteIf (stdn1, "Strength seen returning after a down trend. High volume adds to strength. ","")+
WriteIf (stdn0 AND NOT stdn, "Strength seen returning after a down trend. ","")+
WriteIf (stdn AND NOT stdn1, "Strength seen returning after a long down trend. ","")+
WriteIf (Lvtbar, "Test for supply. ","")+
WriteIf (Lvtbar2, "An Upbar closing near High after a Test confirms strength. ","")+
WriteIf (bycond, "An Upbar closing near High. Confirms return of Strength. ","")+
WriteIf (dbar, "A High Volume Up Bar closing down in a uptrend shows Distribution. ","")+
WriteIf (Hutbar, "Psuedo UpThrust.   A Sign of Weakness. ","")+
WriteIf (Hutcond, "A Down Bar closing down after a Pseudo Upthrust confirms weakness. ","")+
WriteIf (Lvtbar1, "Test for supply in a uptrend. Sign of Strength. ","")+
WriteIf (stdn2, "High volume upbar closing on the high indicates strength. ","")+
WriteIf (Tcbar, "High volume Downbar after an upmove on high volume indicates weakness. ","")+
WriteIf (ndbar, "No Demand. A sign of Weakness. ","")+
WriteIf (nsbar, "No Supply. A sign of Strength. ","")+
WriteIf (eftup, "Effort to Rise. Bullish sign ","")+
WriteIf (eftdn, "Effort to Fall. Bearish sign ","")+
WriteIf (eftupfl, "Effort to Move up has failed. Bearish sign ","")+
WriteIf (stvol, "Stopping volume. Normally indicates end of bearishness is nearing. ","")

+"\n"+EncodeColor(colorWhite)+ "Volume: "+

WriteIf(V>Vp2,EncodeColor(colorBrightGreen)+"Very High",
WriteIf(V>Vp1,EncodeColor(colorBrightGreen)+" High",
WriteIf(V>Vrg,EncodeColor(colorBrightGreen)+"Above Average",
WriteIf(V<Vrg AND V>Vn1,EncodeColor(colorRed)+"Less than Average",

+(EncodeColor(colorWhite)+"      Spread: ")+

WriteIf(rg >(arg*2),EncodeColor(colorBrightGreen)+" Wide",
WriteIf(rg>arg,EncodeColor(colorBrightGreen)+" Above Average",EncodeColor(colorRed)+" Narrow"))

+(EncodeColor(colorWhite)+"      Close:  ")+

WriteIf(Vhcls,EncodeColor(colorBrightGreen)+"Very High",
WriteIf(dcls,EncodeColor(colorRed)+"Down","Very Low"))))

+EncodeColor(colorWhite)+ "Trend: "
+ "   " +EncodeColor(colorYellow)+ "Short Term: "+
+ "   " +EncodeColor(colorYellow)+ "Mid Term: "+
+ "   " +EncodeColor(colorYellow)+ "Long Term: "+


Vpc= utbar OR utcond1 OR utcond2 OR utcond3 OR stdn0 OR stdn1 OR stdn2 OR stdn OR lvtbar1 OR Lvtbar OR Lvtbar2 OR Hutbar OR Hutcond OR ndbar OR stvol OR tcbar;

if( Status("action") == actionCommentary ) 
printf ( "=========================" +"\n"));
printf ( "VOLUME PRICE ANALYSIS" +"\n");
printf ( "" +"\n");
printf ( "=========================" +"\n");
printf ( Name() + " - " +Interval(2) +  "  - " + Date() +" - " +"\n"+"High-"+H+"\n"+"Low-"+L+"\n"+"Open-"+O+"\n"+
"Close-"+C+"\n"+ "Volume= "+ WriteVal(V)+"\n");



WriteIf(utbar , "Up-thrusts are designed to catch stops and to mislead as many traders as possible.  
They are normally seen after there has been weakness in the background. The market makers know that the
market is weak, so the price is marked up to catch stops, encourage traders to go long in a weak market,
AND panic traders that are already Short into covering their very good position.","")+

WriteIf(utcond3,"This upthrust bar is at high volume.This is a sure sign of weakness. One may even seriously 
consider ending the Longs AND be ready to reverse","")+WriteIf(utbar OR utcond3," Also note that A wide spread 
down-bar that appears immediately after any up-thrust, tends to confirm the weakness (the market makers are 
locking in traders into poor positions).
With the appearance of an upthrust you should 
certainly be paying attention to your trade AND your stops. On many upthrusts you will find that the market will 
'test' almost immediately.","")+WriteIf(utcond1 , "A wide spread down bar following a Upthrust Bar.
This confirms weakness. The Smart Money is locking in Traders into poor positions","");

WriteIf(utcond2 , "Also here the volume is high( Above Average).This is a sure sign of weakness. The Smart Money is 
locking in Traders into poor positions","")+WriteIf(stdn, "Strength Bar. The stock has been in a down Trend. An upbar 
with higher Volume closing near the High is a sign of strength returning. The downtrend is likely to reverse soon. ","")+

WriteIf(stdn1,"Here the volume is very much above average. This makes this indication more stronger. ","")+ 

WriteIf(bycond,"The previous bar saw strength coming back. This upbar confirms strength. ","")+

WriteIf(Hutbar," A pseudo Upthrust. This normally appears after an Up Bar with above average volume. This looks like an upthrust bar
closing down near the Low. But the Volume is normally Lower than average. this is a sign of weakness.If the Volume is High then weakness 
increases. Smart Money is trying to trap the retailers into bad position. ","")+

WriteIf(Hutcond, "A downbar after a pseudo Upthrust Confirms weakness. If the volume is above average the weakness is increased. ","")+

WriteIf(Lvtbar2,"The previous bar was a successful Test of supply. The current bar is a upbar with higher volume. This confirms strength","")+

WriteIf(dbar,"A wide range, high volume bar in a up trend closing down is an indication the Distribution is in progress. The smart money
is Selling the stock to the late Comers rushing to Buy the stock NOT to be Left Out Of a Bullish move. ","")+

WriteIf(Lvtbar2,"The previous bar was a successful Test of supply. The current bar is a upbar with higher volume. This confirms strength","")+

WriteIf(tcbar,"The stock has been moving up on high volume. The current bar is a Downbar with high volume. Indicates weakness and probably end of the up move","")+

WriteIf(eftup,"Effort to Rise bar. This normally found in the beginning of a Markup Phase and is bullish sign.These may be found at the top of an Upmove as the Smart money makes a 
last effort to move the price to the maximum","")+

WriteIf(eftdn,"Effort to Fall bar. This normally found in the beginning of a Markdown phase.","")+

WriteIf(nsbar,"No Supply. A no supply bar indicates supply has been removed and the Smart money can markup the price. It is better to wait for confirmation","")+

WriteIf(stvol,"Stopping Volume. This will be an downbar during a bearish period closing towards the Top accompanied by High volume.
A stopping Volume normally indicates that smart money is absorbing the supply which is a Indication that they are Bullishon the MArket.
Hence we Can expect a reversal in the down trend. ","")+

WriteIf(ndbar, "No Demand
Brief Description:
Any up bar which closes in the middle OR Low, especially if the Volume has fallen off, 
is a potential sign of weakness.

Things to Look Out for:
if the market is still strong, you will normally see signs of strength in the next few bars, 
which will most probably show itself as a:
* Down bar with a narrow spread, closing in the middle OR High. 
* Down bar on Low Volume.","");
Filter= utbar OR utcond2 OR utcond3 OR stdn OR stdn0 OR stdn1 OR stdn2;
AddColumn(utcond3,"Weekness Coming in",1,colorWhite,IIf(utcond3,colorRed,colorWhite));
AddColumn(utcond2,"Sure Weakness",1,colorWhite,IIf(utcond2,colorRed,colorWhite));
AddColumn(utbar,"Sure Weakness",1,colorWhite,IIf(utbar,colorRed,colorWhite));
AddColumn(stdn ,"Strength after long Downtrend",1,colorWhite,IIf(stdn,colorLime,colorWhite));
AddColumn(stdn0 ,"Strength after Downtrend",1,colorWhite,IIf(stdn0,colorLime,colorWhite));
AddColumn(stdn1 ,"Stronger Strength",1,colorWhite,IIf(stdn1,colorLime,colorWhite));
AddColumn(stdn2 ,"Strength",1,colorWhite,IIf(stdn2,colorLime,colorWhite));
LastBar = Cum( 1 ) == LastValue( Cum( 1 ) );  
Filter = LastBar; 
AddColumn (PublicTrade,"n days Trade % of Public Shares");
AddColumn (FloatTrade,"n days Trade % of Floating Shares");
AddColumn (TotalTrade,"n days Trade % of Total Shares");


1. hoierman

Thanks for your excellent contribution. I head up the Amibroker VSA Yahoo Group … web address:
I’ve taken the liberty to POST the formula in our “files” section. You ae most welcome to join the group as your contributions would be most appropriate. I ran the program and tried to add columns for Close,Volume etc. but they didn’t seem to work. Your interest and response will be most appreciated

Dick Hoierman

Leave Comment

Please login here to leave a comment.