TCP | Dominance Dashboard | Crypto Version🚀 Crypto Dominance Dashboard Pro
A Complete Dashboard for Monitoring Crypto Market Rotation
Understanding where capital is moving within the cryptocurrency market is one of the most valuable insights for traders and investors.
The crypto market is constantly shifting between Bitcoin, large-cap altcoins, small-cap assets, and stablecoins. Monitoring these rotations manually often requires multiple charts and significant analysis.
Crypto Dominance Dashboard Pro simplifies this process by bringing together the most important dominance metrics, market capitalization indexes, trend analysis, and momentum data into a single, easy-to-read dashboard.
Instead of switching between several charts, you can monitor the overall market structure, evaluate capital rotation, and gain a clearer view of the current market environment from one place.
Whether you're analyzing short-term market movements or following longer-term trends, the dashboard is designed to provide objective market context that can support your own trading and investment decisions.
✨ Features
📊 Comprehensive Market Dashboard
Track the most important crypto market metrics in real time:
• 🟠 Bitcoin (BTC)
• 🔵 Ethereum (ETH)
• 🟡 Bitcoin Dominance (BTC.D)
• 🟣 Ethereum Dominance (ETH.D)
• 🟢 Tether Dominance (USDT.D)
• ⚪ OTHERS Dominance
• 🌍 TOTAL Market Capitalization
• 🌎 TOTAL2 Market Capitalization
• 🌏 TOTAL3 Market Capitalization
• ⚡ ETH/BTC Relative Strength
🔄 Smart Market Regime Detection
The dashboard continuously evaluates multiple market conditions to identify the current market environment.
Possible market regimes include:
🟠 Bullish Bitcoin Environment
🔵 Bullish Large-Cap Altcoin Environment
🟢 Bullish Small-Cap Altcoin Environment
🔴 Bearish Bitcoin Environment
🔴 Bearish Large-Cap Altcoin Environment
⚪ Neutral / Range Market
Each regime is determined using a combination of dominance metrics, trend analysis, momentum, and capital rotation instead of relying on a single indicator.
📈 Trend Analysis
Monitor trend direction across key market metrics using moving average analysis.
Included trend detection:
✅ Bitcoin Price
✅ Bitcoin Dominance
✅ OTHERS Dominance
✅ Total Crypto Market
⚡ Momentum Analysis
The dashboard measures momentum across multiple market indexes to provide additional context for market activity.
Percentage change calculations include:
📈 BTC
📈 ETH
📈 BTC.D
📈 ETH.D
📈 USDT.D
📈 OTHERS.D
📈 TOTAL
📈 TOTAL2
📈 TOTAL3
📈 ETH/BTC
This approach helps traders monitor how strength and weakness develop across different areas of the market.
⏱ Automatic Timeframe Adaptation
Market conditions can look very different across timeframes.
To improve consistency, the indicator automatically adjusts its internal thresholds based on the selected chart timeframe.
Supported across:
⏱ 5 Minutes
⏱ 15 Minutes
⏱ 1 Hour
⏱ 4 Hours
⏱ Daily
⏱ Weekly
This adaptive scaling allows the dashboard to remain responsive across multiple trading styles.
💡 Market Outlook
Based on the detected market regime, the dashboard provides an easy-to-read market outlook to help interpret current conditions.
Examples include:
🟠 Bitcoin Leading the Market
🔵 Strength in Large-Cap Altcoins
🟢 Improving Small-Cap Participation
🔴 Defensive / Risk-Off Conditions
⚪ Neutral Market Structure
These summaries are intended to provide additional context and should be considered alongside your own market analysis.
🔔 Built-in Alerts
Receive TradingView alerts whenever significant market conditions change.
Available alerts include:
✅ Bullish Bitcoin Environment
✅ Bullish Large-Cap Altcoin Environment
✅ Bullish Small-Cap Altcoin Environment
✅ Bearish Bitcoin Environment
✅ Bearish Large-Cap Altcoin Environment
✅ Risk-Off Conditions
Alerts help you stay informed about important market changes without continuously monitoring every chart.
🎨 Clean & Informative Interface
The dashboard is designed to present a large amount of market information in a clear and organized format.
✔ Color-coded momentum
✔ Trend direction indicators
✔ Percentage change tracking
✔ Market regime overview
✔ Market outlook summary
✔ Automatic timeframe scaling
Everything is organized to provide quick access to the information that matters most.
👥 Who Is This Indicator For?
Crypto Dominance Dashboard Pro is suitable for:
📌 Day Traders
📌 Swing Traders
📌 Position Traders
📌 Scalpers
📌 Long-Term Investors
📌 Portfolio Managers
📌 Market Analysts
Anyone interested in monitoring market structure and capital rotation can benefit from this dashboard.
🎯 Why Use Crypto Dominance Dashboard Pro?
Price is only one part of the market.
Dominance metrics, market capitalization indexes, relative strength, momentum, and trend analysis each provide a different perspective on market behavior.
By bringing these elements together into one dashboard, Crypto Dominance Dashboard Pro helps traders monitor changing market conditions, understand capital rotation, and build additional context for their own analysis.
Rather than focusing on a single metric, the dashboard provides a broader view of the crypto market that can support more informed decision-making.
⚠️ Disclaimer
This indicator is designed for educational and analytical purposes only.
It is intended to provide market context based on publicly available market data and should not be interpreted as financial or investment advice.
Always perform your own research and risk management before making trading or investment decisions.
❤️ Support the Project
If you find this indicator useful, your support is greatly appreciated.
⭐ Add it to your Favorites
👍 Like the script
💬 Leave a review and share your feedback
📢 Share it with other traders who may find it useful
Your feedback helps improve future updates and supports the development of additional tools for the TradingView community.
Thank you for your support, and happy trading! 🚀
This indicator was designed and developed by TradeCityPro.
Special thanks to the TradeCityPro community for their continuous support, valuable feedback, and contribution to improving this project.
Thank you for your support, and happy trading! 🚀 Indicador

Indicador

Indicador

