TradingView
IkkeOmar
2023年4月29日午後4時50分

Normalized KAMA Oscillator | Ikke Omar 

Bitcoin / TetherUSBinance

詳細

This indicator demonstrates the creation of a normalized KAMA (Kaufman Adaptive Moving Average) oscillator with a table display. I will explain how the code works, providing a step-by-step breakdown. This is personally made by me:)

Input Parameters:
fast_period and slow_period: Define the periods for calculating the KAMA.
er_period: Specifies the period for calculating the Efficiency Ratio.
norm_period: Determines the lookback period for normalizing the oscillator.

Efficiency Ratio (ER) Calculation:
Measures the efficiency of price changes over a specified period.
Calculated as the ratio of the absolute price change to the total price volatility.

Smoothing Constant Calculation:
Determines the smoothing constant (sc) based on the Efficiency Ratio (ER) and the fast and slow periods.
The formula accounts for the different periods to calculate an appropriate smoothing factor.

KAMA Calculation:
Uses the Exponential Moving Average (EMA) and the smoothing constant to compute the KAMA.
Combines the fast EMA and the adjusted price change to adapt to market conditions.

Oscillator Normalization:
Normalizes the oscillator values to a range between -0.5 and 0.5 for better visualization and comparison.
Determines the highest and lowest values of the KAMA within the specified normalization period.
Transforms the KAMA values into a normalized range.

By incorporating the Efficiency Ratio, smoothing constant, and normalization techniques, the indicator actually allows for the identification of trends on different timeframes, even in extreme market conditions.
The normalization makes it much more adaptive than if you were to just use a normal KAMA line. This way you actually get a lot more data by looking at the histogram, rather than just the KAMA line.
I essentially made the KAMA into an oscillator! Please ask if you want me to code another indicator

I hope you enjoyed this.
Please ask if you have any questions<3

リリースノート

Updated color theme

リリースノート

Added the possibility to turn off normalization which removes the oscillating component:

リリースノート

Added the possibility to turn off normalization which removes the oscillating component:
コメント
quraishi2k17
Looks good man, does it repaint?
IkkeOmar
@quraishi2k17, nope, if you want to check it, you can run it in replay mode G. Compare how it looks with repaint and without repaint. Its the exact same, could be some decimal errors depending on what date you run the replay from
FullyInvest613
@IkkeOmar Very nice. Would it be possible to add an alert when it changes from green to red or vice versa?
IkkeOmar
@FullyInvest613, I can do that
FullyInvest613
@IkkeOmar, Wonderful! Keep me posted when you make those alerts! Also was wondering if you could make a histogram version for another script out there called the RSI-MFI machine learning by TZack88?
yocko
Thanks. Interesting
IkkeOmar
@yocko, thanks a lot for the support G!
IkkeOmar
Let me know what your thoughts are!
詳細