OPEN-SOURCE SCRIPT
تم تحديثه

Risk Management [odnac]

13 211
📌 Overview
This indicator helps you visually manage risk — the most critical aspect of trading. By entering your total capital, risk percentage, and leverage, it automatically calculates the optimal position size, required margin, and risk-to-reward ratio (R:R), and displays everything directly on the chart.

⚙️ Key Features
  • Automatic Position Size Calculation — Calculates the optimal entry size based on your configured risk % and stop loss distance.
  • R:R Visualization — Displays entry, stop loss, and take profit levels on the chart with colored fill zones and ratio labels at the center.
  • Real-time PnL Tracking — Shows live profit/loss (% and amount) with leverage applied in the info table after entry.
  • Market/Limit Entry Detection — Automatically displays B/S signals and triggers alerts when price reaches the entry level.
  • Multi-Currency Support — Choose from 15 currency symbols including USD, EUR, JPY, and BTC.
  • UI Customization — Freely adjust line colors, table position, and transparency to match your chart theme.


📋 Input Parameters
Total Capital Total trading capital
Risk % Maximum loss allowed per trade
Leverage Leverage multiplier
Entry / Stop / TP Set prices by clicking directly on the chart


💡 Tips
  1. Set your levels in order: Entry → Stop Loss → Take Profit by clicking on the chart.
  2. It is recommended to only consider trades where R:R is at least 1:2 or higher.
  3. Always check the position size and required margin to avoid over-leveraging.
  4. Enable the B/S Signal alert condition to receive notifications at entry and exit points.


⚠️ Important Notes
Please review the entry detection logic below before using this indicator.

1. Entry signals are triggered by high/low touch, not by candle close.
If the entry price falls within the high-to-low range of the current forming candle, a signal may fire even if the closing price has not yet reached the entry level. Always verify actual order fills manually.

2. A ⚠️ Market Entry warning is shown when a market order is detected.
If the following conditions are met, the indicator assumes a market entry has likely already occurred and displays a warning on the entry label.

  • Long position — The current candle opened below the entry price
  • Short position — The current candle opened above the entry price


B/S signals are not displayed when a market entry is detected. Additionally, the actual fill price may differ from the configured entry price, so always confirm directly.
لقطة

3. B/S Signal Label Behavior
B (Buy) or S (Sell) signals are only displayed on the chart when limit entry conditions are met. When the indicator detects a market entry (Warning state), it considers the position already entered and therefore no B/S signal label is generated.

🛠️ How to Set Up
  1. Capital & Risk — Enter your total capital and the risk percentage you are willing to accept per trade.
  2. Position Settings — Click on the chart in order: Entry Price → Stop Loss → Take Profit to define your range, then confirm.
  3. UI & Colors — Adjust colors and table position to match your personal chart theme.
ملاحظات الأخبار
Label Position Improvement — Fixed an issue where labels were fixed to the center of the line during an active position, causing them to be obscured by candles. Labels now stick to the right side of the chart while the position is open, and move back to the center of the line once the position is closed upon reaching TP/SL.
لقطة
لقطة

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

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