quanstocThe quanstoc indicator is designed to detect rare and potentially high-probability reversal or trend initiation signals using Stochastic RSI. It identifies a double cross event: two consecutive crosses between %K and %D lines (on back-to-back candles), following a quiet period of at least three candles without any crossover. The signal is marked clearly on the chart and can trigger custom alerts. Supports all timeframes.
Indicatori e strategie
Yearly Performance Table with CAGROverview
This Pine Script indicator provides a clear table displaying the annual performance of an asset, along with two different average metrics: the arithmetic mean and the geometric mean (CAGR).
Core Features
Annual Performance Calculation:
Automatically detects the first trading day of each calendar year.
Calculates the percentage return for each full calendar year.
Based on closing prices from the first to the last trading day of the respective year.
Flexible Display:
Adjustable Period: Displays data for 1-50 years (default: 10 years).
Daily Timeframe Only: Functions exclusively on daily charts.
Automatic Update: Always shows the latest available years.
Two Average Metrics:
AVG (Arithmetic Mean)
A simple average of all annual returns. (Formula: (R₁ + R₂ + ... + Rₙ) ÷ n)
Important: Can be misleading in the presence of volatile returns.
GEO (Geometric Mean / CAGR)
Compound Annual Growth Rate. (Formula: ^(1/n) - 1)
Represents the true average annual growth rate.
Fully accounts for the compounding effect.
Limitations
Daily Charts Only: Does not work on intraday or weekly/monthly timeframes.
Calendar Year Basis: Calculations are based on calendar years, not rolling 12-month periods.
Historical Data: Dependent on the availability of historical data from the broker/data provider.
Interpretation of Results
CAGR as Benchmark: The geometric mean is more suitable for performance comparisons.
Annual Patterns: Individual year figures can reveal seasonal or cyclical trends.
A+ Trade Checklist (Table Only)This is the only A+ trading checklist you'll ever need.
Let me know if you'd like anything added!
If you want to help my journey USDT address is below :)
Network
BNB Smart Chain
0x539c59b98b6ee346072dd2bafbf9418dad475dbc
Follow my insta:
@liviupircalabu10
Inside DayOnly uses completed bars (high , low ) — ignores today's intraday bar.
Plots only after market close, not during the current session.
Designed for end-of-day screeners and alerts, reliable for after-hours analysis.
OBV PanelOBV Panel – Volume-Based Price Prediction & Signal Dashboard
Powered by Pine Script v6
🔍 Overview
This multi-functional indicator is designed around the On-Balance Volume (OBV) concept, enhancing it with prediction models, trend tracking, and actionable buy/sell signals. It uses a combination of real-time OBV movement, smoothed OBV with EMA, and linear regression-based OBV forecasts to deliver both intraday and weekly insights — all neatly displayed in a table panel and directly plotted on your chart.
⚙️ Core Components
📌 1. OBV Core
OBV is calculated based on volume flowing into or out of a stock as price moves up or down.
Tracks raw OBV and its EMA (Exponential Moving Average) for smoother trend reading.
Computes a Predicted OBV using Linear Regression (ta.linreg) over a user-defined number of bars.
🔮 2. Predicted Price Forecast
Uses OBV percentage changes combined with a user-set sensitivity factor to project next day’s expected price.
Offers an AI-style price forecast based on OBV strength, not just price action.
💹 3. Buy/Sell Signal Logic
Daily Signals: Triggered when OBV, OBV EMA, and Predicted OBV all move upward or downward from the previous day.
Weekly Signals: Based on EMA changes over a 5-bar period (approx. 1 week).
Signal markers are drawn on the chart for visual reference.
📊 Table Panel (Top-Right Overlay)
A detailed visual panel shows:
Metric Description
OBV, OBV EMA, Predicted OBV From previous close to current value
OBV - Predicted OBV Difference In lakhs (scaled for readability)
% Change Stats Daily percentage change in OBV, EMA, and Predicted OBV
Weekly OBV EMA Change Actual & % change over 5 bars
Signal Summary BUY/SELL or HOLD based on logic
OBV Dominance Whether OBV > EMA and Predicted OBV
Predicted Price (Next Day) Based on OBV dynamics and sensitivity
Pierre's H4 EMA/MA Compression Strategy (BTC)Pierre's logic and trading strategy from the X post and its related threads. The post focuses on Bitcoin (BTC) price action on a 4-hour (H4) chart, using Exponential Moving Averages (EMAs) and Moving Averages (MAs) to identify a potential "EMA/MA compression" scenario, which is a key part of his analysis.
Summary of Pierre's Logic
Pierre is analyzing Bitcoin's price movement on the H4 timeframe, focusing on a technical pattern he calls "EMA/MA compression." This concept is central to his analysis and involves the interaction of key moving averages (H4 100 MA, H4 200 EMA, and H4 300 MA) to predict price behavior. Here's the breakdown of his logic:
EMA/MA Compression Concept:
Pierre describes "EMA/MA compression" as a scenario where the price consolidates around key moving averages, leading to a tightening of volatility before a breakout or breakdown.
In this case, the H4 100 MA, H4 200 EMA, and H4 300 MA are the critical levels to watch. These moving averages act as dynamic support/resistance levels, and their behavior (break, hold, or flip) dictates the trend direction.
He notes that this compression often follows a cycle: EMA/MA compression → Trend → Gap Fills → Repeat. This cycle suggests that after a compression phase, the price tends to trend, fill any price gaps, and then return to another compression phase.
Key Levels and Conditions for a Bullish Scenario:
H4 100 MA: Must break or flip to the upside. A break above this level signals bullish momentum, while a failure to hold above it (a "flip") invalidates the bullish case.
H4 200 EMA: Acts as an "intermediary" level that must hold during pullbacks. If this level holds, it supports the bullish structure.
H4 300 MA: A critical support level. It must hold to keep the bullish scenario intact. If the price loses this level (and it flips to resistance), the bullish outlook is invalidated.
Pierre mentions that after the price breaks the H4 100 MA, it should aim to fill gaps between 109.5 and 110.5 (likely in thousands, so $109,500–$110,500). If the H4 200 EMA holds, the price might pull back to the H4 300 MA, where it could consolidate further before continuing the trend.
Invalidation Scenarios:
The bullish scenario is invalidated if:
The H4 100 MA is broken and flips to resistance (i.e., price closes below it after initially breaking above).
The H4 300 MA is lost and flips to resistance (i.e., price closes below it and fails to reclaim it).
Current Market Context:
Pierre notes a "nice bounce" in BTC's price, bringing it back into the compression zone. The price is currently fighting a key area on lower timeframes (LTF), likely referring to shorter timeframes like H1 or M15.
He mentions that all gaps have been filled for now (referencing the cycle of gap fills), which aligns with his expectation of reduced volatility as the price enters another compression phase.
Historical Context and Consistency:
Pierre has been tracking this scenario since the H4 100 MA break, as shared in his group @TheHavenCrypto
. He references notes from Monday (likely June 2, 2025, as the post is from June 6), indicating that his analysis has been consistent over the week.
In a follow-up post, he reflects on a recent trade where he took partial profits on the bounce but couldn’t fully capitalize on the move due to being on his phone and managing only a fraction of his intended position size near the H4 300 MA (for BTC) and H4 200 EMA (for ETH).
Pierre's Trading Strategy
Based on the post and its context, Pierre’s trading strategy revolves around the EMA/MA compression framework. Here’s how he approaches trades:
Setup Identification:
Pierre identifies setups using the H4 timeframe, focusing on the interaction of the H4 100 MA, H4 200 EMA, and H4 300 MA.
He looks for a "compression" phase where the price consolidates around these moving averages, signaling a potential breakout or breakdown.
In this case, the price breaking the H4 100 MA to the upside was his initial signal for a bullish setup.
Entry Points:
Pierre likely entered a long position (buy) near the H4 300 MA or H4 200 EMA during the recent bounce, as he mentions taking partial profits on the move.
He prefers entering after a pullback to these key levels (e.g., H4 200 EMA or H4 300 MA) as long as they hold as support. For example, in Thread 1 (Post 1930270942871118081), he shares a chart showing a long entry near the H4 300 MA with an upside target near 110,000–111,000.
Target Setting:
His primary target after the H4 100 MA break is to fill gaps between $109,500 and $110,500.
If the price reaches these levels and the H4 200 EMA holds, he expects a potential pullback to the H4 300 MA, followed by another leg up (as part of the trend phase in his cycle).
Risk Management:
Pierre sets clear invalidation levels:
A close below the H4 100 MA after breaking above it.
A close below the H4 300 MA with a failure to reclaim it.
He takes partial profits on bounces, as seen in his follow-up post where he mentions securing gains but not fully capitalizing on the move due to limited position size.
Position Sizing and Execution:
Pierre mentions being limited by trading from his phone, which restricted his position size. This suggests he typically scales into trades with a planned size but adjusts based on execution conditions.
He also notes going "AFK for the weekend" after taking profits, indicating a disciplined approach to stepping away from the market when not actively monitoring.
Cycle-Based Trading:
His strategy follows the cycle of EMA/MA compression → Trend → Gap Fills → Repeat. After the gaps are filled, he expects volatility to tighten (another compression phase), which could set up the next trade.
Key Takeaways for Traders
Focus on Key Levels: Pierre’s strategy hinges on the H4 100 MA, H4 200 EMA, and H4 300 MA. These levels are used to confirm trends, identify entries, and set invalidation points.
Patience for Compression: He waits for the price to enter a compression phase (tight consolidation around MAs) before expecting a breakout or breakdown.
Gap-Filling as a Target: Pierre uses price gaps (e.g., $109,500–$110,500) as targets, aligning with the market’s tendency to fill these gaps (as noted in the related web result from investing.com about CME gaps).
Risk Management: He has clear invalidation rules and takes partial profits to lock in gains while letting the trade play out.
Cycle Awareness: His trades are part of a broader cycle (compression → trend → gap fill → repeat), which helps him anticipate market behavior.
Additional Context from Related Threads
Thread 1 (June 4–June 6): Pierre’s earlier posts (e.g., Post 1930270942871118081) show historical examples of EMA/MA compression leading to trends and gap fills, reinforcing his current analysis. He also shares a chart with a potential upside target of $110,000–$111,000 if the H4 300 MA holds.
Thread 2 (June 3): Pierre mentions a Daily (D1) timeframe analysis where the D1 100 MA and D1 200 EMA align with range lows, suggesting a potential "wet dream swing long opportunity" if the price holds these levels. This indicates he’s also considering higher timeframes for confirmation.
Thread 3 (May 27): Pierre’s earlier analysis highlights similar concepts (e.g., H4 100 MA break, H4 200 EMA hold), showing consistency in his approach over time.
Conclusion
Pierre’s logic is rooted in technical analysis, specifically the interaction of moving averages on the H4 timeframe to identify "EMA/MA compression" setups. His strategy involves buying on pullbacks to key support levels (H4 200 EMA, H4 300 MA) after a breakout (H4 100 MA), targeting gap fills ($109,500–$110,500), and managing risk with clear invalidation levels. He follows a cyclical approach to trading, expecting periods of compression, trending, and gap-filling to repeat, which guides his entries, exits, and overall market outlook.
DMI-LuminateIndicator Description: DMI-Luminate (DMI-LMT)
DMI-Luminate is an enhanced version of the Directional Movement Index (DMI) indicator that combines multiple moving averages for smoothing and offers various options to customize the calculation of ADX, +DM, -DM, DX, and ADXR. It is ideal for traders looking to analyze trend strength and equilibrium points between buyers and sellers.
Components and Features
+DM and -DM: Indicators measuring positive and negative directional movement, helping identify trend direction.
DX (Directional Movement Index): Measures the relative difference between +DM and -DM, indicating the current trend strength.
ADX (Average Directional Index): A smoothed line showing trend strength regardless of direction. Values above 25 generally indicate a strong trend.
ADXR (Average Directional Movement Rating): A moving average of ADX that detects trend strength changes with less sensitivity.
Equilibrium Points: Visual markers (blue circles) that appear when +DM and -DM cross, signaling potential reversals or changes in trend strength.
Customizable Settings
DM Length: The period used to calculate directional movements.
ADX Smoothing: The smoothing period for ADX.
MA Type Universal: Select the moving average type used for smoothing calculations. Options include SMA, EMA, WMA, ALMA, T3, and advanced averages like DNA⚡ and RNA🐢.
T3 Hot Factor: Parameter to adjust the intensity of the T3 moving average (when selected).
Show Lines: Toggle the display of ADX, ADXR, DX, and +DM/-DM lines as you prefer.
Show Equilibrium Points: Enable to visualize crossing points between +DM and -DM.
Background Color and Offset: Customize the background color and offset for better visibility.
How to Use
Trend Identification
Watch the ADX line to gauge trend strength. When ADX is above 25, the trend is considered strong. The +DM and -DM lines indicate if the trend is bullish (+DM > -DM) or bearish (-DM > +DM).
Entry/Exit Signals
Use the equilibrium points (blue circles) to identify potential reversals or changes in trend dynamics based on +DM and -DM crossings.
Moving Average Selection
Experiment with different moving averages to smooth the data and tailor the indicator to your trading style and asset. Faster averages like EMA react better in volatile markets, while SMMA and ALMA suit more stable conditions.
Using ADXR
ADXR offers a smoother view of trend strength to avoid false signals during sideways markets.
Visual Customization
Adjust colors and background to improve readability, especially across different chart themes.
Recommendations
Combine DMI-Luminate with other indicators (e.g., volume, RSI, chart patterns) to confirm entries and exits.
Adjust DM Length and ADX Smoothing according to the timeframe you trade.
Use different moving average types to find the setup that works best for your asset and strategy.
Short Entry Setup - PL1!//@version=5
indicator("Short Signal - Platinum", overlay=true)
// === User Inputs ===
entryTop = input.float(1182.0, "Resistance Zone Top")
entryBottom = input.float(1178.0, "Resistance Zone Bottom")
rsiLevel = input.float(75.0, "RSI Overbought Level")
// === RSI Calculation ===
rsi = ta.rsi(close, 14)
rsiOverbought = rsi > rsiLevel
// === Price in Resistance Zone ===
priceInZone = close >= entryBottom and close <= entryTop
// === Bearish Candle Condition ===
bearishCandle = close < open
// === Final Short Signal Condition ===
shortSignal = priceInZone and bearishCandle and rsiOverbought
// === Plot Short Signal on Chart ===
plotshape(shortSignal, location=location.abovebar, style=shape.labeldown, color=color.red, size=size.small, text="SHORT")
// === Optional: Plot Background of Zone ===
bgcolor(priceInZone ? color.new(color.red, 90) : na, title="Resistance Zone")
// === Alert Condition for Automation ===
alertcondition(shortSignal, title="Short Signal Alert", message="SHORT SIGNAL: Price in resistance zone, RSI overbought, bearish candle.")
SUPER Signal Alert BY JAK"Buy or sell according to the signal that appears, but it should also be confirmed with other technical tools." FX:USDJPY FX:EURUSD OANDA:XAUUSD BITSTAMP:BTCUSD OANDA:GBPUSD OANDA:GBPJPY
Triple Moving Average Custom v2EMA SMA cross for better confirmation I personally using with Key Level.
WhalesDesk Indicator Whales Desk Indicator. Provide you buy and sell signal according to RSI, EMA AND MACD analysis.
Wavelet Filter with Adaptive Upsampling [BackQuant]Wavelet Filter with Adaptive Upsampling
The Wavelet Filter with Adaptive Upsampling is an advanced filtering and signal reconstruction tool designed to enhance the analysis of financial time series data. It combines wavelet transforms with adaptive upsampling techniques to filter and reconstruct price data, making it ideal for capturing subtle market movements and enhancing trend detection. This system uses high-pass and low-pass filters to decompose the price series into different frequency components, applying adaptive thresholding to eliminate noise and preserve relevant signal information.
Shout out to Loxx for the Least Squares fitting of trigonometric series and Quinn and Fernandes algorithm for finding frequency
www.tradingview.com
Key Features
1. Frequency Decomposition with High-Pass and Low-Pass Filters:
The indicator decomposes the input time series using high-pass and low-pass filters to separate the high-frequency (detail) and low-frequency (trend) components of the data. This decomposition allows for a more accurate analysis of underlying trends, while mitigating the impact of noise.
2. Soft Thresholding for Noise Reduction:
A soft thresholding function is applied to the high-frequency component, allowing for the reduction of noise while retaining significant market signals. This function adjusts the coefficients of the high-frequency data, removing small fluctuations and leaving only the essential price movements.
3. Adaptive Upsampling Process:
The upsampling process in this script can be customized using different methods: sinusoidal upsampling, advanced upsampling, and simple upsampling. Each method serves a unique purpose:
Sinusoidal Upsample uses a sine wave to interpolate between data points, providing a smooth transition.
Advanced Upsample utilizes a Quinn-Fernandes algorithm to estimate frequency and apply more sophisticated interpolation techniques, adapting to the market’s cyclical behavior.
Simple Upsample linearly interpolates between data points, providing a basic upsampling technique for less complex analysis.
4. Reconstruction of Filtered Signal:
The indicator reconstructs the filtered signal by summing the high and low-frequency components after upsampling. This allows for a detailed yet smooth representation of the original time series, which can be used for analyzing underlying trends in the market.
5. Visualization of Reconstructed Data:
The reconstructed series is plotted, showing how the upsampling and filtering process enhances the clarity of the price movements. Additionally, the script provides the option to visualize the log returns of the reconstructed series as a histogram, with positive returns shown in green and negative returns in red.
6. Cumulative Series and Trend Detection:
A cumulative series is plotted to visualize the compounded effect of the filtered and reconstructed data. This feature helps traders track the overall performance of the asset over time, identifying whether the asset is following a sustained upward or downward trend.
7. Adaptive Thresholding and Noise Estimation:
The system estimates the noise level in the high-frequency component and applies an adaptive thresholding process based on the standard deviation of the downsampled data. This ensures that only significant price movements are retained, further refining the trend analysis.
8. Customizable Parameters for Flexibility:
Users can customize the following parameters to adjust the behavior of the indicator:
Frequency and Phase Shift: Control the periodicity of the wavelet transformation and the phase of the upsampling function.
Upsample Factor: Adjust the level of interpolation applied during the upsampling process.
Smoothing Period: Determine the length of time used to smooth the signal, helping to filter out short-term fluctuations.
References
Enhancing Cross-Sectional Currency Strategies with Context-Aware Learning to Rank
arxiv.org
Daubechies Wavelet - Wikipedia
en.wikipedia.org
Quinn Fernandes Fourier Transform of Filtered Price by Loxx
Note on Usage for Mean-Reversion Strategy
This indicator is primarily designed for trend-following strategies. However, by taking the inverse of the signals, it can be adapted for mean-reversion strategies. This involves buying underperforming assets and selling outperforming ones. Caution: This method may not work effectively with highly correlated assets, as the price movements between correlated assets tend to mirror each other, limiting the effectiveness of mean-reversion strategies.
Final Thoughts
The Wavelet Filter with Adaptive Upsampling is a powerful tool for traders seeking to improve their understanding of market trends and noise. By using advanced wavelet decomposition and adaptive upsampling, this system offers a clearer, more refined picture of price movements, enhancing trend-following strategies. It’s particularly useful for detecting subtle shifts in market momentum and reconstructing price data in a way that removes noise, providing more accurate insights into market conditions.
BTC ETF Flows & Correlation with BTC Pricebtc etf flows and correlation with btc price, btc etf flows and correlation with btc price, btc etf flows and correlation with btc price, btc etf flows and correlation with btc price
Golden Key: Opening Channel DashboardGolden Key: Opening Channel Dashboard
Complementary to the original Golden Key – The Frequency
Upgrade of 10 Monday's 1H Avg Range + 30-Day Daily Range
This indicator provides a structured dashboard to monitor the opening channel range and related metrics on 15m and 5m charts. Built to work alongside the Golden Key methodology, it focuses on pip precision, average volatility, and SL sizing.
What It Does
Detects first 4 candles of the session:
15m chart → first 4 Monday candles (1 hour)
5m chart → first 4 candles of each day (20 minutes)
Calculates pip range of the opening move
Stores and averages the last 10 such ranges
Calculates daily range average over 10 or 30 days
Generates SL size based on your multiplier setting
Auto-adjusts for FX, JPY, and XAUUSD pip sizes
Displays all values in a clean table in the top-right
How to Use It
Add to a 15m or 5m chart
Compare the current opening range to the average
Use the daily average to assess broader volatility
Define SL size using the opening range x multiplier
Customize display colors per table row
About This Script
This is not a visual box-style indicator. It is designed to complement the original “Golden Key – The Frequency” by focusing on metric output. It is also an upgraded version of the earlier "10 Monday’s 1H Avg Range" script, now supporting multi-timeframe logic and additional customization.
Disclaimer
This is a technical analysis tool. It does not provide trading advice. Use it in combination with your own research and strategy.
Performance Metrics With Bracketed Rebalacing [BackQuant]Performance Metrics With Bracketed Rebalancing
The Performance Metrics With Bracketed Rebalancing script offers a robust method for assessing portfolio performance, integrating advanced portfolio metrics with different rebalancing strategies. With a focus on adaptability, the script allows traders to monitor and adjust portfolio weights, equity, and other key financial metrics dynamically. This script provides a versatile approach for evaluating different trading strategies, considering factors like risk-adjusted returns, volatility, and the impact of portfolio rebalancing.
Please take the time to read the following:
Key Features and Benefits of Portfolio Methods
Bracketed Rebalancing:
Bracketed Rebalancing is an advanced strategy designed to trigger portfolio adjustments when an asset's weight surpasses a predefined threshold. This approach minimizes overexposure to any single asset while maintaining flexibility in response to market changes. The strategy is particularly beneficial for mitigating risks that arise from significant asset weight fluctuations. The following image illustrates how this method reacts when asset weights cross the threshold:
Daily Rebalancing:
Unlike the bracketed method, Daily Rebalancing adjusts portfolio weights every trading day, ensuring consistent asset allocation. This method aims for a more even distribution of portfolio weights, making it a suitable option for traders who prefer less sensitivity to individual asset volatility. Here's an example of Daily Rebalancing in action:
No Rebalancing:
For traders who prefer a passive approach, the "No Rebalancing" option allows the portfolio to remain static, without any adjustments to asset weights. This method may appeal to long-term investors or those who believe in the inherent stability of their selected assets. Here’s how the portfolio looks when no rebalancing is applied:
Portfolio Weights Visualization:
One of the standout features of this script is the visual representation of portfolio weights. With adjustable settings, users can track the current allocation of assets in real-time, making it easier to analyze shifts and trends. The following image shows the real-time weight distribution across three assets:
Rolling Drawdown Plot:
Managing drawdown risk is a critical aspect of portfolio management. The Rolling Drawdown Plot visually tracks the drawdown over time, helping traders monitor the risk exposure and performance relative to the peak equity levels. This feature is essential for assessing the portfolio's resilience during market downturns:
Daily Portfolio Returns:
Tracking daily returns is crucial for evaluating the short-term performance of the portfolio. The script allows users to plot daily portfolio returns to gain insights into daily profit or loss, helping traders stay updated on their portfolio’s progress:
Performance Metrics
Net Profit (%):
This metric represents the total return on investment as a percentage of the initial capital. A positive net profit indicates that the portfolio has gained value over the evaluation period, while a negative value suggests a loss. It's a fundamental indicator of overall portfolio performance.
Maximum Drawdown (Max DD):
Maximum Drawdown measures the largest peak-to-trough decline in portfolio value during a specified period. It quantifies the most significant loss an investor would have experienced if they had invested at the highest point and sold at the lowest point within the timeframe. A smaller Max DD indicates better risk management and less exposure to significant losses.
Annual Mean Returns (% p/y):
This metric calculates the average annual return of the portfolio over the evaluation period. It provides insight into the portfolio's ability to generate returns on an annual basis, aiding in performance comparison with other investment opportunities.
Annual Standard Deviation of Returns (% p/y):
This measure indicates the volatility of the portfolio's returns on an annual basis. A higher standard deviation signifies greater variability in returns, implying higher risk, while a lower value suggests more stable returns.
Variance:
Variance is the square of the standard deviation and provides a measure of the dispersion of returns. It helps in understanding the degree of risk associated with the portfolio's returns.
Sortino Ratio:
The Sortino Ratio is a variation of the Sharpe Ratio that only considers downside risk, focusing on negative volatility. It is calculated as the difference between the portfolio's return and the minimum acceptable return (MAR), divided by the downside deviation. A higher Sortino Ratio indicates better risk-adjusted performance, emphasizing the importance of avoiding negative returns.
Sharpe Ratio:
The Sharpe Ratio measures the portfolio's excess return per unit of total risk, as represented by standard deviation. It is calculated by subtracting the risk-free rate from the portfolio's return and dividing by the standard deviation of the portfolio's excess return. A higher Sharpe Ratio indicates more favorable risk-adjusted returns.
Omega Ratio:
The Omega Ratio evaluates the probability of achieving returns above a certain threshold relative to the probability of experiencing returns below that threshold. It is calculated by dividing the cumulative probability of positive returns by the cumulative probability of negative returns. An Omega Ratio greater than 1 indicates a higher likelihood of achieving favorable returns.
Gain-to-Pain Ratio:
The Gain-to-Pain Ratio measures the return per unit of risk, focusing on the magnitude of gains relative to the severity of losses. It is calculated by dividing the total gains by the total losses experienced during the evaluation period. A higher ratio suggests a more favorable balance between reward and risk.
www.linkedin.com
Compound Annual Growth Rate (CAGR) (% p/y):
CAGR represents the mean annual growth rate of the portfolio over a specified period, assuming the investment has been compounding over that time. It provides a smoothed annual rate of growth, eliminating the effects of volatility and offering a clearer picture of long-term performance.
Portfolio Alpha (% p/y):
Portfolio Alpha measures the portfolio's performance relative to a benchmark index, adjusting for risk. It is calculated using the Capital Asset Pricing Model (CAPM) and represents the excess return of the portfolio over the expected return based on its beta and the benchmark's performance. A positive alpha indicates outperformance, while a negative alpha suggests underperformance.
Portfolio Beta:
Portfolio Beta assesses the portfolio's sensitivity to market movements, indicating its exposure to systematic risk. A beta greater than 1 suggests the portfolio is more volatile than the market, while a beta less than 1 indicates lower volatility. Beta is used to understand the portfolio's potential for gains or losses in relation to market fluctuations.
Skewness of Returns:
Skewness measures the asymmetry of the return distribution. A positive skew indicates a distribution with a long right tail, suggesting more frequent small losses and fewer large gains. A negative skew indicates a long left tail, implying more frequent small gains and fewer large losses. Understanding skewness helps in assessing the likelihood of extreme outcomes.
Value at Risk (VaR) 95th Percentile:
VaR at the 95th percentile estimates the maximum potential loss over a specified period, given a 95% confidence level. It provides a threshold value such that there is a 95% probability that the portfolio will not experience a loss greater than this amount.
Conditional Value at Risk (CVaR):
CVaR, also known as Expected Shortfall, measures the average loss exceeding the VaR threshold. It provides insight into the tail risk of the portfolio, indicating the expected loss in the worst-case scenarios beyond the VaR level.
These metrics collectively offer a comprehensive view of the portfolio's performance, risk exposure, and efficiency. By analyzing these indicators, investors can make informed decisions, balancing potential returns with acceptable levels of risk.
Conclusion
The Performance Metrics With Bracketed Rebalancing script provides a comprehensive framework for evaluating and optimizing portfolio performance. By integrating advanced metrics, adaptive rebalancing strategies, and visual analytics, it empowers traders to make informed decisions in managing their investment portfolios. However, it's crucial to consider the implications of rebalancing strategies, as academic research indicates that predictable rebalancing can lead to market impact costs. Therefore, adopting flexible and less predictable rebalancing approaches may enhance portfolio performance and reduce associated costs.
Choppiness ZONE OverlayPurpose
This script overlays choppiness zones directly onto the price chart to help traders identify whether the market is trending or ranging. It is designed to filter out low-probability trades during high choppiness conditions.
How It Works
Calculates the Choppiness Index over a user-defined period using ATR and price range.
Divides choppiness into four zones:
30 to 40: Low choppiness, possible trend initiation, shown in yellow.
40 to 50: Moderate choppiness, transition zone, shown in orange.
50 to 60: High choppiness, weakening momentum, shown in red.
60 and above: Extreme choppiness, avoid trading, shown in purple.
Highlights each zone with customizable color fills between the high and low of the selected range.
Triggers a real-time alert when choppiness exceeds 60.
Features
Customizable choppiness zones and color settings.
Real-time alert when market becomes extremely choppy (choppiness ≥ 60).
Visual zone overlay on the price chart.
Compatible with all timeframes.
Lightweight and responsive for scalping, intraday, or swing trading.
Tip
Use this tool as a volatility or trend filter. Combine it with momentum or trend-following indicators to improve trade selection.
SMA Trend BoxCalculates trend base on a short SMA and a long SMA and displays a text box with result on right-side of canvas.
Helpful when trading on intraday timeframes but you want to know what the bigger-picture trend is (i.e. if you always want to trade in the direction of primary trend).
JK's Inside DayEvaluates today’s candle only after it's closed
Keeps screener alignment and alerting accurate for daily after-hours workflows
CCO_LibraryLibrary "CCO_Library"
Contrarian Crowd Oscillator (CCO) Library - Multi-oscillator consensus indicator for contrarian trading signals
@author B3AR_Trades
calculate_oscillators(rsi_length, stoch_length, cci_length, williams_length, roc_length, mfi_length, percentile_lookback, use_rsi, use_stochastic, use_williams, use_cci, use_roc, use_mfi)
Calculate normalized oscillator values
Parameters:
rsi_length (simple int) : (int) RSI calculation period
stoch_length (int) : (int) Stochastic calculation period
cci_length (int) : (int) CCI calculation period
williams_length (int) : (int) Williams %R calculation period
roc_length (int) : (int) ROC calculation period
mfi_length (int) : (int) MFI calculation period
percentile_lookback (int) : (int) Lookback period for CCI/ROC percentile ranking
use_rsi (bool) : (bool) Include RSI in calculations
use_stochastic (bool) : (bool) Include Stochastic in calculations
use_williams (bool) : (bool) Include Williams %R in calculations
use_cci (bool) : (bool) Include CCI in calculations
use_roc (bool) : (bool) Include ROC in calculations
use_mfi (bool) : (bool) Include MFI in calculations
Returns: (OscillatorValues) Normalized oscillator values
calculate_consensus_score(oscillators, use_rsi, use_stochastic, use_williams, use_cci, use_roc, use_mfi, weight_by_reliability, consensus_smoothing)
Calculate weighted consensus score
Parameters:
oscillators (OscillatorValues) : (OscillatorValues) Individual oscillator values
use_rsi (bool) : (bool) Include RSI in consensus
use_stochastic (bool) : (bool) Include Stochastic in consensus
use_williams (bool) : (bool) Include Williams %R in consensus
use_cci (bool) : (bool) Include CCI in consensus
use_roc (bool) : (bool) Include ROC in consensus
use_mfi (bool) : (bool) Include MFI in consensus
weight_by_reliability (bool) : (bool) Apply reliability-based weights
consensus_smoothing (int) : (int) Smoothing period for consensus
Returns: (float) Weighted consensus score (0-100)
calculate_consensus_strength(oscillators, consensus_score, use_rsi, use_stochastic, use_williams, use_cci, use_roc, use_mfi)
Calculate consensus strength (agreement between oscillators)
Parameters:
oscillators (OscillatorValues) : (OscillatorValues) Individual oscillator values
consensus_score (float) : (float) Current consensus score
use_rsi (bool) : (bool) Include RSI in strength calculation
use_stochastic (bool) : (bool) Include Stochastic in strength calculation
use_williams (bool) : (bool) Include Williams %R in strength calculation
use_cci (bool) : (bool) Include CCI in strength calculation
use_roc (bool) : (bool) Include ROC in strength calculation
use_mfi (bool) : (bool) Include MFI in strength calculation
Returns: (float) Consensus strength (0-100)
classify_regime(consensus_score)
Classify consensus regime
Parameters:
consensus_score (float) : (float) Current consensus score
Returns: (ConsensusRegime) Regime classification
detect_signals(consensus_score, consensus_strength, consensus_momentum, regime)
Detect trading signals
Parameters:
consensus_score (float) : (float) Current consensus score
consensus_strength (float) : (float) Current consensus strength
consensus_momentum (float) : (float) Consensus momentum
regime (ConsensusRegime) : (ConsensusRegime) Current regime classification
Returns: (TradingSignals) Trading signal conditions
calculate_cco(rsi_length, stoch_length, cci_length, williams_length, roc_length, mfi_length, consensus_smoothing, percentile_lookback, use_rsi, use_stochastic, use_williams, use_cci, use_roc, use_mfi, weight_by_reliability, detect_momentum)
Calculate complete CCO analysis
Parameters:
rsi_length (simple int) : (int) RSI calculation period
stoch_length (int) : (int) Stochastic calculation period
cci_length (int) : (int) CCI calculation period
williams_length (int) : (int) Williams %R calculation period
roc_length (int) : (int) ROC calculation period
mfi_length (int) : (int) MFI calculation period
consensus_smoothing (int) : (int) Consensus smoothing period
percentile_lookback (int) : (int) Percentile ranking lookback
use_rsi (bool) : (bool) Include RSI
use_stochastic (bool) : (bool) Include Stochastic
use_williams (bool) : (bool) Include Williams %R
use_cci (bool) : (bool) Include CCI
use_roc (bool) : (bool) Include ROC
use_mfi (bool) : (bool) Include MFI
weight_by_reliability (bool) : (bool) Apply reliability weights
detect_momentum (bool) : (bool) Calculate momentum and acceleration
Returns: (CCOResult) Complete CCO analysis results
calculate_cco_default()
Calculate CCO with default parameters
Returns: (CCOResult) CCO result with standard settings
cco_consensus_score()
Get just the consensus score with default parameters
Returns: (float) Consensus score (0-100)
cco_consensus_strength()
Get just the consensus strength with default parameters
Returns: (float) Consensus strength (0-100)
is_panic_bottom()
Check if in panic bottom condition
Returns: (bool) True if panic bottom signal active
is_euphoric_top()
Check if in euphoric top condition
Returns: (bool) True if euphoric top signal active
bullish_consensus_reversal()
Check for bullish consensus reversal
Returns: (bool) True if bullish reversal detected
bearish_consensus_reversal()
Check for bearish consensus reversal
Returns: (bool) True if bearish reversal detected
bearish_divergence()
Check for bearish divergence
Returns: (bool) True if bearish divergence detected
bullish_divergence()
Check for bullish divergence
Returns: (bool) True if bullish divergence detected
get_regime_name()
Get current regime name
Returns: (string) Current consensus regime name
get_contrarian_signal()
Get contrarian signal
Returns: (string) Current contrarian trading signal
get_position_multiplier()
Get position size multiplier
Returns: (float) Recommended position sizing multiplier
OscillatorValues
Individual oscillator values
Fields:
rsi (series float) : RSI value (0-100)
stochastic (series float) : Stochastic value (0-100)
williams (series float) : Williams %R value (0-100, normalized)
cci (series float) : CCI percentile value (0-100)
roc (series float) : ROC percentile value (0-100)
mfi (series float) : Money Flow Index value (0-100)
ConsensusRegime
Consensus regime classification
Fields:
extreme_bearish (series bool) : Extreme bearish consensus (<= 20)
moderate_bearish (series bool) : Moderate bearish consensus (20-40)
mixed (series bool) : Mixed consensus (40-60)
moderate_bullish (series bool) : Moderate bullish consensus (60-80)
extreme_bullish (series bool) : Extreme bullish consensus (>= 80)
regime_name (series string) : Text description of current regime
contrarian_signal (series string) : Contrarian trading signal
TradingSignals
Trading signals
Fields:
panic_bottom_signal (series bool) : Extreme bearish consensus with high strength
euphoric_top_signal (series bool) : Extreme bullish consensus with high strength
consensus_reversal_bullish (series bool) : Bullish consensus reversal
consensus_reversal_bearish (series bool) : Bearish consensus reversal
bearish_divergence (series bool) : Bearish price-consensus divergence
bullish_divergence (series bool) : Bullish price-consensus divergence
strong_consensus (series bool) : High consensus strength signal
CCOResult
Complete CCO calculation results
Fields:
consensus_score (series float) : Main consensus score (0-100)
consensus_strength (series float) : Consensus strength (0-100)
consensus_momentum (series float) : Rate of consensus change
consensus_acceleration (series float) : Rate of momentum change
oscillators (OscillatorValues) : Individual oscillator values
regime (ConsensusRegime) : Regime classification
signals (TradingSignals) : Trading signals
position_multiplier (series float) : Recommended position sizing multiplier