Simple script modification that helps me to confirm when a trend is broken. All it does is paint candles dark red or dark green if volume is 3x average. If you see anything wrong with the code please point it out thank you.
https://ibb.co/p2dmnFL - for an example on TSLA, I made good money trading puts off that broken trend.
https://ibb.co/p2dmnFL - for an example on TSLA, I made good money trading puts off that broken trend.
Code:
#
# TD Ameritrade IP Company, Inc. (c) 2007-2021
# Modified VolumeAvg to paint candlesticks that are 3x the average volume.
# Make sure you put this in the Volume section of studies
declare lower;
declare zerobase;
input length = 50;
def AvgVol = Average(volume * 3);
plot Vol = volume;
plot VolAvg = Average(volume, length);
Vol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Vol.SetLineWeight(3);
Vol.DefineColor("Up", Color.UPTICK);
Vol.DefineColor("Down", Color.DOWNTICK);
Vol.AssignValueColor(if close > close[1] then Vol.color("Up") else if close < close[1] then Vol.color("Down") else GetColor(1));
VolAvg.SetDefaultColor(GetColor(8));
AssignPriceColor(if close > close[1] AND volume > AvgVol then color.DARK_GREEN else color.current);
AssignPriceColor(if close < close[1] AND volume > AvgVol then color.DARK_RED else color.current);
Last edited by a moderator: