A Better Better Volume with VSA
This chart setup is designed to analyze volume, range spread, relative volume, average volumes and closing price to determine price direction
This is a study based on Better Volume
https://usethinkscript.com/threads/better-volume-indicator-for-thinkorswim.108/
with a few enhancements.
https://tos.mx/!9DaocvUe
Shared Chart, Incudes Upper and lower studies along with a bongo ema 9.
Premise here is:
Red Candle - Look to Sell; Lines Drawn at High, Low, and YTC lower third.
White candle - Look to Buy; Lines Drawn at High Low and YTC upper third.
Added Hot percent, cyan triangle. ( hiVolume indicator source: : allen everhart http://tinboot.blogspot.com)
Added Relative Volume, yellow triangle, green triangle if Vol > 50 bar average. (Advanced Volume Study for Volume Spread Analysis [email protected])
Basic Rules: Best used with at least one ma of your choice.
_ Typically, ill use an 8/20 sma and some s/r lines. Lower some OB/OS study.
Red: Look to sell ( or reason to stay). General PA/ Pivot rules apply. Like to stay above lower YTC line.
# Anomalies. there are times the red or white lines are drawn on other candles (i.e. low volume), I left them in place since they exhibit characteristics of a climax up / climax down and were appropriate.
( I have not fully analyzed the Better Volume conditions/ method to the madness)
- Danger Zone/ Use Caution. RED Low is below the White High.
- Two Bars, I generally use the 2 bar setting on the upper chart and use the single bar settings on the lower chart for an additional perspective / confusion.
my 2cents:
VSA (Another tool in the tool box): There is a large debate regarding its validity, true that the big boys have their dark pools hidden from view but my belief is there still are Market Makers controlling what us retail investors see. Some imply they can even manipulate the candle patterns we see. Adding volume to the equation gives me an added perspective.
“Its an Art not a Science” which inherently makes it difficult to program. Some programs have several indicators and a complex set of rules/ patterns to look for. Better Volume has been out for a while but does a good job of simplifying the process.
My approach to VSA, Smart Money encourages traders to buy while their selling and encourage traders to sell while their buying.
As a test, I threw together a quick strategy to buy crossing white, sell crossing red and no trade if red candle within white. Not perfect but profitable for the most part… Enough to pursue things further.
For reference I looked at Nijan VSA, Candlestick Fantasia (built around ninja VSA), Welkin VSA, and horserider’s collection of volume studies.
For blow by blow analysis the ninja VSA complements this well. I incorporated the Relative volume Welkin has in his VSA, and added the hot percent indicator found in Horserider’s volume studies.
Code for Upper Study:
(FYI, code for lower study is in the next post below)
This chart setup is designed to analyze volume, range spread, relative volume, average volumes and closing price to determine price direction
This is a study based on Better Volume
https://usethinkscript.com/threads/better-volume-indicator-for-thinkorswim.108/
with a few enhancements.
https://tos.mx/!9DaocvUe
Shared Chart, Incudes Upper and lower studies along with a bongo ema 9.
Premise here is:
Red Candle - Look to Sell; Lines Drawn at High, Low, and YTC lower third.
White candle - Look to Buy; Lines Drawn at High Low and YTC upper third.
Added Hot percent, cyan triangle. ( hiVolume indicator source: : allen everhart http://tinboot.blogspot.com)
Added Relative Volume, yellow triangle, green triangle if Vol > 50 bar average. (Advanced Volume Study for Volume Spread Analysis [email protected])
Basic Rules: Best used with at least one ma of your choice.
_ Typically, ill use an 8/20 sma and some s/r lines. Lower some OB/OS study.
Red: Look to sell ( or reason to stay). General PA/ Pivot rules apply. Like to stay above lower YTC line.
- Rarely Buy on Red candle, if I do, ready to sell next bar.
- Relative volume as a heads up (fishing bobber). Start of selling, buying, or trend continuation. Yellow a nibble, green a hit.
# Anomalies. there are times the red or white lines are drawn on other candles (i.e. low volume), I left them in place since they exhibit characteristics of a climax up / climax down and were appropriate.
( I have not fully analyzed the Better Volume conditions/ method to the madness)
- Danger Zone/ Use Caution. RED Low is below the White High.
- Two Bars, I generally use the 2 bar setting on the upper chart and use the single bar settings on the lower chart for an additional perspective / confusion.
my 2cents:
VSA (Another tool in the tool box): There is a large debate regarding its validity, true that the big boys have their dark pools hidden from view but my belief is there still are Market Makers controlling what us retail investors see. Some imply they can even manipulate the candle patterns we see. Adding volume to the equation gives me an added perspective.
“Its an Art not a Science” which inherently makes it difficult to program. Some programs have several indicators and a complex set of rules/ patterns to look for. Better Volume has been out for a while but does a good job of simplifying the process.
My approach to VSA, Smart Money encourages traders to buy while their selling and encourage traders to sell while their buying.
As a test, I threw together a quick strategy to buy crossing white, sell crossing red and no trade if red candle within white. Not perfect but profitable for the most part… Enough to pursue things further.
For reference I looked at Nijan VSA, Candlestick Fantasia (built around ninja VSA), Welkin VSA, and horserider’s collection of volume studies.
For blow by blow analysis the ninja VSA complements this well. I incorporated the Relative volume Welkin has in his VSA, and added the hot percent indicator found in Horserider’s volume studies.
Code for Upper Study:
(FYI, code for lower study is in the next post below)
Ruby:
#
#Better Better Volume VSA Upper
#
##Mod atcsam 8/7/24 A Better - Better Volume
# Organized assignBackgroundColor price color
# add Switch to paint candles
# add H/L YTC lines for Climax Up/ Down
# add hot percent
# relative volume
#Real Credit: thinkscipt community
#hint: Verbatim translation of the TradeStation code from http://emini-watch.com/free-stuff/volume-indicator/
# YTC Lance Beggs Converted from https://www.tradingview.com/script/5fSgjYoM-YTC-Candlestick-Sentiment/
# hiVolume indicator
# source: http://tinboot.blogspot.com
# author: allen everhart
#Advanced Volume Study for Volume Spread Analysis [email protected]
#==========================================================================
#DECLARATIONS
#==========================================================================
declare upper;
#INPUTS
#==========================================================================
input ShowColorOnPrice = Yes;
input ShowLines = yes;
input CurrentOnly = Yes;
input iShowLowVol = YES;
input iShowClimaxUp = YES;
input iShowClimaxDown = YES;
input iShowChurn = YES;
input iShowClimaxChurn = YES;
input iUseTwoBars = {default "YES", "NO"};
input iLookback = 20;
#Plot VariableMA avg
input Vavg1 = 10;
input Vavg2 = 50;
#VARS
def bn = BarNumber();
#==========================================================================
def vValue1;
def vValue2;
def vValue3;
def vValue4;
def vValue5;
def vValue6;
def vValue7;
def vValue8;
def vValue9;
def vValue10;
def vValue11;
def vValue12;
def vValue13;
def vValue14;
def vValue15;
def vValue16;
def vValue17;
def vValue18;
def vValue19;
def vValue20;
def vValue21;
def vValue22;
def vCondition1;
def vCondition2;
def vCondition3;
def vCondition4;
def vCondition5;
def vCondition6;
def vCondition7;
def vCondition8;
def vCondition9;
def vCondition10;
def vCondition11;
def vCondition12;
def vCondition13;
def vCondition14;
def vCondition15;
def vCondition16;
def vCondition17;
def vCondition18;
def vCondition19;
def vCondition20;
def vRange;
def NA = Double.NaN;
#LOGIC
#==========================================================================
vRange = high - low;
if close > open and vRange <> 0
then {
vValue1 = (vRange / (2 * vRange + open - close)) * volume;
vValue2 = volume - vValue1;
}
else if close < open and vRange <> 0
then {
vValue1 = ((vRange + close - open) / (2 * vRange + close - open)) * volume;
vValue2 = volume - vValue1;
}
else if close == open
then {
vValue1 = 0.5 * volume;
vValue2 = volume - vValue1;
}
else {
vValue1 = 0;
vValue2 = 0;
}
vValue3 = AbsValue(vValue1 + vValue2);
vValue4 = vValue1 * vRange;
vValue5 = (vValue1 - vValue2) * vRange;
vValue6 = vValue2 * vRange;
vValue7 = (vValue2 - vValue1) * vRange;
if vRange <> 0
then {
vValue8 = vValue1 / vRange;
vValue9 = (vValue1 - vValue2) / vRange;
vValue10 = vValue2 / vRange;
vValue11 = (vValue2 - vValue1) / vRange;
vValue12 = vValue3 / vRange;
}
else {
vValue8 = 0;
vValue9 = 0;
vValue10 = 0;
vValue11 = 0;
vValue12 = 0;
}
switch (iUseTwoBars)
{
case "YES":
vValue13 = vValue3 + vValue3[1];
vValue14 = (vValue1 + vValue1[1]) * (Highest(high, 2) - Lowest(low, 2));
vValue15 = (vValue1 + vValue1[1] - vValue2 - vValue2[1]) * (Highest(high, 2) - Lowest(low, 2));
vValue16 = (vValue2 + vValue2[1]) * (Highest(high, 2) - Lowest(low, 2));
vValue17 = (vValue2 + vValue2[1] - vValue1 - vValue1[1]) * (Highest(high, 2) - Lowest(low, 2));
if Highest(high, 2) <> Lowest(low, 2)
then {
vValue18 = (vValue1 + vValue1[1]) / (Highest(high, 2) - Lowest(low, 2));
vValue19 = (vValue1 + vValue1[1] - vValue2 - vValue2[1]) / (Highest(high, 2) - Lowest(low, 2));
vValue20 = (vValue2 + vValue2[1]) / (Highest(high, 2) - Lowest(low, 2));
vValue21 = (vValue2 + vValue2[1] - vValue1 - vValue1[1]) / (Highest(high, 2) - Lowest(low, 2));
vValue22 = vValue13 / (Highest(high, 2) - Lowest(low, 2));
}
else {
vValue18 = 0;
vValue19 = 0;
vValue20 = 0;
vValue21 = 0;
vValue22 = 0;
}
vCondition1 = 0;
vCondition2 = 0;
vCondition3 = 0;
vCondition4 = 0;
vCondition5 = 0;
vCondition6 = 0;
vCondition7 = 0;
vCondition8 = 0;
vCondition9 = 0;
vCondition10 = 0;
vCondition11 = vValue13 == Lowest(vValue13, iLookback);
vCondition12 = vValue14 == Highest(vValue14, iLookback) and close > open and close[1] > open[1];
vCondition13 = vValue15 == Highest(vValue15, iLookback) and close > open and close[1] > open[1];
vCondition14 = vValue16 == Highest(vValue16, iLookback) and close < open and close[1] < open[1];
vCondition15 = vValue17 == Highest(vValue17, iLookback) and close < open and close[1] < open[1];
vCondition16 = vValue18 == Lowest(vValue18, iLookback) and close < open and close[1] < open[1];
vCondition17 = vValue19 == Lowest(vValue19, iLookback) and close < open and close[1] < open[1];
vCondition18 = vValue20 == Lowest(vValue20, iLookback) and close > open and close[1] > open[1];
vCondition19 = vValue21 == Lowest(vValue21, iLookback) and close > open and close[1] > open[1];
vCondition20 = vValue22 == Highest(vValue22, iLookback);
case "NO":
vValue13 = 0;
vValue14 = 0;
vValue15 = 0;
vValue16 = 0;
vValue17 = 0;
vValue18 = 0;
vValue19 = 0;
vValue20 = 0;
vValue21 = 0;
vValue22 = 0;
vCondition1 = vValue3 == Lowest(vValue3, iLookback);
vCondition2 = vValue4 == Highest(vValue4, iLookback) and close > open;
vCondition3 = vValue5 == Highest(vValue5, iLookback) and close > open;
vCondition4 = vValue6 == Highest(vValue6, iLookback) and close < open;
vCondition5 = vValue7 == Highest(vValue7, iLookback) and close < open;
vCondition6 = vValue8 == Lowest(vValue8, iLookback) and close < open;
vCondition7 = vValue9 == Lowest(vValue9, iLookback) and close < open;
vCondition8 = vValue10 == Lowest(vValue10, iLookback) and close > open;
vCondition9 = vValue11 == Lowest(vValue11, iLookback) and close > open;
vCondition10 = vValue12 == Highest(vValue12, iLookback);
vCondition11 = 0;
vCondition12 = 0;
vCondition13 = 0;
vCondition14 = 0;
vCondition15 = 0;
vCondition16 = 0;
vCondition17 = 0;
vCondition18 = 0;
vCondition19 = 0;
vCondition20 = 0;
}
#PLOTS
#==========================================================================
plot pBetterVolume = NA;
#PLOT STYLES & SETTINGS
#==========================================================================
pBetterVolume.DefineColor("LowVol", CreateColor(243, 197, 0));
pBetterVolume.DefineColor("ClimaxUp", Color.RED);
pBetterVolume.DefineColor("ClimaxDown", Createcolor(212,212,212));
pBetterVolume.DefineColor("Churn", Createcolor(0,128,255));
pBetterVolume.DefineColor("ClimaxChurn", Color.MAGENTA);
pBetterVolume.DefineColor("Default", Color.GRAY);
#LV
def LowVol = vCondition1 or vCondition11;
#ClimaxUp
def ClimaxUp = vCondition2 or vCondition3 or vCondition8 or vCondition9 or vCondition12 or vCondition13 or vCondition18 or vCondition19;
#ClimaxDN
def ClimaxDn = vCondition4 or vCondition5 or vCondition6 or vCondition7 or vCondition14 or vCondition15 or vCondition16 or vCondition17;
# DEf Churn
def Churn = vCondition10 or vCondition20;
def ClimaxChurn = (vCondition10 or vCondition20)
and (vCondition2 or vCondition3 or vCondition4 or vCondition5 or vCondition6
or vCondition7 or vCondition8 or vCondition9 or vCondition12
or vCondition13 or vCondition14 or vCondition15 or vCondition16
or vCondition17 or vCondition18 or vCondition19);
AssignPriceColor
( if iShowLowVol && ShowColorOnPrice and LowVol then pBetterVolume.Color("LowVol")
else if iShowClimaxChurn && ShowColorOnPrice and ClimaxChurn then pBetterVolume.Color("ClimaxChurn")
else if iShowChurn && ShowColorOnPrice and Churn then pBetterVolume.Color("Churn")
else if iShowClimaxUp && ShowColorOnPrice and ClimaxUp
then pBetterVolume.Color("ClimaxUp")
else if iShowClimaxDown && ShowColorOnPrice and !ClimaxChurn and ClimaxDn then pBetterVolume.Color("ClimaxDown")
else if iShowClimaxChurn && ShowColorOnPrice and ClimaxChurn then pBetterVolume.Color("ClimaxChurn")
else if ShowColorOnPrice then pBetterVolume.Color("Default") else Color.CURRENT
);
# add Lines
def cdbn = if ClimaxDn then bn else cdbn[1];
def WhiteH = if ClimaxDn && ShowLines then high else WhiteH[1];
plot WhiteHL = if bn >= HighestAll(cdbn) && ShowLines && CurrentOnly then WhiteH else if ShowLines && !CurrentOnly then WhiteH else NA;
WhiteHL.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
WhiteHL.SetDefaultColor(Color.WHITE);
def WhiteYTC = if ClimaxDn then (high - (high - low) / 3) else WhiteYTC[1];
plot WhiteYTCL = if bn >= HighestAll(cdbn) && ShowLines && CurrentOnly then WhiteYTC else if ShowLines && !CurrentOnly then WhiteYTC else NA;
WhiteYTCL.SetPaintingStrategy(PaintingStrategy.DASHES);
WhiteYTCL.SetDefaultColor(Color.WHITE);
def WhiteL = if ClimaxDn then low else WhiteL[1];
plot WhiteLL = if bn >= HighestAll(cdbn) && ShowLines && CurrentOnly then WhiteL else NA;
WhiteLL.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
WhiteLL.SetDefaultColor(Color.MAGENTA);
def rlbn = if ClimaxUp then bn else NA;
def RedYTC = if ClimaxUp && ShowLines then ((high - low) / 3 + low) else RedYTC[1];
plot RedYTCL = if bn >= HighestAll(rlbn) && ShowLines && CurrentOnly then RedYTC else if ShowLines && !CurrentOnly then RedYTC else NA;
RedYTCL.SetPaintingStrategy(PaintingStrategy.DASHES);
RedYTCL.SetDefaultColor(Color.LIGHT_RED);
# Plot RedH Low
def RedYTCLow = if ClimaxUp then low else RedYTCLow[1];
def RedH = if ClimaxUp and ShowLines then high else RedH[1];
##plot RedYTCLowL = RedYTCLow;
plot Redytclowl = if bn >= HighestAll(rlbn) && ShowLines && CurrentOnly then RedYTCLow else if ShowLines && !CurrentOnly then RedYTCLow else NA;
Redytclowl.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Redytclowl.SetDefaultColor(Color.RED);
#def inv = if
plot REDHL = if bn >= HighestAll(rlbn) && ShowLines && CurrentOnly then RedH else if ShowLines && !CurrentOnly && (RedYTCLow < WhiteH) then RedH else NA;
REDHL.SetPaintingStrategy(PaintingStrategy.DASHES);
REDHL.SetDefaultColor(Color.YELLOW);
# Hot Percent
# hiVolume indicator
# source: http://tinboot.blogspot.com
# author: allen everhart
input hotPct = 100.0 ;
input type = { default SMP, EXP } ;
input length1 = 20 ;
def ma =
if type == type.SMP then
SimpleMovingAvg(volume, length1)
else
MovAvgExponential(volume, length1);
plot hv =
if 100 * ((volume / ma) - 1) >= hotPct then
MidBodyVal()
else
Double.NaN;
hv.SetDefaultColor( Color.CYAN);
hv.SetLineWeight(2) ;
hv.SetPaintingStrategy( PaintingStrategy.TRIANGLES);
#Rel Vol
def RelVol = volume / ma[1];
def RelPrevVol = volume / volume[1];
def vag22 =Average(volume, 50);
#Triangle RelVol Signal
plot RV = if RelPrevVol >= 1.25 then MidBodyVal() else Double.NaN;
RV.AssignValueColor(if (Volume >= vag22) then Color.Green else Color.yellow);
RV.SetLineWeight(1) ;
RV.SetPaintingStrategy( PaintingStrategy.TRIANGLES);
Last edited by a moderator: