Volume ROC and 2nd Derivative by ianhThe purpose of this code is to graph a volume simple moving average (sma) and it's first and second derivatives to provide traders with additional information that might determine if volume is converging or diverging with price. The yellow line represents the volume sma, the red line represents the first derivative or the rate of change of the volume and the green line represents the second derivative or acceleration of volume. For long term trading, if the yellow line is "trending" upwards with higher highs and higher lows it means that volume is supporting the over all long term price trend. If the volume is decreasing over the long term then it is not supporting the current price trend. The first and second derivatives may help short term weekly traders confirm price movements. There are several different conditions to look for:
First (Red) ++ Second (Green) --, Trading volume at the current price has "peaked" and the price may reverse soon.
First (Red) -- Second (Green) ++, Trading volume at the current price has "troughed" and the price may reverse soon.
First (Red) + Second (Green) +, Trading volume is not only increasing but it's accelerating which might confirm a large price movement.
First (Red) - Second (Green) -, Trading volume is not only decreasing but it's decelerating which might indicate little to no price movement.
Derivative_analysis
Momentum and AccelerationThe following oscillator is a twist on momentum, incorporating a 2nd derivative "acceleration" to help determine changes in momentum. Both are plotted directly accessing previous series values rather than using a moving average.
The script has an option to divide so the formula is d(Price)/d(Time), like a derivative. The script also provides options for the user to use their price source, volume, or a combination of price and volume.
Credit: This script utilizes the "color gradient framework" tutorial by LucF (PineCoders) to create user-adjustable gradient visuals.
Definitions
"1st Derivative - Momentum" - Momentum is most commonly referred to as a rate and measures the acceleration of the price and/or volume of a security.
"2nd Derivative - Acceleration" - Acceleration is the rate of change of momentum.
Value Added
This script may help the trader to assess directional changes in momentum easier.
This script also plots using previous series values rather than using a moving average function. To my knowledge, I was unable to find one that does this for "2nd derivative", so it had to be created.
Ehlers Simple Deriv Indicator [CC]The Simple Deriv Indicator was created by John Ehlers (Stocks and Commodities June 2021 pg 10) and this is a heavily modified version of his original script that changes the buy and sell signals. I did testing with his original settings but they didn't seem to be very profitable for most stocks so I created my own system. This indicator does have a lag though so it is best used for trend confirmation imo. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you would like to see me publish!