ZenAndTheArtOfTrading

Volume+ (RVOL/Alerts)

This indicator colors the volume bars based on any of the three follow criteria:

- Volume Amount
- RVOL (Relative Volume )
- Lookback (Highest Over Period)

You can use one, two or all three of these settings at the same time.

You can also set alerts with this indicator. The script will trigger an alert whenever any of the three specified flags are triggered.

RVOL is calculated as: Volume divided by Moving Average value. You can change the moving average period (and type) in the settings.
Release Notes: Added option to draw Volume Amount and Lookback Thresholds
Release Notes: Minor improvements
Remove from Favorite Scripts Add to Favorite Scripts
Follow @TradeWisdom on Twitter for Daily inspiration from the best trading wizards, psychologists and philosophers.

Go to http://www.zenandtheartoftrading.com for articles on forex trading, trading psychology, trading resources, PineScript lessons and more!
Hello, thank you very much for the script, It have been helpful in what I was looking for, but your code is hard for me to understand, because I have a very basic level of Pine Script...

Could you help me with a quick question...?

How could I create a signal if the amount of the volume exceeds 500 contracts and it generate a mark as a cross on my graphic...

Thanks in advance for your guidance.
+1 Reply
@jmcc76, Hi! Thanks for checking out my script :)

To draw a cross when the volume alert is triggered, add this line to the end of the script:

plotshape(alert, style=shape.xcross, color=black)

And to make the script detect 500 Contracts worth of volume, open the script's settings menu and change the Volume To Trigger Signal value to '500'.

If you want to make your own companion script that draws the cross onto the actual candlestick chart, you'll need to create your own script and change the script's overlay setting to true. Hope that helps, let me know if you have any questions :)

For example, this code will do exactly what you want:

study(title = "Volume+", overlay=true)
alertVol = input(title="Volume to Trigger Signal", type=integer, defval=500)
plotshape(volume > alertVol, style=shape.xcross, color=black)
Reply
jmcc76 ZenAndTheArtOfTrading
@ZenAndTheArtOfTrading,

I can't thank you enough for your answer ...
I am only a beginner with Pine but people like you, make possible to continue developing and improving in trading.
You have given me another way to write the code even better and simpler than I had thought.
You have honored your name ... ZEN (simple) and ART
Really Thank you.....!!!
+1 Reply
@jmcc76, Thanks for the kind words man! I'm glad to be of service. Good luck with your trading and coding. Let me know if you have any other questions :)
Reply
Click here for a version of this RVOL Script that calculates relative volume based on time of a moving average:

Reply
hi there, quick question, does the rvol portion of this indicator work on a time of day average? Im looking for a simple rvol indicator that calculates based on specified average for time of day. Eg average volume for last x periods on 5 min chart at 9:35am is 100'000, today at 9:35 volume is at 200'000, so rvol is 2x. Hope you cane help!
+2 Reply
tb12345 tb12345
@tb12345, also thank you for putting this togetjer!
+1 Reply
@tb12345, You're welcome, thanks for the comment & I'm glad you like it!

The purple line RVOL for this indicator is calculated using a moving average for the past X periods, and then multiplying that value by whatever RVOL threshold you set.

So if you set the Moving Average period to 288 on the 5-minute chart, and then set the 'RVOL to Trigger Signal' threshold to 2, then it would compare the current volume candle to the moving average of the past 288 candle's worth (1440 minutes/24hrs) of price action. And if the current candle's volume is twice as large as the average volume for the past 288 candles of price action, it would trigger an alert/color the bar.

Is that what you were hoping for?
Reply
tb12345 ZenAndTheArtOfTrading
@ZenAndTheArtOfTrading, Hi there, thanks for getting back to me! That makes sense, but unfortunately not what i was looking for. What i was trying to acheive was rather than the look back period for the MA to be 288 candles worth on the 5 min, which would really give me the average of the last days worth of 5 min candles, im looking for the RVOL MA parameter to be say 20 days worth of the 5 min chart afor that particular bar say the 9:30-9:35 bar. E.g. lets say todays volume between 9:30 and 9:35 is X. Im looking for the RVOL to not just look back at the immediate preceding 5 mins candles specified in the MA parameter and compare it to that average volume, Im hoping to get it to look back at the 9:30-9:35 bar from the day before, and the day before that and the day before that and so on, so the volume comparison becomes time relevant. This helps get a better read on spikes in volume at the open and close relative to how those same opening and closing bars performed in the last X (MA) days. I think i did a terrible job of explaining but hope that makes sense! Thank you again for putting this out there for the community. A good example is here in case you can help:
https://sites.google.com/a/trade29.com/t29docs/sierra-chart-studies/average-volume-at-time-of-day
+2 Reply
@tb12345, Ahhh I see what you mean now, that's a great idea! I am not sure if it's possible to code an indicator like that in PineScript but I will give it a go. I would also love to have an indicator like that.

Thanks for the suggestion, I'll let you know if I have any luck creating it.
Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing House Rules Moderators Website & Broker Solutions Widgets Charting Solutions Get Help Feature Request Blog & News FAQ Wiki Twitter
Profile Profile Settings Account and Billing Get Help Ideas Published Followers Following Private Messages Chat Sign Out