OPEN-SOURCE SCRIPT

Risk Manager Pro: Diamond Edition [Kelly & EV Engine]

72
1. Titolo dello Script
Risk Manager Pro: Diamond Edition [Kelly & EV Engine]

2. Descrizione (Copia e incolla nel box descrizione)
Risk Manager Pro: Diamond Edition is not just a position size calculator; it is a complete algorithmic trading assistant designed to bridge the gap between technical analysis and professional money management.

Many traders focus solely on where to enter. This tool focuses on if you should enter and how much you should risk, using institutional-grade probability models like the Kelly Criterion and Expected Value (EV).

💎 Key Features
1. The "Truth" Metrics (EV & Kelly) Instead of just showing PnL, the dashboard calculates two critical decision-making metrics:

Expected Value (EV): Calculated in your currency. It combines your Win Rate, Potential Profit, and Risk. If EV is Green, the trade makes mathematical sense. If Red, you are paying to gamble.

Kelly Criterion Edge: Measures your statistical edge.

Weighted R:R: Unlike standard calculators that average Risk:Reward, this engine weighs your R:R based on your partial take-profit quantities (e.g., closing 50% at TP1 vs 80% at TP1 changes your real math).

2. Kelly Auto-Sizing Engine (Algo-Sizing) This is the standout feature. When enabled in settings:

The script automatically adjusts your position size based on the strength of your statistical edge.

If the Kelly score is negative (no edge), the script forces Size = 0 (protecting you from bad trades).

If the edge is positive, it scales the risk proportionally (capped at your Max Risk input).

3. Planning Mode vs. Live Mode

Planning Mode: Set an Entry Mode to "Manual Level". The visual lines (Entry, SL, TP) detach from the current price, allowing you to plan Limit or Stop orders. The dashboard calculates risks based on that future entry.

Live Mode: Anchors calculations to the current Close price for market execution.

4. Institutional Fee Modeling

Includes inputs for Commissions, Spread, and Swap.

Triple Swap Toggle: A checkbox to account for weekend/Wednesday triple swap costs, crucial for Swing/Position traders.

5. Dynamic Visuals

Smart Trail Pilot: A dynamic trailing stop line that changes color from Purple (Risk Zone) to Neon Green (Safe Zone/Locked Profit) once price crosses your entry.

Clean Chart Toggle: Hide the background risk boxes for a minimalist view.

🛠️ Dashboard Breakdown
Row 1 (Status): Shows active mode (Planning/Live) and the Expected Value (EV). This is your "Go/No-Go" gauge.

Row 2 (Edge): Displays your Win Rate and Kelly Status.

Row 3 (Sizing): Calculates Lot Size and effective Leverage.

Row 4 (PnL): Projected Net Profit and the True Weighted R:R.

Row 5 (Costs): Total estimated drag on the account (Fees + Swap + Spread).

Row 6 (Context): Trend filter analysis (EMA 50/200 logic).

⚙️ How to Use
Configure Profile: Set your Account Balance and Currency.

Input Win Rate: Be honest. Input your historical Win Rate (or calculate it from your last 20 trades via the option).

Plan the Trade:

Select Long/Short.

Choose your SL Mode (Fixed, ATR, or Swing Structure).

Adjust TPs (Single or Multi-Target).

Check the EV: Look at the top right of the dashboard. Is the EV positive?

Execute: Use the calculated "Size" for your broker order window.

Disclaimer: This tool is for educational and risk management purposes only. It does not provide financial advice. The "Kelly Auto-Sizing" is a mathematical model and does not guarantee future profits. Always trade responsibly.

If you find this script useful, please leave a comment with your feedback! Suggestions for improvement are greatly appreciated.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.