ZackeryE21
New member
Hey! I was looking for a volume indicator that compares Today's Volume at Specified Time to the X Day Average Volume at Specified Time.
Basically comparing 9:30-10:30 Today's Volume Bar to the X Day Average of the 9:30-10:30 Volume Bar.
I'm looking for the indicator in this video:
Thanks much
[EDIT]
I found an indicator that does what I was looking for. It doesn't work on a 1 Minute Time-Frame though, which is fine for me:
https://usethinkscript.com/threads/time-based-volume-indicator-for-thinkorswim.124/
Here is the edited code to make it match the video:
As of now when this indicator is used on the Daily Time-Frame it looks back X Bars to create an Average. How can I make a new indicator that matches This Day This Year to This Day Last Year for X Years back instead? And ideally this will work with Weeks and Months as well.
Thanks!
Basically comparing 9:30-10:30 Today's Volume Bar to the X Day Average of the 9:30-10:30 Volume Bar.
I'm looking for the indicator in this video:
Thanks much
[EDIT]
I found an indicator that does what I was looking for. It doesn't work on a 1 Minute Time-Frame though, which is fine for me:
https://usethinkscript.com/threads/time-based-volume-indicator-for-thinkorswim.124/
Here is the edited code to make it match the video:
Ruby:
declare lower;
input LookBack = 20;
def nMinutes = GetAggregationPeriod() / 60000;
def nBars = RoundUp(390 / nMinutes, 0);
def pvSum = fold idx = 1 to LookBack + 1 with a=0 do a + GetValue(volume, idx * nBars, LookBack * nBars);
def pvAvg = pvSum / LookBack;
def VolPct = (volume / pvAvg) * 100;
plot VeryHighVolume = 120;
VeryHighVolume.SetDefaultColor(CreateColor(0, 255, 0));
VeryHighVolume.SetStyle(Curve.LONG_DASH);
plot HighVolume = 110;
HighVolume.SetDefaultColor(CreateColor(0, 102, 0));
HighVolume.SetStyle(Curve.LONG_DASH);
plot VeryLowVolume = 80;
VeryLowVolume.SetDefaultColor(CreateColor(255, 0, 0));
VeryLowVolume.SetStyle(Curve.LONG_DASH);
plot LowVolume = 90;
LowVolume.SetDefaultColor(CreateColor(102, 0, 0));
LowVolume.SetStyle(Curve.LONG_DASH);
plot RelativeVolume = VolPct;
RelativeVolume.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
RelativeVolume.DefineColor("Strong Bullish", CreateColor(0, 255, 0));
RelativeVolume.DefineColor("Bullish", CreateColor(0, 102, 0));
RelativeVolume.DefineColor("Strong Bearish", CreateColor(255, 0, 0));
RelativeVolume.DefineColor("Bearish", CreateColor(102, 0, 0));
RelativeVolume.DefineColor("Neutral", CreateColor(255, 255, 0));
RelativeVolume.AssignValueColor(
if (VolPct > VeryHighVolume) then RelativeVolume.Color("strong bullish" )
else if VeryHighVolume >= VolPct and VolPct >= HighVolume then RelativeVolume.Color("bullish" )
else if VolPct < VeryLowVolume then RelativeVolume.Color("strong bearish" )
else if VeryLowVolume <= VolPct and VolPct <= LowVolume then RelativeVolume.Color("bearish" )
else RelativeVolume.Color("neutral"));
RelativeVolume.SetLineWeight(3);
As of now when this indicator is used on the Daily Time-Frame it looks back X Bars to create an Average. How can I make a new indicator that matches This Day This Year to This Day Last Year for X Years back instead? And ideally this will work with Weeks and Months as well.
Thanks!
Last edited: