Oscilador de Sentimiento PROUser Manual: Indicator "Dinámicas de Mercado Pro" (DMP)
Author: @Profit_Quant
Created by: Gemini AI (2025)
User Manual (English):RSI Sentiment Oscillator PRO
1. General Concept
The "RSI Sentiment Oscillator PRO" is an advanced RSI-type indicator designed to measure the momentum and strength of market sentiment. Unlike a simple line oscillator, this indicator uses a dynamic-width band that visually expands and contracts with the intensity of the sentiment. Its most powerful feature is the automatic detection of four types of divergences, which are key signals for identifying potential trend reversals or continuations.
2. Main Components and Their Interpretation
a) The Oscillator Band (Dynamic Width)
What it is: The main representation of the indicator. It's not just a line, but a filled band.
Dynamic Width: This is its unique feature. The band widens as sentiment becomes more extreme (near overbought at 100 or oversold at 0) and narrows near the neutral zone (50). This gives you an immediate visual sense of the "pressure" or "strength" of the current sentiment.
Band Colors:
Green: The oscillator is in the oversold zone (below 30). Sentiment is extremely bearish, which could precede a bounce.
Red: The oscillator is in the overbought zone (above 70). Sentiment is extremely bullish, which could precede a correction.
Blue: The oscillator is in a neutral zone.
b) Divergence Detection (Key Signals)
Divergences occur when the price and the oscillator move in opposite directions. They are among the most powerful signals in technical analysis.
Regular Divergences (Trend Reversal Signals)
Regular Bullish Divergence (Green):
What to look for: The price makes a lower low, but the oscillator makes a higher low.
Meaning: The price is still falling, but the momentum of the fall is exhausting. It's a potential signal that the downtrend is ending and could reverse to the upside.
Label: Bull Div
Regular Bearish Divergence (Red):
What to look for: The price makes a higher high, but the oscillator makes a lower high.
Meaning: The price is still rising, but the momentum of the rise is weakening. It's a potential signal that the uptrend is losing steam and could reverse to the downside.
Label: Bear Div
Hidden Divergences (Trend Continuation Signals)
Hidden Bullish Divergence (Yellow):
What to look for: The price makes a higher low (a pullback in an uptrend), but the oscillator makes a lower low.
Meaning: The current pullback is a "buy the dip" opportunity to join the main uptrend. It indicates that the uptrend is likely to continue.
Label: Bull Hid
Hidden Bearish Divergence (Orange):
What to look for: The price makes a lower high (a rally in a downtrend), but the oscillator makes a higher high.
Meaning: The current rally is a "sell the rally" opportunity to join the main downtrend. It indicates that the downtrend is likely to continue.
Label: Bear Hid
3. Trading Strategies
Reversal Trading: Use Regular Divergences as your primary signal. A green Bull Div in the oversold zone is a powerful buy signal. A red Bear Div in the overbought zone is a powerful sell signal.
Continuation Trading: Use Hidden Divergences to enter in the direction of the trend. A yellow Bull Hid during a pullback in an uptrend confirms that it's a good time to buy.
Volume Filter: By default, the indicator requires the volume on the second pivot of a regular divergence to be lower. This increases the reliability of the signal, as it confirms the "loss of conviction" in the price move.
4. Final Disclaimer
Divergences are high-probability signals, not certainties. Always use this indicator in confluence with your own analysis of market structure, support, resistance, and strict risk management.
es.tradingview.com
Pine utilities
Dinámicas de Mercado ProUser Manual: Indicator "Dinámicas de Mercado Pro" (DMP)
Author: @Profit_Quant
Created by: Gemini AI (2025)
1. General Concept
The "Dinámicas de Mercado Pro" indicator is an all-in-one technical analysis tool designed to be overlaid directly onto your price chart. Its goal is to provide a clear and concise view of the market structure by combining three crucial trading elements:
The Overall Trend: What is the main direction of the market?
Liquidity Zones: Where is the price likely to react (supports and resistances)?
Breakout Momentum: When is the price breaking out of a range with force and volume?
By integrating these components, the DMP helps you make more informed trading decisions by identifying high-probability zones for entering or exiting trades.
2. Essential Step! - Initial Chart Setup
For the indicator to work as designed, it is essential to hide the original candles of the TradingView chart.
The indicator already draws its own candles with the market sentiment colors. If you do not hide the original ones, you will see both sets of candles overlapping, which will make the chart confusing and unreadable.
How to hide the chart's candles?
There are two simple ways:
Method 1 (Recommended):
Once you have the "DMP" indicator on your chart, look for the symbol's name in the top-left corner of your screen (e.g., BTCUSD, EURUSD, etc.).
Right next to the name, you will see an eye icon (👁️).
Click that eye icon to hide the main symbol (the original candles, bars, or lines). The chart will become clean, showing only the candles drawn by the DMP indicator.
Method 2 (Alternative):
Click the gear icon (⚙️) for the chart settings.
Go to the "Symbol" tab.
Uncheck the boxes for "Body," "Borders," and "Wicks," or set their opacity to 0%.
3. Main Components and Their Interpretation
The indicator has 3 key visual components you need to understand.
a) Supply and Demand Zones (Order Blocks)
These are the colored rectangles drawn automatically on the chart.
What are they?: They represent zones where there was a strong imbalance between buyers and sellers, often caused by the activity of large institutions.
Demand Zone (Blue Rectangle): A potential support zone. When the price returns to this area, buying pressure is expected to increase, pushing the price up.
Supply Zone (Red Rectangle): A potential resistance zone. When the price reaches this area, selling pressure is expected to increase, pushing the price down.
Mitigated Zone (Gray Rectangle): When the price touches a supply or demand zone, it becomes "mitigated," meaning the liquidity in that zone has already been used. The zone turns gray to indicate that it is less reliable and the price is more likely to break through it in the future.
b) Candle Coloring (Market Sentiment)
The chart candles will change color based on a priority system to give you an instant read of market sentiment.
Green Candles (Uptrend): Indicate that the price is above the long-term Exponential Moving Average (EMA) (200 by default). This suggests the overall trend is bullish, and you should look for buying opportunities.
Red Candles (Downtrend): Indicate that the price is below the 200 EMA. This suggests the overall trend is bearish, and you should look for selling opportunities.
White Candles (Bullish Breakout): Alert! This occurs when the price breaks a recent range high AND is accompanied by above-average volume. It's a strong sign of bullish momentum.
Purple Candles (Bearish Breakout): Alert! This occurs when the price breaks a recent range low with high volume. It's a strong sign of bearish momentum.
Gray Candles (Neutral): Appear when the price is very close to the 200 EMA, indicating indecision or consolidation in the market. This is a time for caution.
c) Probability Paths (Price Targets)
These are the dashed lines projected from the last real-time candle.
Demand Path (Blue Dashed Line): Points from the current price to the center of the nearest unmitigated demand zone. It acts as a potential support target.
Supply Path (Red Dashed Line): Points from the current price to the center of the nearest unmitigated supply zone. It acts as a potential resistance target.
4. Basic Trading Strategies
Confluence Strategy: Look for buying opportunities when the price pulls back to a blue demand zone while the candles are green (uptrend). Look for selling opportunities when the price rallies to a red supply zone with red candles (downtrend).
Breakout Strategy: Use the white or purple candles as an aggressive entry signal in the direction of the breakout. The stop-loss could be placed on the other side of the breakout candle.
Range Strategy: When the price is trapped between a clear supply and demand zone (with no breakout candles), you can trade the bounces between them until one zone is broken with a white or purple candle, signaling the end of the range.
5. Indicator Settings (Parameters)
You can customize every aspect of the indicator in its settings panel (the options are self-explanatory in the indicator's menu).
Custom Stochastic with Entry Dots & BackgroundCustom Stochastic with Entry Dots & Background
จะแสดงค่าเมื่อ STOCH OVB OVS ให้แห็นง่ายและชัดเจนขึ้น
150 EMA Crossover with Confirmation Candle//@version=5
indicator("150 EMA Crossover with Confirmation Candle", overlay=true)
// Define EMAs
ema9 = ta.ema(close, 9)
ema150 = ta.ema(close, 150)
// Conditions
bullishCandle = close > open
bearishCandle = close < open
emaCrossUp = ta.crossover(ema9, ema150)
emaCrossDown = ta.crossunder(ema9, ema150)
// Buy Signal
buySignal = emaCrossUp and bullishCandle and close >= ema9
// Sell Signal
sellSignal = emaCrossDown and bearishCandle and close <= ema9
// Plot EMAs
plot(ema9, color=color.orange, title="EMA 9")
plot(ema150, color=color.blue, title="EMA 150")
// Plot signals
plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.arrowup, size=size.small)
plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.arrowdown, size=size.small)
Dual HalfTrendThis is a trend indicator.
There are two trends in this. One is a major trend, and the other is a minor trend. We take trades in the minor trend that aligns with the major trend.
The trading strategy involved here is a crossover.
We take this trade when the major trend breaks the minor trend. You can backtest this and only take the trade if necessary. This works on high-volume pairs like Gold and US30.
"ULAK" YH-Pro | Gelişmiş Skorlama This code is constantly being updated.
The total score is calculated by scoring different indicators.
EMA 9/45 Cross with Volume FilterThis script will plot the two EMAs on your chart. When a bullish cross (9-day EMA crosses above 45-day EMA) or a bearish cross (9-day EMA crosses below 45-day EMA) occurs with a daily volume greater than 1 million, it will display a corresponding "Buy Signal" or "Sell Signal" arrow.
Trading SessionsWhat's New:
Current Session Highlight:
The indicator now displays a visible frame or highlight for the active trading session. This real-time visual cue makes it easier to focus on the current market dynamics and quickly assess intraday price behavior within the ongoing session.
This enhancement is particularly useful for active traders who want to stay oriented during live trading hours, offering improved clarity and faster decision-making.
Trading SessionsThis indicator is designed to visually separate and highlight different trading sessions (such as Asian, European, and New York sessions) directly on your TradingView chart. By adding vertical lines or shaded background zones, it helps traders quickly identify session boundaries, enabling better analysis of market behavior during specific times of the day.
Key Features:
Clear visual division between trading sessions
Customizable session time ranges
Optional color coding for each session
Supports multiple timeframes
Purpose:
The primary goal of this indicator is to provide a clear distinction between global trading sessions. This allows traders to:
Recognize session overlaps where volatility tends to spike
Analyze session-specific price action patterns
Strategically align entries and exits with active trading periods
Ideal for day traders and scalpers who rely on time-sensitive strategies, this tool adds clarity and context to intraday charts.
Trend Compass – Multi-Layer Momentum Map for CryptoVisualize three popular momentum tools in one view: RSI, MACD Histogram, and Stochastic.
Built for crypto traders on the daily timeframe, beginner-friendly but insightful for pros .
No signals or alerts—just a clean, visual momentum map to guide your market feel.
🧠 Logic
This script combines three widely-used momentum indicators (RSI, MACD Histogram, and Stochastic) into one unified layout.
It offers a non-signaling, educational view to help traders understand market momentum at a glance.
There are no buy/sell triggers—just raw data visualization for personal interpretation.
⏱️ Timeframe
Optimized for the daily (1D) timeframe.
Use on lower timeframes is technically possible but may reduce effectiveness.
Best when combined with higher-timeframe analysis for trend confirmation.
⚙️ Settings
Fully adjustable inputs are provided for all three indicators:
RSI Length
MACD Fast / Slow / Signal
Stochastic %K / %D / SmoothK
This allows you to match the script to your own trading style and preference.
🧩 Utility
A blended display of momentum behavior from three sources:
RSI shows strength relative to recent price action
MACD Histogram reveals trend acceleration or weakening
Stochastic helps identify local turning points
Together, they form a layered visual "map" of market rhythm.
⚠️ Warnings
This tool provides no alerts, signals, or trade advice.
It is not intended for automated or rule-based trading.
Educational use only—aimed primarily at helping newer traders understand momentum dynamics.
🖼 Visual Explanation
The most critical visual in this tool is the orange histogram, which appears as soon as you run the script.
These bars represent the difference between MACD and its Signal line—known as the MACD Histogram.
Interpretation:
Bars above zero and rising = bullish momentum increasing
Bars below zero and falling = bearish pressure gaining strength
When crossing zero = possible momentum shift
✳️ This helps you instantly recognize the current strength and direction of market momentum without decoding multiple charts.
✨ Need a little love !
We put so much love and time into bringing you useful content & your support truly keeps us going. don’t be shy—drop a comment below. We’d love to hear from you! 💛
Big thanks,
Mad Whale 🐋
📜 Please remember to do your own research before making any investment decisions. Also, don’t forget to check the disclaimer at the bottom of each post for more details.
Golden Crossover Momentum Check📊 Golden Cross Momentum Screener — Summary
🔍 What It Does
This indicator identifies Golden Cross events — where the 50 EMA crosses above the 200 EMA, signaling a potential long-term trend reversal — and evaluates the momentum strength to help determine whether price is likely to:
Surge immediately (Group B), or
Retrace first (Group A)
It uses 5 momentum-confirming conditions to score the quality of the breakout and display a single label on the chart with a classification.
✅ Momentum Conditions Validated
RSI > 60 and rising – Indicates bullish buying pressure
MACD Histogram > 0 and rising – Confirms increasing momentum
Volume > 2× 20-day average – Validates participation on the breakout
ADX > 25 – Measures trend strength
Price is >5% above 200 EMA – Confirms price extension above long-term trend
Each passing condition adds 1 point to the momentum score (0–5).
📈 How to Use
Watch for a Golden Cross signal (triangle appears below candle)
If momentum score ≥ 4, the script labels the setup as:
"🚀 Surge Likely (Group B)" — consider immediate breakout entries
If score is 2–3, labeled:
"🔄 Pullback Likely (Group A)" — expect retest/consolidation before continuation
If score < 2, labeled:
"❌ No Momentum Confirmed" — avoid or wait for confirmation
Adam Grimes Modified MACD (3/10 SMA)Modified MACD (used by Adam Grimes):
- Use SMA's instead of EMA's
- 3/10 for the MACD
- 16 for the signal line
- No histogram
TrendWay Strategy📈 TrendWay Strategy – Smart Trend Following Algorithm
The TrendWay Strategy is a powerful trend-following algorithm designed for traders who aim to capture sustained market movements with clarity and precision. Built on the principle of combining volatility with trend strength, this strategy utilizes the Average True Range (ATR) and dynamic support/resistance levels to generate high-probability buy and sell signals.
🔍 Key Features:
ATR-Based Volatility Filter: Adjusts sensitivity based on market volatility using customizable ATR periods and multipliers.
Dynamic Trend Lines: Adapts trailing stop levels based on price action, helping to stay in trends longer and reduce false signals.
Clear Entry/Exit Signals: Visual Buy (🔼) and Sell (🔽) markers provide intuitive decision-making on the chart.
Signal Highlighting Option: Easily switch between visual trend highlighting or a clean chart view.
⚙️ Parameters:
ATR Period (default: 10)
ATR Multiplier (default: 3.0)
Source (e.g., hl2)
Option to toggle ATR method (SMA or standard)
Optional signal markers and trend coloring
✅ Suitable For:
Swing traders and intraday traders
Crypto, forex, and stock markets
Traders looking for a reliable way to trail trends and exit on reversal signals
Note: Like all strategies, TrendWay should be used in conjunction with sound risk management and market awareness. Always backtest and forward-test before using with live capital.
Events assistantThis script gives an ability to manually add events to your charts. There is no option to define events for different pairs. I trade only 2-3 pairs and it helps me a lot. It also draws vertical lines that separate trading period of your selection: daily, weekly and monthly. It is also possible to strictly define trading period. I use trading period every time during backtesting so it is easy to know when to start and when to finish. It also helps to remember that I already written down trading news during selected period.
Cryptocurrency Fibonacci SignalCryptocurrency Fibonacci Signal by Kriptomist
Description:
This indicator provides smart Buy and Sell signals based on Fibonacci retracement levels, specifically tailored for the high-volatility nature of cryptocurrency markets.
It automatically detects key Fibonacci levels (0.236, 0.382, 0.5, 0.618, 0.786) and generates entry/exit signals when price action confirms reversal or breakout behavior around those zones.
Core Features:
🔹 Auto Fibonacci Detection
No need to draw manually — the indicator adapts to recent swing highs and lows and adjusts levels dynamically.
🔹 Buy/Sell Signals
Smart logic to detect reversal candlesticks and momentum confirmation near Fibonacci levels.
🔹 Multi-Timeframe Compatible
Works seamlessly on all timeframes (scalp to daily) and with all crypto assets including BTC, ETH, and altcoins.
🔹 Signal Alerts Ready
You can set up TradingView alerts for buy/sell signals for 24/7 monitoring.
🔹 Clean Visuals
Minimalist design with colored signals and level lines for clear decision-making.
Use Cases:
Identify low-risk entry points during pullbacks
Ride breakouts from key Fibonacci levels
Spot reversals on high-probability retracement zones
Combine with RSI, MACD, or EMAs for confluence strategies
How it works:
The script identifies the latest swing high and low
Plots Fibonacci levels accordingly
Generates Buy signals on bullish confirmation near 0.5/0.618 retracement
Generates Sell signals near resistance zones or on trend exhaustion
⚠️ Always backtest before live trading. This tool is for educational and analytical purposes.
For access to PRO settings, private signal groups, or one-on-one setup support, contact the script author.
NY opennew york open.
new york open hours of the past two weeks up until two days ahead are shown as vertical lines which is great for both analyzing past data and seeing where would future new york open align with compared to your own future analysis.
RSI MACD EMA Strategy with SL (Higher Frequency)Mad with AI. Still Tweaking. If you can find the best settings let me know. Works great though!!!
Sticky Notes📌 Sticky Notes - On-Chart Memo Tool
A convenient indicator that lets you display trading ideas and important notes directly on your charts!
✨ Key Features:
📝 Create memos with custom text input
📍 Place anywhere on chart (top/middle/bottom)
🖥️ Screen-fixed display mode (corner positions)
🎨 Fully customizable text and background colors
📏 5 text size options (tiny to huge)
⏰ Time-based display functionality
📐 Text alignment options (left/center/right)
💡 Use Cases:
Trading strategy reminders
Important price level notes
Economic event schedules
Entry/exit point memos
Simple and user-friendly design to enhance your trading 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.
40 Ticker Cross-Sectional Z-Scores [BackQuant]40 Ticker Cross-Sectional Z-Scores
BackQuant’s 40 Ticker Cross-Sectional Z-Scores is a powerful portfolio management strategy that analyzes the relative performance of up to 40 different assets, comparing them on a cross-sectional basis to identify the top and bottom performers. This indicator computes Z-scores for each asset based on their log returns and evaluates them relative to the mean and standard deviation over a rolling window. The Z-scores represent how far an asset's return deviates from the average, and these values are used to rank the assets, allowing for dynamic asset allocation based on performance.
By focusing on the strongest-performing assets and avoiding the weakest, this strategy aims to enhance returns while managing risk. Additionally, by adjusting for standard deviations, the system offers a risk-adjusted method of ranking assets, making it suitable for traders who want to dynamically allocate capital based on performance metrics rather than just price movements.
Key Features
1. Cross-Sectional Z-Score Calculation:
The system calculates Z-scores for 40 different assets, evaluating their log returns against the mean and standard deviation over a rolling window. This enables users to assess the relative performance of each asset dynamically, highlighting which assets are performing better or worse compared to their historical norms. The Z-score is a useful statistical tool for identifying outliers in asset performance.
2. Asset Ranking and Allocation:
The system ranks assets based on their Z-scores and allocates capital to the top performers. It identifies the top and bottom assets, and traders can allocate capital to the top-performing assets, ensuring that their portfolio is aligned with the best performers. Conversely, the bottom assets are removed from the portfolio, reducing exposure to underperforming assets.
3. Rolling Window for Mean and Standard Deviation Calculations:
The Z-scores are calculated based on rolling means and standard deviations, making the system adaptive to changing market conditions. This rolling calculation window allows the strategy to adjust to recent performance trends and minimize the impact of outdated data.
4. Mean and Standard Deviation Visualization:
The script provides real-time visualizations of the mean (x̄) and standard deviation (σ) of asset returns, helping traders quickly identify trends and volatility in their portfolio. These visual indicators are useful for understanding the current market environment and making more informed allocation decisions.
5. Top & Bottom Performer Tables:
The system generates tables that display the top and bottom performers, ranked by their Z-scores. Traders can quickly see which assets are outperforming and underperforming. These tables provide clear and actionable insights, helping traders make informed decisions about which assets to include in their portfolio.
6. Customizable Parameters:
The strategy allows traders to customize several key parameters, including:
Rolling Calculation Window: Set the window size for the rolling mean and standard deviation calculations.
Top & Bottom Tickers: Choose how many of the top and bottom assets to display and allocate capital to.
Table Orientation: Select between vertical or horizontal table formats to suit the user’s preference.
7. Forward Test & Out-of-Sample Testing:
The system includes out-of-sample forward tests, ensuring that the strategy is evaluated based on real-time performance, not just historical data. This forward testing approach helps validate the robustness of the strategy in dynamic market conditions.
8. Visual Feedback and Alerts:
The system provides visual feedback on the current asset rankings and allocations, with dynamic labels and plots on the chart. Additionally, users receive alerts when allocations change, keeping them informed of important adjustments.
9. Risk Management via Z-Scores and Std Dev:
The system’s approach to asset selection is based on Z-scores, which normalize performance relative to the historical mean. By incorporating standard deviation, it accounts for the volatility and risk associated with each asset. This allows for more precise risk management and portfolio construction.
10. Note on Mean Reversion Strategy:
If you take the inverse of the signals provided by this indicator, the strategy can be used for mean-reversion rather than trend-following. This would involve buying the underperforming assets and selling the outperforming ones. However, it's important to note that this approach does not work well with highly correlated assets, as the relationship between the assets could result in the same directional movement, undermining the effectiveness of the mean-reversion strategy.
References
www.uts.edu.au
onlinelibrary.wiley.com
www.cmegroup.com
Final Thoughts
The 40 Ticker Cross-Sectional Z-Scores strategy offers a data-driven approach to portfolio management, dynamically allocating capital based on the relative performance of assets. By using Z-scores and standard deviations, this strategy ensures that capital is directed to the strongest performers while avoiding weaker assets, ultimately improving the risk-adjusted returns of the portfolio. Whether you’re focused on trend-following or looking to explore mean-reversion strategies, this flexible system can be tailored to suit your investment goals.
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.
Watchlist AlertThis “Watchlist Alert” indicator is to help traders monitor multiple symbols and notify them whenever a specified target price is reached. Upon loading the script, you can define up to ten ticker symbols along with their individual price targets. The script stores these pairs in a persistent map so that, on each new bar, it retrieves the previous and current close prices for every symbol in your watchlist. If a symbol’s price crosses above or below its target, the script sends an alert (using your chosen alert frequency) and records the timestamp of that event.
Visually, the indicator displays a small table at the top center of your chart. For each watched symbol, it shows four columns: the symbol name, its latest close price (in the chart’s timeframe), the target price you set, and the last time an alert was emitted (formatted as MM.dd HH:mm:ss). By comparing the previous close to the current close and checking against the stored “lastAlertTime,” the script ensures that you receive exactly one alert per crossing event per bar.
In short, the key features are:
Input up to ten symbols with their corresponding float price targets.
Automatically check each symbol’s previous and current close values every bar.
Trigger a single alert when price crosses a target—either upward or downward.
Maintain a map of last alert timestamps to prevent duplicate notifications.
Display a real-time table listing each symbol’s current price, target, and last alert time.
Whenever you need to keep tabs on multiple instruments across different timeframes without manually tracking price levels, simply add this indicator to your chart. It runs in the background and pushes alerts as soon as any watched symbol touches its defined threshold.