Lévy Flight Relative Strength Index [SEERQUANT]
A nuanced improvement on the classic RSI, the Lévy Flight RSI leverages the Lévy Flight model to calculate dynamic weighted gains and losses, offering improved responsiveness and smoothness in trend detection compared to the regular RSI. Ideal for traders seeking a balance between precision and adaptability, the Lévy Flight RSI is packed with customizable features and a sleek, modern aesthetic.
-----------------------------------------------------------------
🧠 What is Lévy Flight Modelling?
Lévy Flight modelling is a concept derived from probability theory and fractal mathematics, widely applied in fields such as finance and physics. In trading, Lévy Flights describe a random walk process characterized by small, frequent movements interspersed with larger, less frequent movements. This behaviour reflects real-world price dynamics, where markets often exhibit periods of relative calm followed by sharp, volatile movements. The Lévy Flight model introduces a weighting mechanism that amplifies extreme price changes while smoothing smaller ones, providing a more nuanced view of market trends.
In the context of the Lévy Flight RSI, this model enhances traditional RSI calculations by dynamically weighting price changes (gains and losses) based on their magnitude. This results in an RSI that is more responsive to significant price movements, making it ideal for detecting shifts in momentum and market direction.
-----------------------------------------------------------------
🌟 Key Features:
- Dynamic Lévy Flight Modelling: Adjust alpha (1 to 2) for responsive or smooth signals, making it perfect for varying market conditions.
- Custom RSI Smoothing: Choose from multiple moving average types, including TEMA, DEMA, HMA, ALMA, and more, to match your trading style.
- Visually Intuitive: Neon-inspired gradient colours and centered histogram provide instant insights into market conditions.
- Customizable Overbought/Oversold Levels: Clearly defined thresholds, with additional shaded regions for strength identification.
-----------------------------------------------------------------
⚙️ How the Code Works
The Lévy Flight RSI enhances the traditional RSI calculation by incorporating two primary elements:
Dynamic Weighting Using Lévy Flight:
The code calculates the price change (change) on each bar and applies a power function (alpha) to these changes. Gains are raised to the power of alpha (for positive price changes), and losses are similarly transformed (for negative price changes).
The parameter alpha (ranging from 1 to 2) determines the sensitivity of the weighting. Lower values emphasize responsiveness, while higher values smooth out signals.
Enhanced Moving Averages:
The weighted gains and losses are smoothed using a customizable moving average. Options include traditional averages like SMA and EMA, and more advanced ones like TEMA, HMA, and ALMA. These smoothed values are used to calculate the final RSI value.
-----------------------------------------------------------------
📈 Why Use Lévy Flight RSI?
This unique RSI indicator captures price momentum with enhanced sensitivity to market dynamics. Whether you’re trend-following, scalping, or identifying reversals, the Lévy Flight RSI provides robust insights to refine your trading decisions.
-----------------------------------------------------------------
🔧 Inputs:
RSI Settings: Control RSI length, calculation source, and smoothing type.
Lévy Flight Settings: Adjust alpha to tune the indicator's responsiveness.
Style Customization: Tailor the appearance with different colour themes and gradients.
-----------------------------------------------------------------