TradingView
tbiktag
6 de Jan de 2021 18:00

Smooth First Derivative Indicator 

BitcoinOANDA

Descrição

Introducing the Smooth First Derivative indicator. For each time step, the script numerically differentiates the price data using prior datapoints from the look-back window. The resulting time derivative (the rate of price change over time) is presented as a centered oscillator.
A first derivative is a versatile tool used in functional data analysis. When applied to price data, it can be applied to analyze momentum, confirm trend direction, and identify pivot points.

Model Description:
The model assumes that, within the look-back window, price data can be well approximated by a smooth differentiable function. The first derivative can then be computed numerically using a noise-robust one-sided differentiator. The current version of the script employs smooth differentiators developed by P. Holoborodko (holoborodko.com/pavel/numerical-methods/numerical-derivative/smooth-low-noise-differentiators/). Note that the Indicator should not be confused with Constance Brown's Derivative Oscillator.

Input parameter:
The Bandwidth parameter sets the number of points in the moving look-back window and thus determines the smoothness of the first derivative curve. Note that a smoother Indicator shows a greater lag.

Interpretation:
When using this Indicator, one should recall that the first derivative can simply be interpreted as the slope of the curve:
- The maximum (minimum) in the Indicator corresponds to the point at which the market experiences the maximum upward (downward) slope, i.e., the inflection point. The steeper the slope, the greater the Indicator value.
- The positive-to-negative zero-crossing in the Indicator suggests that the market has formed a local maximum (potential start of a downtrend or a period of consolidation). Likewise, a zero-crossing from negative to positive is a potential bullish signal.
Comentários
slowcoconut
love this Calculus based approach to trading ... I'm going to build a 2nd and 3rd order version of this for the community, workin on it now -- Ive asked Pavel for some assistance in understanding, but maybe its best to ask you too -- based on his first order formulas and the Ck coefficient formula... it appears that Pavel keeps N equal to odd numbers for whole/rational coefficients... yet I see you've worked out even N values ... moreover you've even determined N=2, which will result in an M less than the initial k = 1... how did you resolve this?
peacefulLizard50262
@slowcoconut, dm me when you finish it
slowcoconut
@peacefulLizard50262, good news! rather than hard-coding the solution we can simply re-use @tbiktag derivative function for any n-th order derivative you want on any given source... rather than have to open a new pane/indicator each time I want a derivative I'll probably re-work this function into a single indicator... if you'd like I'll post the link when it's done...but yes, much simpler than reworking Pavel's equations from scratch.
peacefulLizard50262
@slowcoconut, ah yes I slotted this into my own code as an option for ["MACD","Derivative"].
CubanEmissary
Sugoi desu ne
tbiktag
cheexxer2buy
Could you put together the Second Derivative too ?
Snoop112
I used the same or a similar indicator in my previous job. I’m really pleased I find it in TradingView. Very useful to identify positive or negative movement with corresponding speed together with turning points.
Many thx.
Mais