Kalman Filtered RSI | [DeV]The Kalman Filtered RSI indicator is an advanced tool designed for traders who want precise, noise-free market insights. By enhancing the classic Relative Strength Index (RSI) with a Kalman filter, this indicator delivers a smoother, more reliable view of market momentum, helping you identify trends, reversals, and overbought/oversold conditions with greater accuracy. It’s an ideal choice for traders seeking clear signals amidst market volatility, giving you a competitive edge across any trading environment.
The RSI measures momentum by analyzing price movements over a set period, typically 14 bars. It calculates the average of price gains on up days and the average of price losses on down days, then compares these to produce a value between 0 and 100. An RSI above 70 often indicates an overbought market that may reverse downward, while below 30 suggests an oversold market that could reverse upward. RSI is great for spotting momentum shifts, potential reversals, and trend strength, but it can be noisy in choppy markets, leading to misleading signals.
That's where the Kalman filter comes in; it enhances the RSI by applying a sophisticated smoothing process that predicts the RSI’s next value based on its historical trend, then updates this prediction with the actual RSI reading. It operates in two phases: prediction and correction. In the prediction phase, it uses the previous filtered RSI and adds uncertainty from process noise (Q), which is derived from the historical variance of RSI changes, reflecting how much the RSI might unexpectedly shift. In the correction phase, it calculates a Kalman gain based on the ratio of prediction uncertainty to measurement noise (R), which is determined from the variance between raw RSI and a smoothed version, indicating the raw data’s noisiness. This gain weights how much the filter trusts the new RSI versus the prediction, blending them to produce a smoothed RSI that reduces noise while staying responsive to real trends, outperforming simpler methods like moving averages that often lag or oversmooth.
With the Kalman Filtered RSI, you get a refined view of momentum, making it easier to spot trends and reversals with clarity. This indicator’s ability to dynamically adapt to market changes delivers timely, reliable signals, making it a powerful addition to your trading strategy for any market or timeframe.
Indicators and strategies
Multi-Day VWAP, current session only)Variation on multi day vwap, where you can choose to display 1, 2 and 3 day vwap, but only plot the current session. So each session has all 3 plots. This is especially useful for backtesting purposes. St. deviation bands included as usual.
V3 Theonator Bank Volume Entry & Exitsnipe the huz out of the banks like tralala leo trlala like this indicator is fine shi liek fr
Theonator Bank Volume Entry & Exit v2best of the best im telling you liek this shit slapps the bank in the head
Relative Volume CandlesVisualizes candlesticks with transparency based on volume relative to a moving average. Higher-than-average volume makes candles more opaque, while lower volume increases transparency—helping you spot significant price movements at a glance!
Features:
Customizable up/down candle colors (default: green/red)
Adjustable lookback period for volume averaging (default: 21)
Fine-tune transparency with base transparency (default: 80) and scale (default: 2.0)
Overlay directly on your chart for seamless analysis
Theonator Bank Volume Entry & Exit v2This is the best of the best of the best idnicators for sniping the big boys and aboslutely stealing cash from the other retail brokeys, just follow it on like silver or sum and it will actully blow ur mind to pieces
Nifty 3-min Options Pro Strategy (Fixed Version)This strategy is designed specifically for high-probability intraday options trading on the Nifty 3-5 minute chart.
It intelligently combines CPR (Central Pivot Range) and VWAP to define the market's bias (bullish or bearish) and detects Inside Bar Breakouts to pinpoint low-risk, high-reward entries.
The strategy automatically:
Identifies Buy Signals for CE (Call Options) when conditions are bullish.
Identifies Buy Signals for PE (Put Options) when conditions are bearish.
Plots dynamic CPR and VWAP levels on the chart.
Applies ATR-based Stop Loss and trailing stop loss for risk management.
Generates real-time alerts for quick trading actions.
The trading logic is time-filtered to operate only during optimal intraday hours (9:00 AM to 2:30 PM), avoiding low-volume traps and volatile close sessions.
Designed to help traders capture strong directional moves early, this strategy is perfect for Nifty scalpers and intraday options traders aiming for consistent profitability.
theonator bank volume entry & exitThe best high volume indicator out there, find where the big boys go long & short trough high volume trading, be the first to know to be the moneymaker
Anchored Bollinger Band Range [SS]This is the anchored Bollinger band indicator.
What it does?
The anchored BB indicator:
Takes a user defined range and calculates the Standard Deviation of the entire selected range for the high and low values.
Computes a moving average of the high and low during the selected period (which later becomes the breakout range average)
Anchors to the last high and last low of the period range to add up to 4 standard deviations to the upside and downside, giving you 4 high and low targets.
How can you use it?
The anchored BB indicator has many applicable uses, including
Identifying daily ranges based on premarket trading activity ( see below ):
Finding breakout ranges for intraday pattern setups ( see below ):
Identified pattern of interest:
Applying Anchored BB:
Identifying daily or pattern biases based on the position to the opening breakout range average (blue line). See the examples with explanations:
ex#1:
ex#2:
The Opening Breakout Average
As you saw in the examples above, the blue line represents the opening breakout range average.
This is the average high of the period of interest and the average low of the period of interest.
Price action above this line would be considered Bullish, and Bearish if below.
This also acts as a retracement zone in non-trending markets. For example:
Best Use Cases
Identify breakout ranges for patterns on larger timeframes. For example
This pattern on SPY, if we overlay the Anchored BB:
You want to see it actually breakout from this range and hold to confirm a breakout. Failure to exceed the BB range, means that it is just ranging with no real breakout momentum.
Identify conservative ranges for a specific period in time, for example QQQ:
Worst Use Cases
Using it as a hard and fast support and resistance indicator. This is not what it is for and ranges can be exceeded with momentum. The key is looking for whether ranges are exceeded (i.e. high momentum, thus breakout play) or they are not (thus low volume, rangy).
Using it for longer term outlooks. This is not ideal for long term ranges, as with any Bollinger/standard deviation based approach, it is only responsive to CURRENT PA and cannot forecast FUTURE PA.
User Inputs
The indicator is really straight forward. There are 2 optional inputs and 1 required input.
Period Selection: Required. Selects the period for the indicator to perform the analysis on. You just select it with your mouse on the chart.
Visible MA: Optional. You can choose to have the breakout range moving average visible or not.
Fills: Optional. You can choose to have the fills plotted or not.
And that is the indicator! Very easy to use and hope you enjoy and find it helpful!
As always, safe trades everyone! 🚀
Quad Rotation StochasticQuad Rotation Stochastic
The Quad Rotation Stochastic is a powerful and unique momentum oscillator that combines four different stochastic setups into one tool, providing an incredibly detailed view of market conditions. This multi-timeframe stochastic approach helps traders better anticipate trend continuations, reversals, and momentum shifts with greater precision than traditional single stochastic indicators.
Why this indicator is useful:
Multi-layered Momentum Analysis: Instead of relying on one stochastic, this script tracks four independent stochastic readings, smoothing out noise and confirming stronger signals.
Advanced Divergence Detection: It automatically identifies bullish and bearish divergences for each stochastic, helping traders spot potential reversals early.
Background Color Alerts: When a configurable number (e.g., 3 or 4) of the stochastics agree in direction and position (overbought/oversold), the background colors green (bullish) or red (bearish) to give instant visual cues.
ABCD Pattern Recognition: The script recognizes "shield" patterns when Stochastic 4 remains stuck at extreme levels (above 90 or below 10) for a set time, warning of potential trend continuation setups.
Super Signal Alerts: If all four stochastics align in extreme conditions and slope in the same direction, the indicator plots a special "Super Signal," offering high-confidence entry opportunities.
Why this indicator is unique:
Quad Confirmation Logic: Combining four different stochastics makes this tool much less prone to false signals compared to using a single stochastic.
Customizable Divergence Coloring: Traders can choose to have divergence lines automatically match the stochastic color for clear visual association.
Adaptive ABCD Shields: Innovative use of bar counting while a stochastic remains extreme acts as a "shield," offering a unique way to filter out minor fake-outs.
Flexible Configuration: Each stochastic's sensitivity, divergence settings, and visual styling can be fully customized, allowing traders to adapt it to their own strategy and asset.
Example Usage: Trading Bitcoin with Quad Rotation Stochastic
When trading Bitcoin (BTCUSD), you might set the minimum count (minCount) to 3, meaning three out of four stochastics must be in agreement to trigger a background color.
If the background turns green, and you notice an ABCD Bullish Shield (Green X), you might look for bullish candlestick patterns or moving average crossovers to enter a long trade.
Conversely, if the background turns red and a Super Down Signal appears, it suggests high probability for further downside, giving you strong confirmation to either short BTC or avoid entering new longs.
By combining divergence signals with background colors and the ABCD shields, the Quad Rotation Stochastic provides a layered confirmation system that gives traders greater confidence in their entries and exits — particularly in fast-moving, volatile markets like Bitcoin.
Iconic Traders SessionsIconicTraders Sessions. D.D. indicatior, markiert die highs and lows (Asia & London Session)
Sharpe Ratio Forced Selling StrategyThis study introduces the “Sharpe Ratio Forced Selling Strategy”, a quantitative trading model that dynamically manages positions based on the rolling Sharpe Ratio of an asset’s excess returns relative to the risk-free rate. The Sharpe Ratio, first introduced by Sharpe (1966), remains a cornerstone in risk-adjusted performance measurement, capturing the trade-off between return and volatility. In this strategy, entries are triggered when the Sharpe Ratio falls below a specified low threshold (indicating excessive pessimism), and exits occur either when the Sharpe Ratio surpasses a high threshold (indicating optimism or mean reversion) or when a maximum holding period is reached.
The underlying economic intuition stems from institutional behavior. Institutional investors, such as pension funds and mutual funds, are often subject to risk management mandates and performance benchmarking, requiring them to reduce exposure to assets that exhibit deteriorating risk-adjusted returns over rolling periods (Greenwood and Scharfstein, 2013). When risk-adjusted performance improves, institutions may rebalance or liquidate positions to meet regulatory requirements or internal mandates, a behavior that can be proxied effectively through a rising Sharpe Ratio.
By systematically monitoring the Sharpe Ratio, the strategy anticipates when “forced selling” pressure is likely to abate, allowing for opportunistic entries into assets priced below fundamental value. Exits are equally mechanized, either triggered by Sharpe Ratio improvements or by a strict time-based constraint, acknowledging that institutional rebalancing and window-dressing activities are often time-bound (Coval and Stafford, 2007).
The Sharpe Ratio is particularly suitable for this framework due to its ability to standardize excess returns per unit of risk, ensuring comparability across timeframes and asset classes (Sharpe, 1994). Furthermore, adjusting returns by a dynamically updating short-term risk-free rate (e.g., US 3-Month T-Bills from FRED) ensures that macroeconomic conditions, such as shifting interest rates, are accurately incorporated into the risk assessment.
While the Sharpe Ratio is an efficient and widely recognized measure, the strategy could be enhanced by incorporating alternative or complementary risk metrics:
• Sortino Ratio: Unlike the Sharpe Ratio, the Sortino Ratio penalizes only downside volatility (Sortino and van der Meer, 1991). This would refine entries and exits to distinguish between “good” and “bad” volatility.
• Maximum Drawdown Constraints: Integrating a moving window maximum drawdown filter could prevent entries during persistent downtrends not captured by volatility alone.
• Conditional Value at Risk (CVaR): A measure of expected shortfall beyond the Value at Risk, CVaR could further constrain entry conditions by accounting for tail risk in extreme environments (Rockafellar and Uryasev, 2000).
• Dynamic Thresholds: Instead of static Sharpe thresholds, one could implement dynamic bands based on the historical distribution of the Sharpe Ratio, adjusting for volatility clustering effects (Cont, 2001).
Each of these risk parameters could be incorporated into the current script as additional input controls, further tailoring the model to different market regimes or investor risk appetites.
References
• Cont, R. (2001) ‘Empirical properties of asset returns: stylized facts and statistical issues’, Quantitative Finance, 1(2), pp. 223-236.
• Coval, J.D. and Stafford, E. (2007) ‘Asset Fire Sales (and Purchases) in Equity Markets’, Journal of Financial Economics, 86(2), pp. 479-512.
• Greenwood, R. and Scharfstein, D. (2013) ‘The Growth of Finance’, Journal of Economic Perspectives, 27(2), pp. 3-28.
• Rockafellar, R.T. and Uryasev, S. (2000) ‘Optimization of Conditional Value-at-Risk’, Journal of Risk, 2(3), pp. 21-41.
• Sharpe, W.F. (1966) ‘Mutual Fund Performance’, Journal of Business, 39(1), pp. 119-138.
• Sharpe, W.F. (1994) ‘The Sharpe Ratio’, Journal of Portfolio Management, 21(1), pp. 49-58.
• Sortino, F.A. and van der Meer, R. (1991) ‘Downside Risk’, Journal of Portfolio Management, 17(4), pp. 27-31.
Williams Percent Range proOverview
Williams Percent Range Pro is a powerful divergence detection tool based on the Williams %R oscillator.
It automatically identifies and plots regular and hidden divergences between price action and the %R oscillator, providing traders with early indications of potential trend reversals or trend continuations.
This indicator enhances the classic Williams %R by adding intelligent divergence detection logic, customizable visualization, and integrated alert conditions — making it a highly versatile tool for both manual and automated trading.
Features
Automatic Divergence Detection
Regular Divergence (signals trend reversals)
Hidden Divergence (signals trend continuations)
Customizable Settings
Period length, source price, color customization for each divergence type
Visual Enhancements
Overbought, Mid, and Oversold levels (-20, -50, -80)
Shaded background for easier visual interpretation
Pivot Detection
Identifies key swing points on the Williams %R line for divergence comparison
Integrated Alerts
Set up alerts for each type of divergence without coding
Lightweight and Optimized
Designed for fast loading and efficient operation on any timeframe
How It Works
Williams %R Calculation
The script calculates the Williams %R as follows:
%R = 100 × (Close - Highest High over Period) ÷ (Highest High - Lowest Low)
This results in a value that moves between -100 and 0, indicating overbought and oversold conditions.
Pivot Detection
The indicator uses pivot highs and pivot lows on the %R line to determine important swing points.
Pivot logic is based on comparing neighboring candles (5 bars to the left and 5 bars to the right by default).
Divergence Detection
1. Regular Divergence
Regular Bullish Divergence:
Price makes a Lower Low
Williams %R makes a Higher Low
→ Signals potential upward reversal
Regular Bearish Divergence:
Price makes a Higher High
Williams %R makes a Lower High
→ Signals potential downward reversal
2. Hidden Divergence
Hidden Bullish Divergence:
Price makes a Higher Low
Williams %R makes a Lower Low
→ Signals potential upward continuation
Hidden Bearish Divergence:
Price makes a Lower High
Williams %R makes a Higher High
→ Signals potential downward continuation
Each type of divergence is plotted with a specific label and customizable color on the indicator.
Input Parameters
Input Description
Length Period length for Williams %R calculation (default: 14)
Source Data source (default: Close)
Show Regular Divergence Enable/disable regular divergence detection
Show Hidden Divergence Enable/disable hidden divergence detection
Regular Bullish Color Color for regular bullish divergence labels
Regular Bearish Color Color for regular bearish divergence labels
Hidden Bullish Color Color for hidden bullish divergence labels
Hidden Bearish Color Color for hidden bearish divergence labels
Visual Elements
Horizontal Lines:
-20: Overbought zone
-50: Mid-level (dashed line)
-80: Oversold zone
Background Shading:
Fills between -20 and -80 for better visual focus on active trading zones.
Divergence Labels:
Bull = Regular Bullish Divergence
Bear = Regular Bearish Divergence
H Bull = Hidden Bullish Divergence
H Bear = Hidden Bearish Divergence
Each label appears exactly at the pivot points of the Williams %R line, offset slightly for clarity.
Alerts
You can create TradingView alerts based on the following conditions:
Regular Bullish Divergence Detected
Regular Bearish Divergence Detected
Hidden Bullish Divergence Detected
Hidden Bearish Divergence Detected
This allows fully automated trading setups or mobile push notifications.
Example alert message:
"Williams %R Regular Bullish Divergence Detected"
Usage Tips
Entry Strategy:
Combine divergence signals with trend confirmation indicators like EMA/SMA, MACD, or Volume.
Exit Strategy:
Monitor when price reaches key resistance/support zones or overbought/oversold levels on the %R.
Higher Accuracy:
Always confirm divergences with price action patterns such as breakouts, candlestick formations, or trendline breaks.
Conclusion
The Williams Percent Range Pro indicator brings powerful divergence detection and customization features to a classic momentum oscillator.
It provides clear visual and alert-based trading signals that help you anticipate major turning points or trend continuations in any market and timeframe.
Whether you are a swing trader, day trader, or scalper, this tool can be an essential addition to your technical analysis toolkit.
1-Hour Candlestick Patterns on 15m Chartplots 1 hour candlesticks on lower timeframe so there is no need to jump from higher time frame to lower time frame.
Cointegration Buy and Sell Signals [EdgeTerminal]The Cointegration Buy And Sell Signals is a sophisticated technical analysis tool to spot high-probability market turning points — before they fully develop on price charts.
Most reversal indicators rely on raw price action, visual patterns, or basic and common indicator logic — which often suffer in noisy or trending markets. In most cases, they lag behind the actual change in trend and provide useless and late signals.
This indicator is rooted in advanced concepts from statistical arbitrage, mean reversion theory, and quantitative finance, and it packages these ideas in a user-friendly visual format that works on any timeframe and asset class.
It does this by analyzing how the short-term and long-term EMAs behave relative to each other — and uses statistical filters like Z-score, correlation, volatility normalization, and stationarity tests to issue highly selective Buy and Sell signals.
This tool provides statistical confirmation of trend exhaustion, allowing you to trade mean-reverting setups. It fades overextended moves and uses signal stacking to reduce false entries. The entire indicator is based on a very interesting mathematically grounded model which I will get into down below.
Here’s how the indicator works at a high level:
EMAs as Anchors: It starts with two Exponential Moving Averages (EMAs) — one short-term and one long-term — to track market direction.
Statistical Spread (Regression Residuals): It performs a rolling linear regression between the short and long EMA. Instead of using the raw difference (short - long), it calculates the regression residual, which better models their natural relationship.
Normalize the Spread: The spread is divided by historical price volatility (ATR) to make it scale-invariant. This ensures the indicator works on low-priced stocks, high-priced indices, and crypto alike.
Z-Score: It computes a Z-score of the normalized spread to measure how “extreme” the current deviation is from its historical average.
Dynamic Thresholds: Unlike most tools that use fixed thresholds (like Z = ±2), this one calculates dynamic thresholds using historical percentiles (e.g., top 10% and bottom 10%) so that it adapts to the asset's current behavior to reduce false signals based on market’s extreme volatility at a certain time.
Z-Score Momentum: It tracks the direction of the Z-score — if Z is extreme but still moving away from zero, it's too early. It waits for reversion to start (Z momentum flips).
Correlation Check: Uses a rolling Pearson correlation to confirm the two EMAs are still statistically related. If they diverge (low correlation), no signal is shown.
Stationarity Filter (ADF-like): Uses the volatility of the regression residual to determine if the spread is stationary (mean-reverting) — a key concept in cointegration and statistical arbitrage. It’s not possible to build an exact ADF filter in Pine Script so we used the next best thing.
Signal Control: Prevents noisy charts and overtrading by ensuring no back-to-back buy or sell signals. Each signal must alternate and respect a cooldown period so you won’t be overwhelmed and won’t get a messy chart.
Important Notes to Remember:
The whole idea behind this indicator is to try to use some stat arb models to detect shifting patterns faster than they appear on common indicators, so in some cases, some assumptions are made based on historic values.
This means that in some cases, the indicator can “jump” into the conclusion too quickly. Although we try to eliminate this by using stationary filters, correlation checks, and Z-score momentum detection, there is still a chance some signals that are generated can be too early, in the stock market, that's the same as being incorrect. So make sure to use this with other indicators to confirm the movement.
How To Use The Indicator:
You can use the indicator as a standalone reversal system, as a filter for overbought and oversold setups, in combination with other trend indicators and as a part of a signal stack with other common indicators for divergence spotting and fade trades.
The indicator produces simple buy and sell signals when all criteria is met. Based on our own testing, we recommend treating these signals as standalone and independent from each other . Meaning that if you take position after a buy signal, don’t wait for a sell signal to appear to exit the trade and vice versa.
This is why we recommend using this indicator with other advanced or even simple indicators as an early confirmation tool.
The Display Table:
The floating diagnostic table in the top-right corner of the chart is a key part of this indicator. It's a live statistical dashboard that helps you understand why a signal is (or isn’t) being triggered, and whether the market conditions are lining up for a potential reversal.
1. Z-Score
What it shows: The current Z-score value of the volatility-normalized spread between the short EMA and the regression line of the long EMA.
Why it matters: Z-score tells you how statistically extreme the current relationship is. A Z-score of:
0 = perfectly average
> +2 = very overbought
< -2 = very oversold
How to use it: Look for Z-score reaching extreme highs or lows (beyond dynamic thresholds). Watch for it to start reversing direction, especially when paired with green table rows (see below)
2. Z-Score Momentum
What it shows: The rate of change (ROC) of the Z-score:
Zmomentum=Zt − Zt − 1
Why it matters: This tells you if the Z-score is still stretching out (e.g., getting more overbought/oversold), or reverting back toward the mean.
How to use it: A positive Z-momentum after a very low Z-score = potential bullish reversal A negative Z-momentum after a very high Z-score = potential bearish reversal. Avoid signals when momentum is still pushing deeper into extremes
3. Correlation
What it shows: The rolling Pearson correlation coefficient between the short EMA and long EMA.
Why it matters: High correlation (closer to +1) means the EMAs are still statistically connected — a key requirement for cointegration or mean reversion to be valid.
How to use it: Look for correlation > 0.7 for reliable signals. If correlation drops below 0.5, ignore the Z-score — the EMAs aren’t moving together anymore
4. Stationary
What it shows: A simplified "Yes" or "No" answer to the question:
“Is the spread statistically stable (stationary) and mean-reverting right now?”
Why it matters: Mean reversion strategies only work when the spread is stationary — that is, when the distance between EMAs behaves like a rubber band, not a drifting cloud.
How to use it: A "Yes" means the indicator sees a consistent, stable spread — good for trading. "No" means the market is too volatile, disjointed, or chaotic for reliable mean reversion. Wait for this to flip to "Yes" before trusting signals
5. Last Signal
What it shows: The last signal issued by the system — either "Buy", "Sell", or "None"
Why it matters: Helps avoid confusion and repeated entries. Signals only alternate — you won’t get another Buy until a Sell happens, and vice versa.
How to use it: If the last signal was a "Buy", and you’re watching for a Sell, don’t act on more bullish signals. Great for systems where you only want one position open at a time
6. Bars Since Signal
What it shows: How many bars (candles) have passed since the last Buy or Sell signal.
Why it matters: Gives you context for how long the current condition has persisted
How to use it: If it says 1 or 2, a signal just happened — avoid jumping in late. If it’s been 10+ bars, a new opportunity might be brewing soon. You can use this to time exits if you want to fade a recent signal manually
Indicator Settings:
Short EMA: Sets the short-term EMA period. The smaller the number, the more reactive and more signals you get.
Long EMA: Sets the slow EMA period. The larger this number is, the smoother baseline, and more reliable trend bases are generated.
Z-Score Lookback: The period or bars used for mean & std deviation of spread between short and long EMAs. Larger values result in smoother signals with fewer false positives.
Volatility Window: This value normalizes the spread by historical volatility. This allows you to prevent scale distortion, showing you a cleaner and better chart.
Correlation Lookback: How many periods or how far back to test correlation between slow and long EMAs. This filters out false positives when EMAs lose alignment.
Hurst Lookback: The multiplier to approximate stationarity. Lower leads to more sensitivity to regime change, higher produces a more stricter filtering.
Z Threshold Percentile: This value sets how extreme Z-score must be to trigger a signal. For example, 90 equals only top/bottom 10% of extremes, 80 = more frequent.
Min Bars Between Signals: This hard stop prevents back-to-back signals. The idea is to avoid over-trading or whipsaws in volatile markets even when Hurst lookback and volatility window values are not enough to filter signals.
Some More Recommendations:
We recommend trying different EMA pairs (10/50, 21/100, 5/20) for different asset behaviors. You can set percentile to 85 or 80 if you want more frequent but looser signals. You can also use the Z-score reversion monitor for powerful confirmation.
Scalping Strategy with Fixed CooldownThis is a sample scalping strategy is designed for short-term trading on lower timeframes.
Entry Signals: Utilizes Hull Moving Average (HullMA) crossovers to generate buy and sell signals.
Filters:
-Bollinger Bands and RSI to avoid overbought or oversold conditions.
-VWAP to confirm trend direction, ensuring trades align with momentum.
Cooldown Mechanism: Implements a bar-based cooldown period to prevent immediate re-entries after trade closures, reducing the risk of overtrading.
BollingerBands MTF | AlchimistOfCrypto🌌 Bollinger Bands – Unveiling Market Volatility Fields 🌌
"The Bollinger Bands, reimagined through quantum mechanics principles, visualizes the probabilistic distribution of price movements within a multi-dimensional volatility field. This indicator employs principles from wave function mathematics where standard deviation creates probabilistic boundaries, similar to electron cloud models in quantum physics. Our implementation features algorithmically enhanced visualization derived from extensive mathematical modeling, creating a dynamic representation of volatility compression and expansion cycles with adaptive glow effects that highlight the critical moments where volatility phase transitions occur."
📊 Professional Trading Application
The Bollinger Bands Quantum transcends traditional volatility measurement with a sophisticated gradient illumination system that reveals the underlying structure of market volatility fields. Scientifically calibrated for multiple timeframes and featuring eight distinct visual themes, it enables traders to perceive volatility contractions and expansions with unprecedented clarity.
⚙️ Indicator Configuration
- Volatility Field Parameters 📏
Python-optimized settings for specific market conditions:
- Period: 20 (default) - The quantum time window for volatility calculation
- StdDev Multiplier: 2.0 - The probabilistic boundary coefficient
- MA Type: SMA/EMA/VWMA/WMA/RMA - The quantum field smoothing algorithm
- Visual Theming 🎨
Eight scientifically designed visual palettes optimized for volatility pattern recognition:
- Neon (default): High-contrast green/red scheme enhancing volatility transition visibility
- Cyan-Magenta: Vibrant palette for maximum volatility boundary distinction
- Yellow-Purple: Complementary colors for enhanced compression/expansion detection
- Specialized themes (Green-Red, Forest Green, Blue Ocean, Orange-Red, Grayscale): Each calibrated for different market environments
- Opacity Control 🔍
- Variable transparency system (0-100) allowing seamless integration with price action
- Adaptive glow effect that intensifies during volatility phase transitions
- Quantum field visualization that reveals the probabilistic nature of price movements
🚀 How to Use
1. Select Visualization Parameters ⏰: Adjust period and standard deviation to match market conditions
2. Choose MA Type 🎚️: Select the appropriate smoothing algorithm for your trading strategy
3. Select Visual Theme 🌈: Choose a color scheme that enhances your personal pattern recognition
4. Adjust Opacity 🔎: Fine-tune visualization intensity to complement your chart analysis
5. Identify Volatility Phases ✅: Monitor band width to detect compression (pre-breakout) and expansion (trend)
6. Trade with Precision 🛡️: Enter during band contraction for breakouts, or trade mean reversion using band boundaries
7. Manage Risk Dynamically 🔐: Use band width as volatility-based position sizing parameter
Sharpe & Sortino Ratio PROSharpe & Sortino Ratio PRO offers an advanced and more precise way to calculate and visualize the Sharpe and Sortino Ratios for financial assets on TradingView. Its main goal is to provide a scientifically accurate method for assessing the risk-adjusted performance of assets, both in the short and long term. Unlike TradingView’s built-in metrics, this script correctly handles periodic returns, uses optional logarithmic returns, properly annualizes both returns and volatility, and adjusts for the risk-free rate — all critical factors for truly meaningful Sharpe and Sortino calculations.
Users can customize the rolling analysis window (e.g., 252 periods for one year on daily data) and the long-term smoothing period (e.g., 1260 periods for five years). There’s also an option to select between linear and logarithmic returns and to manually input a risk-free rate if real-time data from FRED (the 3-Month T-Bill Rate via FRED:DGS3MO) is unavailable. Based on the chart’s timeframe (daily, weekly, or monthly), the script automatically adjusts the risk-free rate to a per-period basis.
The Sharpe Ratio is calculated by first determining the asset’s excess returns (returns after subtracting the risk-free return per period), then computing the average and standard deviation of those excess returns over the specified window, and finally annualizing these figures separately — in line with best scientific practices (Sharpe, 1994). The Sortino Ratio follows a similar approach but only considers negative returns, focusing specifically on downside risk (Sortino & Van der Meer, 1991).
To enhance readability, the script visualizes the ratios using a color gradient: strong negative values are shown in red, neutral values in yellow, and strong positive values in green. Additionally, the long-term averages for both Sharpe and Sortino are plotted with steady colors (teal and orange, respectively), making it easier to spot enduring performance trends.
Why calculating Sharpe and Sortino Ratios manually on TradingView is necessary?
While TradingView provides basic Sharpe and Sortino Ratios, they come with significant methodological flaws that can lead to misleading conclusions about an asset’s true risk-adjusted performance.
First, TradingView often computes volatility based on the standard deviation of price levels rather than returns (TradingView, 2023). This method is problematic because it causes the volatility measure to be directly dependent on the asset’s absolute price. For instance, a stock priced at $1,000 will naturally show larger absolute daily price moves than a $10 stock, even if their percentage changes are similar. This artificially inflates the measured standard deviation and, as a result, depresses the calculated Sharpe Ratio.
Second, TradingView frequently neglects to adjust for the risk-free rate. By treating all returns as risky returns, the computed Sharpe Ratio may significantly underestimate risk-adjusted performance, especially when interest rates are high (Sharpe, 1994).
Third, and perhaps most critically, TradingView doesn’t properly annualize the mean excess return and the standard deviation separately. In correct financial math, the mean excess return should be multiplied by the number of periods per year, while the standard deviation should be multiplied by the square root of the number of periods per year (Cont, 2001; Fabozzi et al., 2007). Incorrect annualization skews the Sharpe and Sortino Ratios and can lead to under- or overestimating investment risk.
These flaws lead to three major issues:
• Overstated volatility for high-priced assets.
• Incorrect scaling between returns and risk.
• Sharpe Ratios that are systematically biased downward, especially in high-price or high-interest environments.
How to properly calculate Sharpe and Sortino Ratios in Pine Script?
To get accurate results, the Sharpe and Sortino Ratios must be calculated using the correct methodology:
1. Use returns, not price levels, to calculate volatility. Ideally, use logarithmic returns for better mathematical properties like time additivity (Cont, 2001).
2. Adjust returns by subtracting the risk-free rate on a per-period basis to obtain true excess returns.
3. Annualize separately:
• Multiply the mean excess return by the number of periods per year (e.g., 252 for daily data).
• Multiply the standard deviation by the square root of the number of periods per year.
4. Finally, divide the annualized mean excess return by the annualized standard deviation to calculate the Sharpe Ratio.
The Sortino Ratio follows the same structure but uses downside deviations instead of standard deviations.
By following this scientifically sound method, you ensure that your Sharpe and Sortino Ratios truly reflect the asset’s real-world risk and return characteristics.
References
• Cont, R. (2001). Empirical properties of asset returns: stylized facts and statistical issues. Quantitative Finance, 1(2), pp. 223–236.
• Fabozzi, F.J., Gupta, F. and Markowitz, H.M. (2007). The Legacy of Modern Portfolio Theory. Journal of Investing, 16(3), pp. 7–22.
• Sharpe, W.F. (1994). The Sharpe Ratio. Journal of Portfolio Management, 21(1), pp. 49–58.
• Sortino, F.A. and Van der Meer, R. (1991). Downside Risk: Capturing What’s at Stake in Investment Situations. Journal of Portfolio Management, 17(4), pp. 27–31.
• TradingView (2023). Help Center - Understanding Sharpe and Sortino Ratios. Available at: www.tradingview.com (Accessed: 25 April 2025).
Pi Cycle | AlchimistOfCrypto Pi Cycle Top Indicator - A Powerful Market Phase Detector
Developed by AlchimistOfCrypto
🧪 The Pi Cycle uses mathematical harmony to identify Bitcoin market cycle tops
with remarkable precision. Just as elements react at specific temperatures,
Bitcoin price behaves predictably when these two moving averages converge! 🧬
⚗️ The formula measures when the 111-day SMA crosses below the 350-day SMA × 2,
creating a perfect alchemical reaction that has successfully identified the
major cycle tops in 2013, 2017, and 2021.
🔬 Like the Golden Ratio in nature, this indicator reveals the hidden
mathematical structure within Bitcoin's chaotic price movements.
🧮 When the reaction occurs, prepare for molecular breakdown! 🔥
Day Trading NR4/NR7 + 2BarNR/3BarNR + ID + MomentumDay Trading Version: The High-Precision Momentum Setup
The Day Trading Version of this strategy is designed for traders who need quick, high-probability setups that work in real-time throughout the trading day. It’s a dynamic approach that blends classic price compression patterns with crucial intraday filters like VWAP and MACD, ensuring you’re only executing trades when everything lines up for success.
Price Compression: Focuses on NR4, NR7, and Inside Day patterns, offering clear signals when stocks are in tight ranges—ideal for a breakout or breakdown. These setups identify periods of compression that often precede explosive moves.
Trend Alignment: Price must be above the 20 EMA, with the 10 EMA above the 20 EMA, confirming a trend that's worthy of entering. These filters keep you on the right side of the market, ensuring you’re trading in the direction of momentum.
VWAP Filter: The price must be above VWAP for long trades, keeping you in sync with intraday institutional flow. This ensures you're aligning with the market’s overall bias.
MACD Confirmation: The fast MACD line needs to be at least 5% above or below the slow line, ensuring that the trade has sufficient momentum. For long trades, the MACD must be positive, confirming upward strength.
This strategy is built for momentum-focused traders who thrive on fast action and want to capture intraday volatility. Perfect for day traders who need to identify reliable setups on the fly, with clear rules and filters that make entering and exiting positions easier than ever.