TSF Risk ManagerTSF Risk Manager
═══════════════════════════════════════ ENGLISH ═══════════════════════════════════════
OVERVIEW A visual position-size and risk calculator. Mark your entry and stop-loss on the chart and it instantly computes the exact lot size for your chosen account risk, draws the full trade (entry, stop, take-profits) and shows the REAL risk in your account currency.
Important: TradingView / Pine cannot access your broker account or place orders. This is a calculator and visual planner — you enter your account size and risk %, and it does the math. It does not execute trades.
WHAT IT DOES
Click-to-place entry and stop-loss directly on the chart.
Calculates position size (lots) for your target risk %, rounded DOWN to your broker's lot step so you never exceed the intended risk.
Shows the REAL risk of the rounded lot (in money and %), so what you see is what you actually risk — not just the target.
Warns when your account size and stop distance don't allow the target risk (i.e., when the broker's minimum lot already risks more than your %).
Draws the trade: entry, stop and three take-profit levels at configurable R multiples, with a green reward zone and a red risk zone.
Detects direction (long / short) automatically from where the stop is placed.
HOW IT WORKS
Risk amount = account balance × risk %.
Lot size = risk amount ÷ (stop distance × value-per-1.00-move-per-lot), floored to the broker's lot step.
The "Value of 1.00 move per lot" must match your instrument. For XAUUSD (gold) it is 100 (1 standard lot = 100 oz, so a 1.00 price move = $100 per lot). Adjust it for other instruments / brokers.
HOW TO USE
Add the indicator; when prompted, click your entry and then your stop-loss on the chart.
In the settings, set your account size, risk %, and the value-per-point for your instrument (100 for gold).
Read the lot size and the real risk in the panel; the trade is drawn on the chart.
To plan another trade without deleting the current one, simply add the indicator again.
USER-INTERFACE TEXT (English translation) The panel and labels are written in Spanish. English meaning:
"TSF RISK" = panel title · "COMPRA" = Buy (long) · "VENTA" = Sell (short).
"Capital" = Account balance · "Riesgo objetivo" = Target risk · "Distancia SL" = Stop distance.
"LOTAJE" = Lot size · "Riesgo real" = Actual risk · "Estado" = Status.
"⚠ Mín 0.01 = X% del capital" = Warning: the broker's minimum lot risks X% of the account.
"✔ Riesgo bajo control" = Risk under control · "marcá entrada y stop" = mark entry and stop.
"TP1 / TP2 / TP3 (R)" = take-profit levels at R multiples · "Trading Sin Fronteras" = the author's brand.
This script is open-source. Feel free to study it, learn from it and adapt it.
═══════════════════════════════════════ ESPAÑOL ═══════════════════════════════════════
Calculadora visual de gestión de riesgo y tamaño de posición. Marcás tu entrada y tu stop en el gráfico y te calcula al instante el lotaje exacto para el riesgo que elegiste, dibuja la operación completa (entrada, stop, take-profits) y te muestra el riesgo REAL en el dinero de tu cuenta.
Importante: TradingView no accede a tu cuenta del broker ni ejecuta órdenes. Esto es una calculadora y planificador visual — vos cargás tu capital y tu % de riesgo, y hace el cálculo. No opera por vos.
QUÉ HACE
Marcás entrada y stop con un clic en el gráfico.
Calcula el lotaje para tu % de riesgo, redondeado HACIA ABAJO al mínimo de tu broker para que nunca te pases del riesgo objetivo.
Muestra el riesgo REAL del lote redondeado (en $ y en %), así lo que ves es lo que de verdad arriesgás.
Te avisa cuando tu capital y tu stop no permiten el riesgo objetivo (cuando el lote mínimo del broker ya arriesga más que tu %).
Dibuja la operación: entrada, stop y tres take-profits en múltiplos de R, con zona verde de beneficio y roja de riesgo.
Detecta la dirección (compra / venta) según dónde pongas el stop.
CÓMO USARLO Agregá el indicador y, cuando lo pida, hacé clic en tu entrada y luego en tu stop. En los ajustes cargá tu capital, tu % de riesgo y el "valor de 1.00 por lote" de tu instrumento (100 para el oro). Leé el lotaje y el riesgo real en el panel. Para planificar otra operación sin borrar la anterior, agregá el indicador de nuevo.
Script de código abierto — Trading Sin Fronteras. Indicador

Sovereign Horizon Matrix (SHM) v8.0
SHM Bidirectional v8.0
⚔️ Executive Summary (SHM v8.0)
SHM Bidirectional v8.0 is an institutional-grade, macro trend-following execution matrix engineered for higher-timeframe swing trading on the Daily chart.
Built primarily for Bitcoin (BTC)—and modeled after real-world Coinbase Nano Bitcoin Futures execution mechanics—SHM v8.0 combines an 8-pillar technical framework with strict, non-repainting risk management. It eliminates chart fatigue and emotional bias, allowing Institutional and Retail traders to capture major trends while keeping their time free for the gym, work, and family.
* Primary Design: Daily Chart Swing Trading & Automation-Ready Execution Engine
* Core Focus: Bitcoin (BTC) macro expansion cycles (Fully adjustable for Altcoins, Futures, and Equities)
* Key Mechanics: Dual Baseline (63/480 WMA), Dual Break & Retest Engines, RSI Momentum Gate, and 3-Module Risk Engine
* Backtest Snapshot (BTC Daily): 7.617 Profit Factor | 18.85% Max Drawdown | 124.49% CAGR (56 trades)
⚙️ Purpose, Asset Focus & Time-Saving Design
The Purpose:
SHM v8.0 was created to solve a fundamental trading challenge: eliminating emotional bias, filtering out bad breakouts, and enforcing strict, automated risk management across volatile market cycles. The goal is to provide traders with a clean, repeatable strategy that captures real trends while shielding capital during choppy sideways movement.
Primary Target & Chart Focus:
* Primary Asset: Engineered primarily for Bitcoin (BTC) to handle its unique cycles, volatility spikes, and macro trend expansions.
* Daily Chart Focus: Designed specifically around higher-timeframe swing trading on the Daily chart. This makes it ideal for traders who don't have the time to sit in front of charts all day managing intraday noise.
* Full Adjustability: Works seamlessly across other crypto pairs, futures, and stocks. You have complete freedom to tweak all parameters—WMA lengths, envelope percentages, RSI filters, and stop distances—to match any market or timeframe.
⚙️ Core System Architecture
SHM v8.0 functions as a macro trend-following execution matrix. Because every signal and exit runs on fixed non-repainting calculations, it can also operate as a quantitative trend follower when linked to automated webhooks or trading bots.
1. Dual Baseline Framework: Combines a 63 Fast Institutional WMA with a 480 Macro Baseline WMA Tide filter to keep daily trades aligned with macro market structure.
2. Dual Break & Retest (B&R) Engine: Dedicated Micro (63 WMA) and Macro (480 WMA) engines track depth, touch penetration, and bounce candles to filter out false breakouts.
3. Timeframe-Locked RSI Momentum Gate: Verifies directional expansion so you don't buy near local tops or short into oversold bottoms.
4. Triple-Band Envelope System: Uses multi-layer WMA volatility bands to highlight expansion channels and potential exhaustion zones visually.
🛡️ SHM Modular Risk Engine
The script features three non-repainting exit modules:
* Module 1 (Flat TP to Breakeven): Moves your stop loss straight to entry price once a set profit percentage target is reached.
* Module 2 (65 WMA Ribbon Trail): Dynamically trails stops along the 65 WMA ribbon floor or ceiling during sustained trends.
* Module 3 (Candle-Close Trail): Steps your stop loss behind recent candle closes to lock in profits during sharp extensions.
📊 Default Properties, Backtest Metrics & Real-World Execution
To maintain total transparency and adhere to TradingView backtesting standards, default strategy Properties reflect realistic exchange execution mechanics (modeled after Coinbase Nano Bitcoin Futures / Derivatives environment settings):
* Initial Capital: $717 USD
* Position Sizing: 80% of Equity (default size is set higher for compounding, but can easily be adjusted in settings to match your personal risk tolerance)
* Leverage: 4x Long / ~3x Short
* Commission: 0.075% per trade
* Slippage & Delay: 30 ticks slippage / 1 tick order execution delay
* Execution Realism: Calculates on bar closes, order fills, and real-time bar ticks.
📈 Historical Performance Context (Daily Chart)
* Historical Data Source: Because newer derivatives tickers lack long-term price history, the full historical aggregate BTC chart was used to provide maximum sample depth.
* Trade Frequency: Running on the Daily chart generates a focused sample size of 56 trades across the dataset. While it doesn't hit the high trade counts of lower-timeframe scalpers, the efficiency of the framework stands out:
* Profit Factor: 7.617
* Max Equity Drawdown: 18.85%
* Average Winning Trade: +56.41% vs. Average Loss: -3.29%
* Compound Annual Growth Rate (CAGR): 124.49%
📌 Usage & Automation
* Execution Modes: Toggle between pure Price Action Baseline entries, Break & Retest Standalone entries, or Combined execution in the input menu.
* Automation Ready: All order conditions and trailing exits execute instantly on confirmed bar closes, making SHM fully compatible with webhook automation tools.
⚠️ Disclaimer & Compliance:
This script is published for educational and technical analysis backtesting purposes only. Past backtested results do not guarantee future performance. Always apply strict risk management and adjust commission, slippage, and position sizing settings to match your specific execution platform prior to live deployment.
Estrategia

Indicador

Indicador

Indicador

Indicador

Indicador

ATR Risk Lattice - Position Size QuantizationA position-size calculator answers one question: given equity, a risk percentage and a stop
distance, how many units should I buy? The answer comes back fractional - 3.47 contracts, 118.6
shares - and the trader rounds it. This script is about what that rounding does to the risk you
actually carry.
THE PRINCIPLE
Position size is quantized. A broker sells whole contracts, or whole shares, or units of 0.01. So
the set of risk levels available to you is not continuous. It is a ladder, and the spacing between
two adjacent rungs is:
one size increment x (ATR multiple x ATR) x point value / equity
Every rung is a position you can hold. Everything between two rungs is a position you cannot hold.
The unrounded size almost never lands on a rung, so the risk you end up carrying is the rung you
rounded to, not the target you typed into the settings.
Two consequences follow, and both are invisible in a tool that prints a single size number:
1. When the account is small relative to the instrument, the ladder is coarse. On a
large-multiplier futures contract, adjacent rungs can sit more than a full percent of equity
apart, which means a 1% target is not reachable at all. The real choice is between no position and
one that risks considerably more than intended.
2. The ladder is not fixed. Its spacing is proportional to ATR, so as volatility expands the rungs
spread apart and risk control becomes coarser without anything in the setup changing.
WHAT IS PLOTTED
The pane plots realized risk as a percentage of equity after rounding, together with the two rungs
that bracket the unrounded size. The shaded band between those two lines is the range you are
forced to choose within. The dashed line is your target. When the band is narrow relative to the
target line, sizing is fine-grained. When it is wide, the sizing decision is dominated by
granularity rather than by your risk setting.
The line turns amber when one size increment moves realized risk by more than a configurable share
of your target - 25% by default.
HOW TO READ THE TABLE
The table reports the current bar. ATR and the timeframe and smoothing it came from; stop distance
in price and in ticks; the long and short stop levels measured from the current close; currency
risk per unit; target risk in percent and in currency; the unrounded size; the rounded size;
realized risk after rounding in percent and currency; the rung below and the rung above with their
risk levels; the ladder step, meaning how much realized risk moves per one size increment; and the
ladder step expressed as a percentage of your target, labelled fine or coarse.
The bottom row prints the opening timestamp of the bar the ATR was taken from, so the timing claim
below can be checked on the chart rather than taken on trust.
HIGHER-TIMEFRAME VOLATILITY
Risk is often managed on a slower timeframe than the one being watched. The script can take ATR
from a higher timeframe using a single bundled request. The requested expression is offset by one
bar and the request uses lookahead, which is the pair the Pine Script documentation specifies for
confirmed higher-timeframe values: the offset discards the bar that is still forming and returns
the one before it, which was already final when the current higher-timeframe bar opened.
Historical and realtime bars therefore produce the same value, and the timestamp in the table is
the opening time of the bar that value came from.
If the selected timeframe is at or below the chart timeframe, the table says so instead of quietly
returning something that is not a higher-timeframe value.
When ATR is taken from the chart timeframe instead - the default - it includes the bar currently
forming, so the last plotted value moves until that bar closes. Values on closed bars do not
change.
SETTINGS WORTH SETTING CAREFULLY
Minimum size increment. This sets the ladder spacing and is the input the whole tool turns on. Use
1 for futures and standard share accounts, and your broker's actual minimum for crypto or
fractional shares.
Point value. Defaults to the symbol's exchange multiplier via syminfo.pointvalue. That value is 1
for most equities and the contract multiplier for futures, but it is not what every broker
applies, and on forex and CFDs it will usually need to be overridden manually.
Account equity. Entered in the instrument's quote currency. No FX conversion is performed.
Rounding. Round down keeps realized risk at or below target. Round up does the opposite. Round to
nearest sends an exact half-step upward.
LIMITATIONS
The calculation assumes the stop fills at the stop price. It does not, on gaps, on halts, or in
thin books, so a realized loss can exceed the figure shown. It ignores commissions, financing,
slippage and margin requirements, any of which can make a rung unreachable for reasons this script
knows nothing about. It is a single-position calculator: it does not aggregate exposure across
open trades or correlated instruments. ATR is a description of recent range, not a forecast of it.
On non-standard chart types the true range is computed from synthetic bars rather than from traded
prices, so the ladder will describe the synthetic series.
This is a measurement and planning aid. It produces no entries, no exits and no signals, it makes
no claim about any method being sound or unsound, and there is nothing here to optimize. The
source is open, so every number in the table can be traced to the line that produced it. Indicador

Universal Signal Backtester [LuxAlgo]The Universal Signal Backtester indicator is a tool designed to simulate and analyze the performance of virtually any trading signal, ranging from moving average crossovers to external indicator triggers. By providing a professional-grade backtesting environment directly on the chart, it allows users to optimize entry logic, exit strategies, and cost management in real-time.
🔶 USAGE
The script operates by selecting a Source Mode to define how trades are initiated. Users can choose between built-in MA crosses, external source crossovers, or discrete signal triggers from other indicators. Once a signal is detected, the script simulates a trade using up to three Take Profit (TP) and three Stop Loss (SL) levels.
🔹 Trade Visualization
* Sign Posts: Upon entry, the script plots a "Sign Post" label below or above the bar. This label dynamically suggests which TP level is currently the most effective based on the selected metric (e.g., Hit Rate or Expected Profit).
* Active Exit Lines: Horizontal dashed lines extend from the entry point to visualize the selected TP and SL targets. These lines update in real-time and mark hits with a checkmark (✓) or an "X" (✗).
* MA Ribbon: When using predefined crosses, a gradient ribbon is displayed to visualize the trend strength and crossover points.
🔹 Signal Modes
* Predefined Crosses: Quickly test standard strategies like the 9/21 EMA, 12/26 EMA, or the Golden/Death Cross (50/200 SMA).
* External Sources (Crossovers): Select two external plots (e.g., RSI and a level, or two custom MAs) to test their crossover performance.
* External Signals (Triggers): Connect the script to discrete signals such as Plotshapes or Boolean conditions. This is ideal for testing "Buy" and "Sell" signals from specialized indicators.
🔶 DETAILS
🔹 Advanced Analytics Dashboard
The indicator features a robust dashboard providing institutional-level metrics:
* Core Metrics: Total trades, Win Rate, Profit Factor, Sharpe Ratio, and Recovery Factor.
* Equity Curve: A sparkline representation of the account growth over time.
* Hourly Histogram: A performance breakdown by the hour of the day, helping identify the most profitable trading sessions.
* Heatmaps: A "Days of the Week" or "Monthly" heatmap that colors cells based on profitability, allowing for the identification of seasonal or periodic performance patterns.
🔹 Cost Simulation
To ensure realistic results, the script includes a cost engine. Users can select from profiles like Forex, Crypto, or Stocks to automatically apply industry-standard spreads and commissions, or input manual values to match a specific broker's fee structure.
🔶 SETTINGS
🔹 Source Settings
Source Mode: Determines the logic for trade entries (Predefined, External Crossover, or External Trigger). Signal Logic: Defines how external triggers are interpreted (e.g., Value Changes, Crosses 0, or Not NA). Trade Direction: Filters signals to allow only Longs, only Shorts, or Both.
🔹 Filters
Use ATR Choppiness Filter: When enabled, the script ignores signals that occur during low-volatility "choppy" periods.
🔹 Target Settings
Distance Type: Sets the measurement unit for TP/SL levels (ATR, Ticks, or Points). Take Profit (1-3): Toggles and sets the distance for up to three partial take-profit levels. Stop Loss (1-3): Toggles and sets the distance for up to three stop-loss levels.
🔹 Costs
Simulate Spread & Commission: Enables the cost engine for more realistic PnL calculations. Cost Profile: Presets for Forex, Crypto, and Stocks, or "Manual" for custom inputs.
🔹 Dashboard & Visuals
Heatmap Period: Switches the dashboard heatmap between "Days of Week" and "Months". Suggested TP Metric: Chooses the criteria the "Sign Post" uses to suggest the best TP level. Gradient Candle Coloring: Colors candles based on the distance between the fast and slow sources. Indicador

Indicador

Indicador

Indicador

Indicador

Martin Ratio Asset Screener [TrendAdvantage]Martin Ratio Asset Screener
Advanced Downside & Recovery Profiler
تقييم الأصول وفقًا لنسبة مارتن
أداة متقدمة لتحليل الهبوط والتعافي
English documentation is followed by the Arabic translation below.
الشرح باللغة العربية متوفر في الجزء السفلي من هذه الصفحة
█ OVERVIEW
This screener is designed to compare multiple assets over an identical observation window. Martin Ratio values are intended for relative ranking within the selected universe rather than as universal standalone scores.
█ WHAT IS THE MARTIN RATIO?
The Martin Ratio is an advanced, risk-adjusted performance metric that evaluates an asset's return relative to both the magnitude and duration of its historical drawdowns. By utilizing the Ulcer Index (UI) as its risk proxy, it penalizes how deep an asset falls and how long it remains underwater.
It builds on the Ulcer Index, developed by Peter G. Martin and published together with Byron B. McCann in their 1989 book, "The Investor's Guide to Fidelity Funds". This indicator serves as a screening framework to identify assets that historically generated higher returns relative to their drawdown burden, rather than those that subject a portfolio to significant drawdowns, both in magnitude and duration.
█ WHY THE MARTIN RATIO IS DIFFERENT
Martin recognized a fundamental flaw in the Sharpe Ratio: it uses standard deviation as a proxy for risk, which penalizes all volatility equally — including sudden, sharp moves to the upside. For trend-following strategies or high-growth portfolios, an upward move artificially inflates standard deviation, making the strategy appear riskier than it actually is.
Unlike common risk-adjusted metrics that use standard deviation as a measure of risk, the Martin Ratio uses the Ulcer Index (UI) as its denominator. The Sortino Ratio addresses part of this problem by focusing only on downside volatility. However, downside volatility measures magnitude only, while drawdown has two components: magnitude and duration.
The Ulcer Index measures how far an asset falls below its previous highs and how persistently it remains below those highs. It therefore captures an important dimension of investment risk that conventional volatility measures can miss: the depth and persistence of capital drawdowns.
A portfolio that falls 10% and quickly recovers presents a very different investment from one that falls 10% and remains underwater for an extended period. Because the Ulcer Index is calculated from the sequence of drawdowns from prior peaks, prolonged drawdowns continue contributing to the measure until recovery occurs.
Significance of Drawdown Depth and Persistence
• Capital lock-up risk: Capital tied up in a prolonged drawdown cannot easily be
redeployed without realizing a loss.
• Behavioral risk: The deeper and longer a drawdown persists, the greater the
possibility that an investor abandons the position before recovery.
• Compounding drag: Time spent recovering previous losses is time during which
capital is not advancing beyond its former peak.
A higher Martin Ratio indicates that an asset generated more return per unit of historical drawdown burden over the selected period.
█ MATHEMATICAL FORMULA
The traditional Martin Ratio is expressed as:
`Martin Ratio = (Ra - Rf) / Ulcer Index`
Where:
• Ra: Annualized return of the portfolio, asset, or strategy.
• Rf: Risk-free rate of return.
• Ulcer Index: The root mean square of percentage drawdowns from previous
historical peaks. Lower Ulcer Index values indicate a shallower and/or less
persistent drawdown profile.
█ IMPLEMENTATION USED IN THIS SCREENER
The Martin Ratio shown by this screener uses total return over the selected lookback period rather than annualized return:
`Martin Ratio = Lookback Return / Ulcer Index`
The risk-free rate is also excluded. Because every ticker in the screener is evaluated using the same timeframe and identical lookback length, the resulting values can be used for direct comparison and ranking within the selected universe. This simplified implementation is designed primarily as a relative asset-ranking tool, rather than as a reproduction of the traditional annualized Martin Ratio.
█ HOW THE SCREENER COMPARES ASSETS
Comparison between assets follows a consistent four-step framework:
1 — Use an Identical Lookback Window — All selected tickers are evaluated
using the same timeframe and lookback length in days. This is essential for
meaningful comparison because changing either parameter changes the return
horizon and the drawdown history being measured.
2 — Calculate Lookback Return — The total buy-and-hold return is
calculated for each ticker over the selected lookback period.
3 — Calculate the Ulcer Index — For each ticker, the script identifies
the running historical peak within the calculation sequence, measures each
closing price's percentage drawdown from that peak, squares those values,
averages them, and takes the square root. The result is the ticker's Ulcer
Index over the selected period.
4 — Calculate and Rank the Martin Ratio — The lookback return is divided
by the ticker's Ulcer Index. Higher values indicate a more favorable
combination of return and drawdown over the selected measurement period.
█ OPERATIONAL NOTES
The lookback period should be sufficiently long to capture a meaningful range of market conditions, such as a drawdown and recovery. Very short windows can produce unstable or misleading ratios, particularly when an asset has experienced little or no meaningful drawdown.
As a general starting point:
• Minimum: approximately 180 calendar days (~6 months)
• Preferred: 365 calendar days (1 year) or more
These are practical guidelines rather than statistically derived minimums. The appropriate lookback depends on the asset and intended investment horizon. Lookback periods spanning several years or more may exceed the available historical data for some tickers — particularly recently listed assets — resulting in N/A values.
This screener computes each ticker's metrics over an identical calendar-day window — not a fixed bar count — so a given lookback (e.g., 300 days) covers the same 300 calendar days for equities, cryptocurrencies, or forex alike, regardless of how many bars each one produces in that span on a given timeframe. This makes lookback settings directly comparable across asset classes, independent of the chart's timeframe.
One dependency remains: the host chart being viewed governs when the screener's internal calculation updates. If the host chart is a restricted-session equity (or similar), tickers from continuously-traded markets like crypto may not accumulate enough calendar history to populate, and can show N/A even within a supported lookback window. When mixing asset classes in the same table, view the screener from a crypto or forex chart to ensure prices are populated across all assets.
█ MARTIN RATIO THRESHOLD
The threshold used by the screener is a visual ranking aid, not a statistically validated cutoff. Table colors are interpreted as follows:
• Above threshold: Green
• Between 0 and the threshold: Grey
• Below 0: Red
The threshold is intended solely as a visual aid for ranking assets rather than a universal definition of a "good" Martin Ratio. Martin Ratio values are most meaningful when comparing securities calculated using the same methodology, timeframe, and lookback period. Because the implementation used here is based on non-annualized lookback returns, values should not be treated as universal absolute benchmarks across different timeframe and lookback configurations. For practical use, the threshold can be calibrated to the characteristics of the user's own watch list or investment universe.
█ INTERPRETATION
Each ticker's row includes the following metrics:
• Total Return — Cumulative percentage return over the selected
lookback period.
• Ann. Ret — Annualized return (CAGR) over the same period, shown for
reference only; it does not influence the Martin Ratio or the ranking.
• DD (Days) — The number of calendar days from peak to trough of the
single largest (deepest) drawdown observed in the window.
• DD % — The magnitude of largest drawdown, expressed as a percentage
decline from its prior peak.
• Time in DD % — The percentage of calendar days across the entire
lookback window during which the asset was trading below its prior peaks, in
any drawdown — not limited to the single largest one.
• Ulcer Index — A measure of drawdown depth and duration combined,
calculated as the root-mean-square of percentage drawdowns across every day
in the window. Unlike DD %, which reflects only the single worst decline, the
Ulcer Index captures the cumulative "pain" of all drawdowns the asset
experienced — larger and more persistent drawdowns increase the Ulcer Index.
• Martin Ratio — Total Return divided by the Ulcer Index, measuring
return earned per unit of drawdown intensity.
Within an identically configured comparison:
• Higher Martin Ratio → More return relative to the historical drawdown
burden.
• Lower positive Martin Ratio → Positive return, but with a less favorable
drawdown profile.
• Negative Martin Ratio → Negative return over the selected lookback period.
The screener is therefore best used as a cross-sectional ranking tool for identifying which assets have delivered the strongest return relative to the depth and persistence of their drawdowns over the same observation window.
█ DISCLAIMER
This script is published for educational and informational purposes only and does not constitute financial or investment advice. The Martin Ratio relies entirely on historical price data; past drawdown depth, duration, and recovery speed are not indicative of future results. Always conduct your own research and practice proper risk management before making investment decisions.
═════════════════════════════════════════════════════════════
الشرح باللغة العربية
هذا التطبيق مصمم لمقارنة أصول متعددة عبر فترة حساب متطابقة. يُقصد بقيم نسبة مارتن أن تُستخدم للترتيب النسبي داخل مجموعة الأصول المختارة، وليس كقيم مطلقة قائمة بذاتها
█ ما هي نسبة مارتن؟
نسبة مارتن هي مقياس متقدم للأداء، يقيّم عائد الأصول المالية مقارنةً بكلٍ من حجم ومدة تراجعاتها التاريخية. ومن خلال استخدام مؤشر شدة التراجع كمقياس للمخاطر، فإنها تأخذ في الاعتبار مدى عمق هبوط الأصول المالية وطول الفترة التي تظل فيها دون قممها السابقة
تعتمد نسبة مارتن على مؤشر شدة التراجع، الذي طوّره بيتر ج. مارتن ونُشر بالاشتراك مع بايرون ب. ماكان في كتابهما الصادر عام 1989، "دليل المستثمر إلى صناديق فيديليتي". ويعمل هذا المؤشر كإطار لفحص الأصول بهدف تحديد الأصول الأكثر مرونة وقدرةً على تنمية رأس المال بكفاءة، بدلاً من الأصول التي تعرّض المحفظة لتراجعات كبيرة من حيث الحجم والمدة
█ لماذا تختلف نسبة مارتن؟
أدرك مارتن وجود عيب جوهري في نسبة شارب، إذ تستخدم الانحراف المعياري كمقياس للمخاطر، وهو ما يعامل جميع أنواع التقلبات بنفس الأسلوب بما في ذلك التحركات الصعودية المفاجئة والحادة. وفي استراتيجيات تتبع الاتجاه أو المحافظ مرتفعة النمو، قد تؤدي الحركة الصعودية إلى رفع الانحراف المعياري بشكل مصطنع، مما يجعل الاستراتيجية تبدو أكثر خطورة مما هي عليه فعلياً
وعلى خلاف المقاييس الشائعة التي تستخدم الانحراف المعياري لقياس المخاطر، تستخدم نسبة مارتن مؤشر شدة التراجع في المقام. وتُعالج نسبة سورتينو جزءاً من هذه المشكلة من خلال التركيز فقط على تقلبات الجانب السلبي، إلا أن تقلبات الجانب السلبي تقيس حجم التقلبات فقط، بينما يتكون التراجع من عنصرين: الحجم والمدة
يقيس مؤشر شدة التراجع مدى هبوط الأصول المالية عن قممها السابقة ومدى استمرارها دون تلك القمم. ولذلك فهو يلتقط بُعداً مهماً من مخاطر الاستثمار قد لا تعكسه مقاييس التقلب التقليدية، وهو حجم تراجعات رأس المال ومدة الفترة الزمنية للتراجعات
وتختلف المحفظة التي تهبط بنسبة 10% ثم تتعافى سريعاً اختلافاً جوهرياً عن محفظة تهبط بالنسبة نفسها وتظل دون قمتها السابقة لفترة ممتدة. وبما أن مؤشر شدة التراجع يُحسب من تسلسل التراجعات عن القمم السابقة، فإن التراجعات الممتدة تواصل التأثير في قيمة المؤشر حتى حدوث التعافي
أهمية عمق التراجع واستمراره
• مخاطر تجميد رأس المال: يصعب إعادة توظيف رأس المال العالق في تراجع ممتد دون تحقيق خسارة فعلية
• المخاطر السلوكية: كلما كان التراجع أعمق وأطول، زادت احتمالية تخلي المستثمر عن المركز قبل حدوث التعافي
• عبء التعافي على النمو المركب: الوقت المستغرق في تعويض الخسائر السابقة هو وقت لا يتجاوز فيه رأس المال قمته السابقة، أي تمتد فترة طويلة قبل تحقيق الأرباح الفعلية
تشير نسبة مارتن المرتفعة إلى أن الأصل حقق عائداً أكبر مقابل كل وحدة من عبء التراجع التاريخي خلال الفترة المحددة
█ الصيغة الرياضية
تحسب نسبة مارتن التقليدية كالتالي
نسبة مارتن = (العائد السنوي − العائد الخالي من المخاطر) ÷ مؤشر شدة التراجع
حيث
مؤشر شدة التراجع: الجذر التربيعي لمتوسط مربعات نسب التراجع عن القمم التاريخية السابقة. وتشير القيم الأقل للمؤشر إلى تراجعات أقل عمقاً و/أو أقصر استمراراً
█ حساب نسبة مارتن في التطبيق المستخدم الحالي
تستخدم نسبة مارتن المعروضة في هذا التطبيق إجمالي العائد خلال فترة الحساب المحددة بدلاً من العائد السنوي
`نسبة مارتن = عائد فترة الحساب ÷ مؤشر شدة التراجع`
كما يتم استبعاد معدل العائد الخالي من المخاطر. ونظراً إلى أن كل رمز في التطبيق يُقيَّم باستخدام الإطار الزمني (تايم فريم) نفسه وطول فترة الحساب نفسها، يمكن استخدام القيم الناتجة للمقارنة المباشرة والترتيب داخل مجموعة الأصول المختارة. صُمم هذا التطبيق المبسط أساساً كأداة للتصنيف النسبي للأصول، وليس كإعادة حساب لنسبة مارتن التقليدية المحسوبة على أساس سنوي
█ كيف تقارن أداة التقييم بين الأصول
تتبع المقارنة بين الأصول إطاراً ثابتاً من أربع خطوات
استخدام فترة حساب متطابقة — تُقيَّم جميع الرموز المختارة باستخدام الإطار الزمني نفسه وطول فترة الحساب نفسها. وهذا ضروري لإجراء مقارنة ذات معنى، لأن تغيير أي من هذين المتغيرين يغيّر أفق العائد وسجل التراجعات محل القياس
حساب عائد فترة الحساب — يُحسب إجمالي عائد الشراء والاحتفاظ لكل رمز خلال فترة الحساب المحددة
حساب مؤشر شدة التراجع — لكل رمز: تحديد القمة التاريخية المتغيرة ضمن تسلسل الحساب، قياس نسبة تراجع كل سعر إغلاق عن تلك القمة، تربيع قيم التراجع، حساب متوسط مربعات التراجعات، ثم أخذ الجذر التربيعي. والنتيجة هي قيمة مؤشر شدة التراجع للرمز خلال الفترة المحددة
حساب نسبة مارتن وترتيبها — يُقسم عائد فترة الحساب على مؤشر شدة التراجع الخاص بالرمز. تشير القيم الأعلى إلى مزيج أكثر ملاءمة بين العائد والتراجع خلال فترة القياس المحددة
█ ملاحظات الاستخدام
ينبغي أن تكون فترة الحساب طويلة بما يكفي لتغطية فترة ذات دلالة من ظروف السوق، مثل فترة تراجع وتعافٍ لاحق. فترات الحساب القصيرة جدًا قد تُنتج نسبًا غير مستقرة أو مضللة، خاصة عندما لا يكون الأصل قد شهد تراجعًا ذا دلالة
كنقطة بداية عامة
• الحد الأدنى: نحو 180 يومًا تقويميًا (حوالي 6 أشهر)
• المُفضَّل: 365 يومًا تقويميًا (سنة واحدة) أو أكثر
هذه إرشادات عملية وليست حدودًا دنيا مُشتقة إحصائيًا. تعتمد فترة الحساب المناسبة على فئة الأصل والأفق الاستثماري المقصود. قد تتجاوز فترات الحساب الممتدة لعدة سنوات أو أكثر البيانات التاريخية المتاحة لبعض الرموز — خاصة الأصول المُدرجة حديثًا — مما يؤدي إلى ظهور قيم غير متاح
يحسب هذا التطبيق مقاييس كل رمز عبر فترة حساب متطابقة من الأيام التقويمية — وليس عددًا ثابتًا من الشموع — بحيث تغطي فترة حساب معينة (مثل 300 يوم) نفس الـ300 يوم التقويمي سواء للسهم أو للعملة الرقمية أو للعملات الفوركس، بصرف النظر عن عدد الشموع التي يُنتجها كل منها خلال تلك الفترة على أي إطار زمني معين. وهذا يجعل إعدادات فترة الحساب قابلة للمقارنة مباشرة عبر فئات الأصول المختلفة، بمعزل عن الإطار الزمني للرسم البياني
يبقى اعتماد واحد قائمًا: الرسم البياني المعروض الذي تُشاهد الجدول من خلاله هو ما يحدد توقيت تحديث الحساب الداخلي للتطبيق. فإذا كان الرسم البياني لسهم ذي جلسات تداول محدودة (أو ما شابه)، فقد لا تتمكن الرموز من أسواق مستمرة التداول مثل العملات الرقمية من تجميع سجل تقويمي كافٍ، وقد تظهر بقيمة "غير متاح" حتى ضمن فترة حساب مدعومة. عند الجمع بين فئات أصول مختلفة في الجدول نفسه، يُنصح بمشاهدة الجدول من رسم بياني لعملة رقمية أو فوركس لتجنب هذه المشكلة
█ الحد المرجعي لنسبة مارتن
حد اللون الأخضر لنسبة مارتن المستخدم في التطبيق هو وسيلة بصرية للمساعدة في الترتيب، وليس حداً فاصلاً مثبتاً إحصائياً. تُفسَّر ألوان الجدول على النحو التالي
• أعلى من الحد: أخضر
• بين الصفر والحد: رمادي
• أقل من الصفر: أحمر
ينبغي التعامل مع الحد باعتباره مستوى مرجعياً قابلاً للتعديل، وليس تعريفاً عاماً لما يُعد نسبة مارتن جيدة. تكون قيم نسبة مارتن أكثر دلالة عند مقارنة أوراق مالية حُسبت باستخدام المنهجية والإطار الزمني وفترة الحساب نفسها. ونظراً إلى أن التطبيق المستخدم هنا يعتمد على عوائد فترة الحساب غير محسوبة على أساس سنوي، فلا ينبغي اعتبار القيم معايير مطلقة عامة عبر إعدادات مختلفة للأطر الزمنية وفترات الحساب. للاستخدام العملي، يمكن معايرة الحد بما يتناسب مع خصائص الأصول المالية المرصودة أو مجموعة الأصول الاستثمارية الخاصة بالمستخدم
█ تفسير نسبة مارتن
يتضمن الجدول المقاييس التالية لكل رمز
العائد الإجمالي — العائد المئوي التراكمي خلال فترة الحساب المحددة
العائد السنوي — عائد النمو السنوي المركب لنفس الفترة، يُعرض للاطلاع فقط، ولا يؤثر على نسبة مارتن أو على الترتيب
أقصى تراجع (أيام) — عدد الأيام التقويمية من القمة إلى القاع لأكبر (أعمق) تراجع لوحظ خلال الفترة
% أقصى تراجع — حجم التراجع الأكبر، معبَّرًا عنه كنسبة انخفاض مئوية من قمته السابقة
% فترة التراجع — النسبة المئوية للأيام التقويمية عبر فترة الحساب بأكملها التي كان فيها الأصل يتداول دون قمة سابقة، في أي تراجع وليس مقتصرًا على التراجع الأكبر فقط
مؤشر شدة التراجع — مقياس يجمع بين عمق التراجع ومدته، ويُحسب كجذر تربيعي لمتوسط مربعات نسب التراجع عبر كل يوم في الفترة. وخلافًا لـ % أقصى تراجع، الذي يعكس فقط التراجع الأكبر، يعبّر مؤشر شدة التراجع عن التراكم الكلي "لمعاناة" الأصل من كل التراجعات التي مر بها فكلما كانت التراجعات أكبر وأطول أمدًا، ارتفعت قيمة المؤشر
نسبة مارتن — العائد الإجمالي مقسومًا على مؤشر شدة التراجع، وتقيس العائد المُحقق مقابل كل وحدة من "معاناة" التراجع
ضمن مقارنة بإعدادات متطابقة
• نسبة مارتن الأعلى ← عائد أكبر مقارنةً بعبء التراجع التاريخي
• نسبة مارتن الموجبة المنخفضة ← عائد موجب، لكن مع ملف تراجع أقل ملاءمة
• نسبة مارتن السالبة ← عائد سالب خلال فترة الحساب المحددة
لذا، يُعد هذا التطبيق أداة مثالية للترتيب المقطعي لتحديد الأصول التي حققت أقوى عائد مقارنةً بعمق وديمومة تراجعاتها خلال نفس فترة الحساب
█ إخلاء المسؤولية
يُنشر هذا السكربت لأغراض تعليمية ومعلوماتية فقط، ولا يُعد نصيحة مالية أو استثمارية. تعتمد نسبة مارتن بالكامل على بيانات الأسعار التاريخية، ولا يُعد عمق التراجع أو مدته أو سرعة التعافي في الماضي مؤشراً على النتائج المستقبلية. احرص دائماً على إجراء أبحاثك الخاصة وتطبيق إدارة سليمة للمخاطر قبل اتخاذ أي قرارات استثمارية
Indicador

