OPEN-SOURCE SCRIPT
Dynamic Risk and Reward

The Dynamic Equity Projection (DEP Map) is an institutional-grade visual execution tool designed to automate risk-to-reward mapping directly on your chart. Unlike standard drawing tools, it is context-aware—calculating volatility and trend bias in real-time to provide a "live" projection of your trade's potential.Core Logic & Intelligence1. Trend-Filtered SentimentThe indicator uses a 200-period Exponential Moving Average (EMA) as a directional filter.Bullish Map: If the current price is above the EMA, the DEP Map projects a green "Long" zone.Bearish Map: If the price is below the EMA, it instantly flips to a red "Short" zone.This helps traders stay aligned with the primary market momentum, avoiding the trap of "trading against the tide."2. Volatility-Adaptive Risk (ATR)Rather than using arbitrary point distances, the DEP Map utilizes the Average True Range (ATR).It measures the market's "noise" level over the last 14 bars.The Stop Loss is set at a multiplier (default 1.5x) of this volatility, ensuring your stop is wide enough to survive market breathing but tight enough to maintain a high R:R.Technical FeaturesFeatureDescriptionProfessional BenefitProjection BoxA dynamic rectangle that extends into the "future" (right-side offset).Keeps the current price action clear while providing a visual goalpost for the trade.Persistent LogicUses advanced var object handling to prevent "ghosting" or label stacking.Ensures a clean, high-performance chart interface without clutter.R:R Equity LadderSegments the profit zone into specific milestones: 1.0, 2.0, 3.0, and the "Equity Target" (5.0).Allows for precise partial profit-taking and psychological target setting.Dashed SL LineA high-contrast red dashed line indicating the invalidation point.Provides an immediate visual cue of the trade's total risk.How to Use the DEP MapIdentify the Bias: Observe the color of the box. A green box suggests looking for buying opportunities; a red box suggests selling.Verify the Levels: The labels on the right edge of the box provide the exact price points for your Stop Loss and Take Profit orders.Execute & Manage:R:R 1.0: The "Safety Point." Many traders move their stop to breakeven here.R:R 2.0 - 3.0: The "Standard Exit." This is where the bulk of the trade's profit is usually captured.Equity Target: The "Home Run." Reserved for high-conviction trend extensions.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.