- RVOL (Relative )
- 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: divided by Moving Average value. You can change the moving average period (and type) in the settings.
Go to http://www.zenandtheartoftrading.com for articles on forex trading, trading psychology, trading resources, Pine Script lessons and more!
PS. If you liked this script then you might also like the code for this one, it's a similar idea for detecting RVOL but far more advanced: https://zenandtheartoftrading.com/indicators/rvol-by-time/
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.
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)
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.....!!!