Daily EMA60 Standard Error Table-zrbb-Quickly estimate the stop-loss range required for daily-chart trading.
快速估算日线级别交易需要的止损范围
In quantitative finance / stock market research, "3 standard errors" (requiring a t-statistic ≥ 3, corresponding to roughly a 99.7% confidence level) has a few main uses:
1. Raising the significance bar to guard against data snooping
This is the most important application. When quant researchers backtest large numbers of factors, strategies, or parameter combinations, the conventional 95% confidence threshold (about 2 standard errors) is often too lenient — if you test hundreds or thousands of parameter combinations, some will look "significant" purely by chance (the multiple comparisons problem).
Researchers like Marcos López de Prado have proposed raising the significance threshold to a t-stat ≥ 3 (i.e., 3 standard errors) as a rule of thumb to substantially reduce the probability of "false discoveries" — mistaking luck for real alpha — and to combat backtest overfitting.
2. Building more conservative confidence intervals
For estimating parameters like strategy returns or factor exposures (beta):
Mean ± 1 SE → roughly 68% confidence interval
Mean ± 2 SE → roughly 95% confidence interval
Mean ± 3 SE → roughly 99.7% confidence interval (assuming approximate normality)
Using 3 SE means you require very strong evidence before drawing a conclusion, reducing the risk of mistaking noise for signal.
3. An important distinction to keep in mind
Standard Error (SE) and Standard Deviation (SD) are not the same thing:
Standard deviation measures the volatility of returns themselves (commonly used in Bollinger Bands, risk measures, etc.)
Standard error measures the uncertainty of an estimate (such as an average return or a beta coefficient); SE = SD / √n, so the larger the sample size, the smaller the SE
These two concepts are often conflated, but when judging whether a strategy's historical average return is truly significant, it's the standard error you should use — not the standard deviation of returns.
A practical caveat: even using 3 standard errors as a threshold is just a rule of thumb to reduce overfitting risk — it doesn't eliminate it entirely. Out-of-sample validation, economic rationale, and transaction cost considerations remain essential. Statistical significance alone doesn't guarantee a strategy will actually work in live trading.
在股市/量化投资研究里,"3倍标准误差"(即要求 t 统计量 ≥ 3,对应约 99.7% 的置信区间)主要有几个用途:
1. 提高策略显著性门槛,对抗数据窥探(data snooping)
这是最重要的应用场景。量化研究员在回测大量因子、策略参数组合时,常规的 95% 置信区间(约 2 倍标准误差)门槛太宽松——如果你测试了成百上千种参数组合,总会有一些"看起来显著"其实纯属巧合(多重比较问题)。
Marcos López de Prado 等人在量化文献中提出:把显著性门槛提高到 t-stat ≥ 3(即 3 倍标准误差),可以大幅降低"假发现"(把纯粹运气当作真实alpha)的概率,是应对回测过拟合的一种经验法则。
2. 构建更保守的置信区间
对于策略收益率、因子暴露(beta)等参数的估计:
均值 ± 1倍SE → 约68%置信区间
均值 ± 2倍SE → 约95%置信区间
均值 ± 3倍SE → 约99.7%置信区间(假设近似正态分布)
用3倍SE意味着你要求证据非常强才愿意下结论,减少"把噪音当信号"的风险。
3. 需要注意的一个关键区分
标准误差(Standard Error, SE)和标准差(Standard Deviation, SD)不是一回事:
标准差衡量的是收益率本身的波动性(常用于布林带、风险度量)
标准误差衡量的是"某个估计量"(比如平均收益、beta系数)的不确定性,SE = SD / √n,样本量越大SE越小
很多人会混用这两个概念,但在判断"这个策略的历史平均收益是否真实显著"时,该用的是标准误差,而不是收益率的标准差。
实际应用提醒:即便用3倍标准误差作门槛,也只是降低过拟合风险的经验法则,不能完全消除。样本外验证、经济学逻辑支撑、交易成本考量仍然必不可少——单纯统计显著不代表策略在实盘中一定有效。 Indicador

Risk calculatorScript Name
Risk Calculator
Purpose
A trading tool that calculates position size (lot/coin quantity) based on a fixed percentage risk of the account balance. The script visualizes entry, stop-loss, and take-profit levels on the chart and displays detailed trade statistics in a table.
Core Workflow
User Input: balance, maximum risk percentage, entry/stop/take prices (manually confirmed on the chart).
Direction Detection: analyzes price positions to determine if the trade is LONG (take > stop) or SHORT (take < stop). Invalid combinations trigger "SETUP ERROR".
Key Metrics Calculation:
Maximum loss in dollars (max_loss_usd)
Distance from entry to stop and take in points and percentages
Position Sizing (two scenarios):
If stop percentage < max risk: volume = balance / entry price (entire balance at risk, but stop triggers earlier)
Otherwise: volume = max loss / distance to stop (risk strictly limited to the set percentage)
Profit/Loss Calculation in dollars and risk/reward ratio (RR).
Visual Elements Rendering on the last confirmed or real-time bar:
Green profit zone (between entry and take)
Red loss zone (between stop and entry)
Horizontal level lines with labels
Information table in the bottom-right corner
Technologies / Libraries Used
Pine Script v6 — TradingView's native scripting language
Built-in functions:
input.float(), input.price() — data input
math.round_to_mintick() — rounding to minimum tick size
math.abs() — absolute value
table.new(), table.cell() — table creation
box.new() — rectangular areas
line.new() — trend lines
label.new() — text labels
Input Data
Balance ($) — account balance in USD (default: 1000)
Max Risk (%) — maximum risk per trade as percentage of balance (preset options: 0.25, 0.5, 0.75, 1, 2, 3, 5)
ENTRY — entry price (confirmed by clicking on the chart)
STOP — stop-loss price (confirmed by clicking on the chart)
TAKE — take-profit price (confirmed by clicking on the chart)
Output Data
Chart Visuals:
Colored profit (green) and loss (red) zones
Horizontal lines with price labels
Information Table (bottom-right corner):
Balance
Maximum risk in % and $
Trade amount in $
Volume in coins
Stop in % and $ (loss)
Take in % and $ (profit)
Risk/Reward ratio (1:X)
Key Features
Automatic position sizing with strict risk limitation
Level visualization directly on the chart for clear analysis
Flexible setup via manual price input on the chart
Risk/Reward ratio display (RR) for trade efficiency assessment
Support for both directions (LONG and SHORT) with automatic detection
Error protection: handles invalid price combinations (displays "ERROR" in the table)
Error Handling & Exceptions
Invalid price layouts (e.g., LONG with take < stop or entry outside the range) display "ERROR" in all table cells instead of numbers.
The direction variable is set to "SETUP ERROR", which blocks calculations and shows errors across all table fields.
The err flag checks for errors and replaces all numeric values with "ERROR" strings.
Dependencies & Environment Requirements
Platform: TradingView (web or desktop application)
Pine Script Version: v6
Timeframe: any (script is timeframe-independent)
Ticker: any (cryptocurrencies, stocks, forex, etc.)
No additional installations required — the script runs natively within TradingView
Implementation Details
Objects (lines, boxes, table) are created once on the last bar using barstate.islastconfirmedhistory and the objects_created flag to prevent redrawing on chart updates.
Visual elements are drawn with a 30-bar horizontal offset to the right for convenient label placement.
All calculations are performed in real-time as input parameters change. Indicador

Market Structure ProMarket Structure Pro — Multi-Timeframe Structure + ATR Trailing Stop.
A precision market-structure tool that goes beyond a simple pivot indicator by combining SMC-style swing detection, multi-timeframe CHoCH/BOS tracking, and a school-standard ATR trailing stop — all adapted automatically to the chart timeframe.
How it works:
The indicator scans pivot highs and lows using an SMC-calibrated Length (automatically picked for the current timeframe or set manually). Each broken pivot is classified as CHoCH (character change, phase start) or BOS (continuation) using your chosen breakout method — Wick, Body, or 2-Close confirmation. The same logic is mirrored across D1, H4, H1 and M5 in a summary table, so you always see whether the higher timeframes agree with the current one.
What it calculates:
- Swing pivots with HH / HL / LH / LL classification (optional labels)
- CHoCH / BOS counter — "UP (C)", "UP (C+1)", "DOWN (C+2)" — showing phase maturity per timeframe
- Trend direction on D1 / H4 / H1 / M5 in one summary table
- ATR trailing stop with EMA basis and one-directional ratcheting
- Live ATR% with a dynamic percentile-based "normal range" window
- Distance to trailing stop in %
Key features:
- Auto Length by timeframe (SMC standard: M5 = 7, H1 = 15, H4 = 20, D1 = 30 …)
- Three breakout modes: Wick (early), Body (default), 2-Close (conservative)
- Auto ATR multiplier and EMA basis per timeframe — sourced from Raschke, Carter, Chandelier Exit, Minervini, Wilder and Weinstein school standards
- Multi-timeframe trend dashboard with CHoCH/BOS phase counter
- Dynamic ATR% range (percentile lookback) — instant read on whether volatility is normal, muted or hot
- Configurable trailing-stop history window (2 or 10 last ranges)
- Optional HH / HL / LH / LL swing labels
- Fully customizable up/down colors
- Built-in alerts: trend flip up, trend flip down, stop touch up, stop touch down
- Disabled on timeframes below 5M with an on-chart notice — the indicator is calibrated for 5M and above
Who it's for:
Traders who want a single, opinionated structure tool that reads the market the same way institutional and SMC playbooks do — with automatic parameters that respect every timeframe, a clean multi-TF dashboard, and a trailing stop built from real trading-school standards rather than arbitrary defaults. Indicador

Indicador

Dynamic Rollover & Spread WindowDynamic Rollover & High Spread Zones
If you trade across different asset classes, you know that daily rollovers, CFD maintenance breaks, and weekly opens carry massive spread widening and low liquidity. Getting caught in a trade during these windows often leads to unnecessary slippage or getting stopped out by the spread alone.
This indicator automatically highlights these high-risk liquidity gaps directly on your chart. Instead of manually drawing time boxes or switching indicator settings every time you change tickers, the script reads what you are trading and adapts instantly.
The Hidden Cost of High Spreads
The spread is the difference between the Bid (sell) price and the Ask (buy) price. During rollover windows and market opens, institutional liquidity dries up. To protect themselves, brokers widen this spread dramatically—sometimes inflating a standard 1-pip spread to 15 or 20 pips.
This impacts your trading in two fatal ways:
Bad Entries: If you execute a market order during a high-spread window, you are forced to pay that inflated premium. You instantly start the trade in a much deeper drawdown, meaning the market has to move significantly further in your direction just for you to break even.
Phantom Stop-Outs: Stop-loss orders are triggered by the Bid or Ask price, not necessarily the mid-price you see on the chart. If the spread widens enough, it can tag your stop-loss even if the actual market price hasn't moved.
A Simple Example: Imagine you are in a short position on EUR/USD. The current price on the chart is 1.1000, and your stop-loss is placed 10 pips above at 1.1010. Normally, the spread is 1 pip.
At 17:00 NY time (rollover), the broker widens the spread to 15 pips. Even though the chart price remains exactly at 1.1000, the Ask price instantly jumps to 1.1015. Your stop-loss is triggered, closing you out for a loss. Five minutes later, the spread returns to normal, and EUR/USD drops 50 pips in your favor—but you are already out of the trade.
Key Features:
Dynamic Asset Detection: The script automatically detects if you are viewing a Forex pair, an Index (futures or CFD), or a Commodity. It then applies the correct low-liquidity window for that specific market.
Daily Rollovers vs. Weekly Opens: Daily maintenance windows (Monday–Friday) are highlighted in one color, while the notoriously thin Sunday Weekly Opens are isolated and highlighted in another.
Timezone Proof: All session times are anchored strictly to the "America/New_York" timezone (EST/EDT). This ensures the windows remain 100% accurate year-round, completely bypassing local Daylight Saving Time shifts.
Built for Edge Cases: The detection engine accurately categorizes generically labeled CFD tickers (like NAS100, US30, XAUUSD) and standard CME Futures (ES, NQ, CL).
Default Time Windows (NY Time):
Forex: 17:00–18:00 (Daily) | 17:00–19:00 (Sunday Open)
Indices: 16:00–18:00 (Daily) | 18:00–19:00 (Sunday Open)
Commodities: 17:00–18:00 (Daily) | 18:00–19:00 (Sunday Open)
Customization:
All session times and highlight colors are fully customizable in the indicator inputs to match your specific broker's server times if they differ from the standard exchange breaks.
Indicador

Indicador
