I already modified the built-in relative volume indicator to be color-coded in a way that reflects buy vs sell relative volume intuitively:
The result looks like this on a 1min chart (example here is KOSS):
What I'm interested in, however, is to further modify the relative volume indicator to reflect what is happening with the transaction sizes in the tape.
For example, I was thinking of something like horizontal lines segmenting the volume bars, or maybe a region of the volume bar highlighted with a brighter or darker shade with the proportionally highlighted area reflecting the size of the trade(s). Some way in other words to reflect if the volume bar consists of a bunch of small sells or a massive block sale, and likewise for buys. Because currently, the only way I can be aware of huge buys or sells happening in one transaction is to keep my eyes on the tape. But of course it's very helpful for being able to interpret whether the stock is in accumulation or distribution, to be able to see if any individual sells or buys have sizes that are some standard deviation above normal.
Does anyone have ideas or suggestions for how this could be accomplished (i.e. reflecting large individual tape transactions in a lower study), and furthermore, how it could be combined with the relative volume indicator?
EDIT: Another thing that would be useful is if within the 1min volume bar, it was possible to represent both buy and sell transactions, because that would help to avoid being fooled by when the bar gets painted a misleading color. For example, there can be a 1 share buy at $1, a 10,000 share buy at $2, and then a 1 share sell at $0.99 before the candle closes, and then it makes it look like a massive dump happened in that 1min bar. I've noticed this happens sometimes before a stock gets pumped hard and it's often difficult to see through the deception unless also watching the tape at the same time.
Code:
# TD Ameritrade IP Company, Inc. (c) 2014-2021
#
declare lower;
declare zerobase;
input length = 60;
input numDev = 2.0;
input allowNegativeValues = yes;
def rawRelVol = (volume - Average(volume, length)) / StDev(volume, length);
plot RelVol = if allowNegativeValues then rawRelVol else Max(0, rawRelVol);
plot StDevLevel = numDev;
RelVol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
RelVol.SetLineWeight(3);
RelVol.DefineColor("UpCandleAbove", Color.Light_Green);
RelVol.DefineColor("DownCandleAbove", Color.Red);
RelVol.DefineColor("UpCandleBelow", Color.CYAN);
RelVol.DefineColor("DownCandleBelow", Color.DARK_ORANGE);
RelVol.DefineColor("DownCandleNegBelow", CreateColor(60,25,25));
RelVol.DefineColor("UpCandleNegBelow", CreateColor(25,60,25));
RelVol.AssignValueColor(if RelVol >= numDev and RelVol>0 and open<close then RelVol.Color("UpCandleAbove") else if RelVol < numDev and RelVol<0 and open>close then RelVol.Color("DownCandleNegBelow") else if RelVol < numDev and RelVol<0 and open<close then RelVol.Color("UpCandleNegBelow") else if RElVol>0 and open<close then RelVol.Color("UpCandleBelow") else if RelVol >= numDev and RelVol>0 and open>close then RelVol.Color("DownCandleAbove") else if RElVol>0 and open>close then RelVol.Color("DownCandleBelow") else Color.Gray);
StDevLevel.SetDefaultColor(GetColor(7));
StDevLevel.SetStyle(Curve.SHORT_DASH);
The result looks like this on a 1min chart (example here is KOSS):
What I'm interested in, however, is to further modify the relative volume indicator to reflect what is happening with the transaction sizes in the tape.
For example, I was thinking of something like horizontal lines segmenting the volume bars, or maybe a region of the volume bar highlighted with a brighter or darker shade with the proportionally highlighted area reflecting the size of the trade(s). Some way in other words to reflect if the volume bar consists of a bunch of small sells or a massive block sale, and likewise for buys. Because currently, the only way I can be aware of huge buys or sells happening in one transaction is to keep my eyes on the tape. But of course it's very helpful for being able to interpret whether the stock is in accumulation or distribution, to be able to see if any individual sells or buys have sizes that are some standard deviation above normal.
Does anyone have ideas or suggestions for how this could be accomplished (i.e. reflecting large individual tape transactions in a lower study), and furthermore, how it could be combined with the relative volume indicator?
EDIT: Another thing that would be useful is if within the 1min volume bar, it was possible to represent both buy and sell transactions, because that would help to avoid being fooled by when the bar gets painted a misleading color. For example, there can be a 1 share buy at $1, a 10,000 share buy at $2, and then a 1 share sell at $0.99 before the candle closes, and then it makes it look like a massive dump happened in that 1min bar. I've noticed this happens sometimes before a stock gets pumped hard and it's often difficult to see through the deception unless also watching the tape at the same time.
Last edited: