TradeInfoDisplay
- Utilitaires
- Version: 4.0
- Activations: 5
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TradeInfoDisplay – Risk/Reward Visualiser
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Visualises profit/loss zones, RR ratio, Risk% and Reward% for all
pending orders and positions directly on the chart. CPU-optimised.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
FULL DESCRIPTION
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TradeInfoDisplay draws colour-coded zones on the chart for every
pending order and open position, giving you instant visibility of:
✔ Risk:Reward ratio (RR 1:X)
✔ Profit amount in account currency
✔ Loss amount in account currency
✔ Risk as a percentage of account balance
✔ Reward as a percentage of account balance
────────────────────────────────────
HOW IT WORKS
────────────────────────────────────
Each trade is displayed as two rectangles:
Green zone → Entry to Take-Profit (Profit area)
Red zone → Entry to Stop-Loss (Loss area)
Labels are placed at TP, SL, and mid-zone, showing the relevant
statistics in your chosen verbosity style (Full / Short / Minimal).
PARTIAL SETUPS are supported:
• Only SL set → Loss zone only
• Only TP set → Profit zone only
• Neither → Trade is skipped (no clutter)
────────────────────────────────────
PENDING ORDER LAYOUT
────────────────────────────────────
Pending orders are automatically:
1. SORTED by proximity to current price
(closest order gets the first slot, right after the current bar)
2. SPACED into non-overlapping time slots
(configurable width and gap in bars)
This prevents rectangles from stacking on top of each other when
multiple pending orders exist at different price levels.
────────────────────────────────────
PERFORMANCE (CPU-FRIENDLY)
────────────────────────────────────
• Runs on every tick but redraws ONLY when:
– A new bar opens, OR
– A trade changes (price / SL / TP / volume / count)
• Chart zoom / scroll triggers only ChartRedraw(), not a full pass
• Objects are created once and updated with ObjectMove() only
(no delete/recreate cycle every bar)
• Cached constants (tick value, digits, currency) set in OnInit()
• O(n) change detection with early exit on first mismatch
────────────────────────────────────
INPUTS
────────────────────────────────────
Colours
ClrProfit Profit zone fill (default: mint green)
ClrLoss Loss zone fill (default: soft red)
ClrTxtProfit Profit label colour (default: dark green)
ClrTxtLoss Loss label colour (default: dark red)
Layout
FontSz Label font size (pt) (default: 9)
PendWidth Pending rect width (bars) (default: 5)
PendGap Gap between pending rects (default: 5)
PosExtend Position rect right-extend(default: 30)
Labels
LabelStyle Full / Short / Minimal (default: Short)
────────────────────────────────────
NOTES
────────────────────────────────────
• Display-only — does NOT place or modify any orders
• "Allow Live Trading" does NOT need to be enabled
• Compatible with all symbols, timeframes, and account modes
• MT5 only (not MT4)
• No DLL calls or external dependencies
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TAGS (MQL5 Market)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
risk reward, RR, risk management, stop loss, take profit,
pending order, position, money management, trade visualiser,
risk percent, reward percent, chart indicator
