Trade Assistant Risk Calculator MT5
Trade Assistant Risk Calculator is an all-in-one floating trading panel (Expert Advisor) designed for professional manual traders on MetaTrader 5. It combines Visual Chart Trading, Automatic Risk Calculation, and Advanced Position Management into a single, compact interface.
Stop calculating lot sizes manually. Stop guessing your Risk:Reward ratio. Simply drag lines on the chart, and the EA calculates the exact lot size to match your risk percentage, equity, or money target.
Important Notes
- This is an Expert Advisor (EA), not an indicator. Attach it to any chart to activate the floating panel.
- Algo Trading must be enabled in MetaTrader 5 (Options → Expert Advisors → Allow Algo Trading) for the EA to place and manage orders.
- The panel is draggable (click and hold the title bar) and minimizable (click the "–" button on the title bar).
- Works on live accounts and demo accounts. The Strategy Tester does not support chart-event-based EAs — please use a demo account for testing.
- Supports Hedging and Netting account types.
Key Features
1. Visual Order Placement & Interactive Chart Overlay
- Drag & Drop Trading: Three interactive trend lines (Entry, Stop Loss, Take Profit) appear on your chart spanning 40% of chart width. Simply drag them to your desired levels.
- Instant Calculation: As you move the Stop Loss line, the panel automatically recalculates the Lot Size to keep your risk constant (e.g., 1% of Balance).
- Live R:R Display: See your Risk-to-Reward ratio in real-time as you adjust your Take Profit line.
- Market & Pending Orders: Supports both instant execution and pending orders (Buy/Sell Limit & Stop) with a single click. Toggle between Market (M) and Pending (S) mode directly from the chart overlay. Pending orders support a configurable expiry timer.
- Interactive Chart Drag Bars: Each line (Entry, TP, SL, and all partial levels) has a floating overlay bar that displays the current price, pips distance, and dollar profit/loss in real-time. Drag any bar to move its corresponding line — no need to click the tiny line itself.
- Entry Bar Quick Actions: The Entry drag bar includes B/S (flip direction), Cmd (execute order), M/S (market/pending toggle), R (cycle risk mode), and X (remove all lines) buttons — all accessible directly on the chart.
- Color-Shaded Profit/Loss Zones: Semi-transparent green (profit) and red (loss) fill zones between Entry, TP, and SL lines provide instant visual feedback of your trade setup.
- Color-Coded Order Overlays: Each on-chart order card uses a distinct background tint and bullet marker so you can tell its state at a glance — green-tinted “●” for filled positions, purple-tinted “○” for broker pending orders, and blue-grey for virtual pending orders. Filled positions that originated from a virtual pending also carry a [VP] tag in the entry row.
- Live Unrealised P/L Badge: Every filled position shows its current floating P/L on its entry overlay in both money and pips, color-coded green when in profit and red when in loss. The badge sits on its own row inside the entry card so it never overlaps the order info, and it updates every tick with swap and commission included.
- Lock Buttons: Lock the TP or SL to a specific price level using the "L" button on each drag bar, preventing accidental movement.
- Order Options Quick Access: The OCO (One-Cancels-Other), Hide SL/TP, and Virtual Pending toggles are available directly in the Trade tab as a compact three-button row — no need to navigate to another tab for these frequently used options.
- Timeframe Persistence: Entry, Stop Loss, and Take Profit lines retain their exact positions when you switch chart timeframes — no recalculation, no reset. Your trade setup survives timeframe changes intact.
2. Buy/Sell Direction Flip with Smart Mirror
- One-Click Flip: The B/S button on the Entry drag bar instantly flips the entire trade setup between Buy and Sell.
- Automatic Mirror: SL and TP lines mirror symmetrically around the entry price, preserving your risk-to-reward geometry.
- Partial Lines Follow: All active partial TP/SL levels (TP1–TP10, SL1–SL10) automatically reposition to the correct side when the direction flips — whether triggered by the B/S button or by dragging SL past the entry price.
- Auto-Flip on Drag: Dragging the TP line below entry (Buy) or above entry (Sell) automatically flips the direction and mirrors the SL to match. Same for dragging SL past entry.
3. Professional Risk Management
- 4 Risk Modes with Memory:
- % Balance: Risk a specific percentage of your account balance (e.g., 1.0%).
- % Equity: Risk a specific percentage of your current equity — ideal for accounts with open positions.
- $ Money: Risk a fixed dollar amount per trade (e.g., $50).
- Fixed Lots: Trade with a manual fixed lot size.
- Pips vs. Price Input Mode: Toggle between entering absolute price levels or pip distances from entry. In Pips mode, SL and TP are automatically calculated relative to entry.
- Spread Limit: Set a maximum allowed spread (in pips). The EA blocks any new trade when the current spread exceeds your threshold, protecting you from high-spread slippage.
- Real-Time Spread Display: Current bid-ask spread is shown on the TRADE tab and updates every tick.
- Order Confirmation Dialog: Before execution, review order type, lot size, account balance, risk amount, margin required, and entry/SL/TP prices. Includes a "Disable confirmation" option for experienced traders who want faster execution.
- Custom Order Comment: Enter a custom comment for each order directly from the TRADE tab, making it easy to tag and track your trades.
- Daily Loss Lock: Protect your capital with daily loss limits. If your daily loss exceeds a set amount or percentage, the EA can automatically close trades and lock the panel to prevent "revenge trading." Supports locking by current symbol or all symbols. Lock resets automatically at daily rollover.
4. PARTS Tab — Multi-Level Partial Close System
- Up to 10 Take Profit Levels (TP1–TP10) and 10 Stop Loss Levels (SL1–SL10), each independently configurable.
- Per-Level Controls: Each level has an activation toggle, lot percentage (% of position to close), and pips trigger (distance from entry).
- Chart Visualization: Activated partial levels draw dashed lines on the chart with interactive drag bars showing the level's price, pips, USD value, and close percentage in real-time.
- Drag to Adjust: Drag any partial level bar directly on the chart. The panel fields update automatically in both directions — drag a line to update the panel, or edit the panel to move the line.
- Drag Priority: When partial level bars overlap with the main Entry/TP/SL bars, partial levels always take drag priority, preventing accidental movement of main lines.
- Smart Clamping: Partial TP lines cannot be dragged past entry into loss territory, and partial SL lines cannot be dragged past entry into profit territory. Lines snap to entry at the boundary. Additionally, each partial TP level is enforced to stay at least 1 pip below the full TP price, and each partial SL level stays at least 1 pip above the full SL price — ensuring proper execution order for both planning lines and placed-order overlay bars.
- Per-Order Independent Levels: Every placed position, pending order, and virtual pending order maintains its own independent TP1–10 and SL1–10 pip distances. Dragging a partial level bar on one order does not affect any other order — each order can have a completely different partial close structure.
- Overlay Bars on Placed & Pending Orders: TP1–10 and SL1–10 overlay bars are rendered directly on the chart for all filled positions, pending orders, and virtual pending orders. Each bar shows the trigger price, pip distance, USD value, and close percentage. Bars are fully draggable with the same 1-pip boundary clamping.
- Input Validation: When entering pips values in the PARTS panel, the EA validates that the value leaves at least 1 pip gap from the full TP or SL distance. If the entered value is too large, the input box turns red, the value resets to 0, and the level is deactivated — providing immediate visual feedback of an invalid entry.
- Lines OFF Auto-Reset: Clicking the LINES: OFF button automatically resets the PARTS panel planning values (TP1–10 and SL1–10 fields reset to 0) and deactivates both the "TP in parts" and "SL in parts" master toggles — giving you a clean slate for the next new order. Already-placed positions, pending orders, and virtual pending orders retain their individual TP1–10 / SL1–10 settings unaffected.
- Proportional USD Display: Each partial level's drag bar shows the USD profit/loss based on that level's lot percentage — not the full position size. For example, a TP2 set to close 20% of 1.0 lots displays the USD value for 0.2 lots, giving you an accurate per-level P&L view.
- Timeframe Persistence: All partial TP and SL levels are preserved when you switch chart timeframes or change chart parameters — no need to reconfigure your partial levels after changing to a different timeframe.
- Dynamic Spacing: Auto-calculate evenly spaced levels with configurable starting intervals. Separate toggles for TP and SL dynamic spacing.
- RESET & APPLY: Clear all partial triggers instantly or apply settings and redraw all levels with one click.
5. BE Tab — Breakeven & Pending Order Management
- Auto Breakeven: Automatically moves Stop Loss to breakeven after a configurable profit trigger (in pips), with an adjustable offset.
- Auto-Offset: Calculates the optimal breakeven offset by analyzing the current spread + estimated commission from your 30-day deal history. Ensures breakeven truly breaks even after costs.
- Pending Limit Trail: Automatically trail BUY_LIMIT / SELL_LIMIT orders closer to market price as price moves favorably. Configurable in pips with +/- adjustment buttons.
- Pending Stop Trail: Separately trail BUY_STOP / SELL_STOP orders, keeping them at an optimal distance from market.
- OCO (One-Cancels-Other): Automatically cancels other pending orders on the same symbol when one is triggered.
- Hide SL/TP: Send market orders without SL/TP to the broker. The EA manages stops virtually — useful for accounts with SL/TP restrictions.
- Virtual Pending Orders: EA-managed pending order queue. Orders are not sent to the broker until triggered, then automatically converted to market orders. Supports expiry timers.
- Per-Order Stealth Isolation: The Hide SL/TP and Virtual Pending toggles only affect new orders you place from now on — they never disturb orders that are already live. Each ticket carries its own independent virtual SL/TP state, so you can freely flip the panel toggles at any time without losing the TP/SL on any existing position or pending order, and orders placed under different toggle settings happily coexist on the same chart.
- Recompile- & Upgrade-Proof State: Virtual SL/TP for every Hide-SL position and every untriggered virtual pending order are persisted in two layers — a per-account file and hidden chart objects on the same chart window. After an EA recompile, version upgrade, or remove + re-attach, all virtual stops, take profits, and pending orders are restored automatically and continue to display and execute as before.
6. TRAIL Tab — 8-Mode Trailing Stop Engine
- 8 Trailing Stop Modes:
- NONE: Trailing disabled.
- PIPS: Classic fixed-distance trailing stop.
- HI/LO: Trail to previous bar's high (sell) or low (buy) — follows price structure.
- MA: Trail to a Moving Average (EMA/SMA/WMA with configurable period).
- SAR: Trail to Parabolic SAR (adjustable step and max).
- ATR: Volatility-based trailing using ATR multiplier × ATR value.
- PARTIAL: Combination trail + auto-close partial position at profit triggers.
- FRACTALS: Trail to fractal support/resistance levels for swing-based traders.
- Universal Settings: Start (minimum profit in pips before activation), Distance, and Step (minimum update increment to prevent jitter) apply across all modes.
7. CLOSE Tab — Bulk Position Management
- Close All: Close all open positions and delete all pending orders across all symbols.
- Close Symbol: Close all positions on the current chart symbol.
- Close Pending: Cancel all pending orders.
- Close All Buy: Close all buy positions across all managed symbols.
- Close All Sell: Close all sell positions across all managed symbols.
- Close Profitable: Close only positions currently in profit.
- Close Losing: Close only positions currently at a loss.
- Partial Close: Close a configurable percentage (10–99%) of each open position with one click.
- Auto-Close Targets: Set profit or loss targets (in $ or %) for the entire account or individual symbols. Positions close automatically when the target is reached.
- Lock All / Lock Symbol: Instantly block all new trading or block trading on the current symbol only — prevents impulsive entries.
8. INFO Tab — Account Dashboard
- Live Account Data: Balance, Equity, Floating P/L, Free Margin, and Margin % — all updating in real-time.
- Open Positions Summary: Total position count, total Buy lots, total Sell lots, and current-symbol P/L — giving you a quick snapshot of exposure.
- Daily Statistics: Day-start equity, today's P/L (color-coded green/red), and current lock status. Resets automatically at daily rollover.
- Symbol Switcher: Up to 6 configurable symbol buttons (via the InpSwitcherSymbols input parameter) to quickly switch the chart to frequently traded instruments.
- Hotkey Reference: All keyboard shortcuts are displayed for quick reference.
9. Tools
- Screenshot: Capture a full chart screenshot with one click. Saved automatically with symbol name and timestamp.
- Price Alert Line: Draw an alert line on the chart. When price crosses it, the EA triggers an audio and visual alert. The alert resets automatically so it can fire again on the next crossing.
- Cancel-at-Level: Draw a cancel level on the chart. When price reaches it, the EA automatically cancels all pending orders on the current symbol — perfect for invalidating setups at key price levels.
10. Entry Line Proportional Drag
- Dragging the Entry line moves SL, TP, and all active partial levels by the same amount — your entire trade geometry shifts together while preserving all distances and risk/reward ratios.
Hotkeys (Keyboard Shortcuts)
Speed up your execution with built-in hotkeys:
- B / S: Buy / Sell Market
- U / D: Buy / Sell Pending (Up/Down)
- C: Close All Positions
- X: Close All on Current Symbol
- P: Close All Pending Orders
- L: Lock Symbol Trading
- A: Lock All Trading
- T: Toggle Trailing Stop
- E: Toggle Breakeven
Input Parameters
- Risk Settings: Default Risk %, Fixed Risk $, Default R:R Ratio, Max Spread Limit.
- Stealth Settings: Enable Virtual Pending or Virtual SL/TP.
- Management: Breakeven Trigger/Offset, Trailing Stop Mode/Distance/Step, Magic Number, Manage All Symbols.
- Auto-Close Rules: Profit/Loss targets in money or % to auto-close positions.
- Time Filters: Configure trading hours and days (including crypto weekends).
- Visuals: Customize line colors and panel position.
- Symbol Switcher: Configure up to 6 symbols for the one-click symbol switcher (comma-separated list).
Why Choose Trade Assistant Risk Calculator?
Whether you are a scalper needing speed or a swing trader needing precision, this tool handles the math so you can focus on the price action. With up to 10 partial take-profit and 10 partial stop-loss levels, interactive chart overlays, 8 trailing stop modes, and smart direction-flip mirroring, it enforces discipline with risk limits and simplifies complex order management.
Take control of your trading today with Trade Assistant Risk Calculator.
