declare lower;
declare zerobase;
def voll = volume(GetSymbol(), (aggregationPeriod.FIVE_MIN)) ;
def min15 = volume(GetSymbol(),(aggregationPeriod.FIFTEEN_MIN)) ;
def min30 = volume(GetSymbol(),(aggregationPeriod.THIRTY_MIN)) ;
def min60 = volume(GetSymbol(),(aggregationPeriod.HOUR)) ;
input length = 10 ;
plot Vol = volume;
plot VolAvg = Average(volume, length) ;
Addlabel( yes, if volavg > voll then LENGTH + " PERIOD AVG VOL: " + Volavg else LENGTH + " PERIOD AVG VOL: " + volavg , if volavg < voll then color.red else color.green) ;
Addlabel( yes, if volavg > voll then "NO, 5 MIN VOL: " + voll else "YES, 5 MIN VOL: " + voll , if volavg > voll then color.red else color.green) ;
Addlabel( yes, if volavg*3 >min15 then "NO, 15 MIN VOL: " + min15 else "YES, 15 MIN VOL: " + min15 , if volavg*3 > min15 then color.red else color.green) ;
Addlabel( yes, if volavg*6 >min30 then "NO, 30 MIN VOL: " + min30 else "YES, 30 MIN VOL: " + min30 , if volavg*6 > min30 then color.red else color.green) ;
Addlabel( yes, if volavg*12 >min60 then "NO, 1 HOUR VOL: " + min60 else "YES, 1 HOUR VOL: " + min60 , if volavg*12 > min60 then color.red else color.green) ;
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));
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
This looks interesting. You mentioned it only worked on the 5m timeframe. what do I need to do to make it work on the 3m chart? or better still work on all timeframes?Hey Whizz. I **** at programming and coding but here is something I messed with for you. It only works on the 5 min timeframe currently. The dotted lines are the avg volume of the past periods you choose. The bars are the 5 min timeframe volume. There is a (period) avg volume, 5min, 15min, 30min, and 1 hour labels. If the dotted (period) avg volume is greater than the 5 min time period volumes the label will Turn Green and the 5 min label will say No, and show the current volume if the 5 min volume is higher than the (period) avg volume it will say YES and show the current volume. The 15 min, 30 min, and 1 hour labels will turn green if the volume on those time periods are relatively higher than the (period) avg volume and say YES + current volume. I’ll get it better in the coming days. So sleepy lol. Good luck trading. Feel free to reach out.
Rich (BB code):declare lower; declare zerobase; def voll = volume(GetSymbol(), (aggregationPeriod.FIVE_MIN)) ; def min15 = volume(GetSymbol(),(aggregationPeriod.FIFTEEN_MIN)) ; def min30 = volume(GetSymbol(),(aggregationPeriod.THIRTY_MIN)) ; def min60 = volume(GetSymbol(),(aggregationPeriod.HOUR)) ; input length = 10 ; plot Vol = volume; plot VolAvg = Average(volume, length) ; Addlabel( yes, if volavg > voll then LENGTH + " PERIOD AVG VOL: " + Volavg else LENGTH + " PERIOD AVG VOL: " + volavg , if volavg < voll then color.red else color.green) ; Addlabel( yes, if volavg > voll then "NO, 5 MIN VOL: " + voll else "YES, 5 MIN VOL: " + voll , if volavg > voll then color.red else color.green) ; Addlabel( yes, if volavg*3 >min15 then "NO, 15 MIN VOL: " + min15 else "YES, 15 MIN VOL: " + min15 , if volavg*3 > min15 then color.red else color.green) ; Addlabel( yes, if volavg*6 >min30 then "NO, 30 MIN VOL: " + min30 else "YES, 30 MIN VOL: " + min30 , if volavg*6 > min30 then color.red else color.green) ; Addlabel( yes, if volavg*12 >min60 then "NO, 1 HOUR VOL: " + min60 else "YES, 1 HOUR VOL: " + min60 , if volavg*12 > min60 then color.red else color.green) ; 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));
Hey thanks for taking the time to do this, any chance you got it to work on all TF?Hey Whizz. I **** at programming and coding but here is something I messed with for you. It only works on the 5 min timeframe currently. The dotted lines are the avg volume of the past periods you choose. The bars are the 5 min timeframe volume. There is a (period) avg volume, 5min, 15min, 30min, and 1 hour labels. If the dotted (period) avg volume is greater than the 5 min time period volumes the label will Turn Green and the 5 min label will say No, and show the current volume if the 5 min volume is higher than the (period) avg volume it will say YES and show the current volume. The 15 min, 30 min, and 1 hour labels will turn green if the volume on those time periods are relatively higher than the (period) avg volume and say YES + current volume. I’ll get it better in the coming days. So sleepy lol. Good luck trading. Feel free to reach out.
Rich (BB code):declare lower; declare zerobase; def voll = volume(GetSymbol(), (aggregationPeriod.FIVE_MIN)) ; def min15 = volume(GetSymbol(),(aggregationPeriod.FIFTEEN_MIN)) ; def min30 = volume(GetSymbol(),(aggregationPeriod.THIRTY_MIN)) ; def min60 = volume(GetSymbol(),(aggregationPeriod.HOUR)) ; input length = 10 ; plot Vol = volume; plot VolAvg = Average(volume, length) ; Addlabel( yes, if volavg > voll then LENGTH + " PERIOD AVG VOL: " + Volavg else LENGTH + " PERIOD AVG VOL: " + volavg , if volavg < voll then color.red else color.green) ; Addlabel( yes, if volavg > voll then "NO, 5 MIN VOL: " + voll else "YES, 5 MIN VOL: " + voll , if volavg > voll then color.red else color.green) ; Addlabel( yes, if volavg*3 >min15 then "NO, 15 MIN VOL: " + min15 else "YES, 15 MIN VOL: " + min15 , if volavg*3 > min15 then color.red else color.green) ; Addlabel( yes, if volavg*6 >min30 then "NO, 30 MIN VOL: " + min30 else "YES, 30 MIN VOL: " + min30 , if volavg*6 > min30 then color.red else color.green) ; Addlabel( yes, if volavg*12 >min60 then "NO, 1 HOUR VOL: " + min60 else "YES, 1 HOUR VOL: " + min60 , if volavg*12 > min60 then color.red else color.green) ; 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));
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
P | Add MTF to Average Volume Study | Questions | 0 | |
W | Premarket Volume Percentage of Daily Average | Questions | 0 | |
C | Moving Average Volume Breakouts | Questions | 5 | |
B | Above average volume watchlist label | Questions | 3 | |
T | 60-Day Average Volume | Questions | 2 |
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.