Installation
-
Copy RR_TradePanel_EA.ex5 to:
<MT5 Data Folder>\MQL5\Experts\ - Open the chart for the instrument you want to trade.
- Drag the EA from the Navigator panel onto the chart or right-click the EA and select "Attach to a chart".
-
In the EA settings:
- Configure your preferred inputs
- Enable Allow Algo Trading
- Click OK
- Ensure the MT5 Algo Trading button is green.
Input Parameters (EA Settings)
Risk Management
-
Enable Automatic Lot Sizing
Automatically calculates lot size using account balance and risk percentage. -
Risk Per Trade (%)
Default: 1.0% -
Fixed Lot Size
Default: 0.10
RR Tool Target
-
Default Risk:Reward
Default: 2.0 — seed ratio used to auto-place the Target line whenever a direction is chosen or the tool is reseeded.
Instant Order (One-Click) SL/TP
A separate SL/TP configuration used only by the one-click Buy/Sell buttons — independent from the RR overlay tool.
- Enable Stop Loss / Enable Take Profit — both on by default
- SL/TP Basis — Fixed Pips or ATR Multiple (default: ATR Multiple)
- Fixed Pips — SL 20.0 / TP 40.0 (used only in Fixed Pips mode)
- ATR Multiples — SL 1.0× / TP 2.0× ATR(14) (used only in ATR mode)
Execution Settings
-
Trade Comment
Optional text attached to orders. -
Enable Popup Alerts
Displays MT5 popup notifications for events.
Break-Even Settings
- Break-even trigger by pips or TP percentage
- Automatic stop movement to entry price
- Optional profit lock offset
Trailing Stop Settings
- Trailing activation trigger
- Trailing distance configuration
- Trailing step filtering
Partial Close Settings
- Four TP-side automatic partial closes (TP1–TP4)
- Two defensive SL-side partial closes (SL1–SL2)
- All six levels are disabled by default — configured live on the Trade Automation page
- Default triggers: TP1 20% / TP2 40% / TP3 60% / TP4 80% of target distance; SL1 50% / SL2 80% of stop distance
- Close Lot mode (default) or Close % mode — switching modes resets close-amount fields to a sane default for that mode
- Manual Close X% configuration (always a percentage, independent of the TP/SL mode)
RR Tool Appearance
- Custom RR colours
- Overlay font sizing
- RR tool width adjustment
- Movable panel positioning
Misc
- EA Magic Number — Default: 77777
- Maximum Slippage — Default: 5 points
Step-by-Step Trade Planning
Step 1 — Open the Panel
The panel opens automatically when the EA loads. If closed, click the small [RR] button.
Step 2 — Trade setup
Click:
- button between buy and sell to bring up the RR overlay drawing
The EA then draws:
- Green block → Take Profit
- Blue block → Entry
- Red block → Stop Loss
Step 3 — Set Price Levels
You can configure prices using multiple methods:
- Drag RR blocks directly on the chart
- Drag horizontal lines
- Type prices into the panel
Step 4 — Review Analysis
The panel displays:
- Live R:R ratio
- Trade quality badge
- Estimated reward and risk
- Calculated lot size
- Detected order type
Step 5 — Automatic Order Detection
- Market Order
- Buy/Sell Stop
- Buy/Sell Limit
Order type is detected automatically based on entry location relative to market price.
Step 6 — Execute Trade
Click the execution button to place the trade with:
- Calculated lot size
- Take Profit
- Stop Loss
Anchor / Market Price Lock
The RR overlay includes an anchor button (⚓).
-
Anchor ON
Entry follows live market price automatically. -
Anchor OFF
Entry remains fixed at the manually selected price.
RR Lock
The RR Panel also includes an RR Lock toggle 🔒.
-
RR Lock ON
Captures the current Target:Stop ratio. Dragging either the TP or SL block afterwards automatically rescales the other side to preserve that ratio. -
RR Lock OFF
TP and SL move independently.
Order Management Page
Access the management page using the ◄ / ► arrows in the panel header (page 2 of 3) — there is no gear icon.
Exposure Summary
- Current symbol
- Open exposure
- Pending orders
- Floating P/L
Manual Actions
- BE Now
- Trail Now
- Close X%
- Cancel Pending
- Close buy/sell
- Close Positions
Virtual SL/TP
Virtual SL/TP hides broker-side stop loss and take profit levels.
The EA internally monitors price and closes positions automatically when virtual levels are reached.
- Broker SL/TP removed
- Internal EA monitoring
- Virtual chart lines displayed
- Automatic market close on trigger
Automation Controls
- Auto Break-Even
- Auto Trailing Stop
Automatic Partial Close Logic
The EA supports six independent partial-close stages, configured on the Trade Automation panel page. All six are disabled by default.
- TP Partial #1 – #4 (default triggers: 20% / 40% / 60% / 80% of target distance)
- SL Defensive Partial #1 – #2 (default triggers: 50% / 80% of stop distance)
- Each level's close amount is interpreted as a lot size in Close Lot mode (default), or a percentage in Close % mode
Each stage only triggers once per position and uses internal tracking variables.
Lot Size Calculation
When automatic lot sizing is enabled:
- Risk amount is calculated from account balance
- Stop distance is measured in pips
- Pip value is calculated
- Final lot size is normalised to broker rules
The EA automatically handles 3-digit and 5-digit broker pricing.
Chart Behaviour
- Chart grid hidden
- Broker trade levels hidden
- Chart shift enabled
- Mouse-drag support for RR blocks
Panel Navigation
- Header Bar → Drag panel position
- ◄ / ► → Move between the panel's 3 pages
- ✕ Button → Collapse panel
- [RR] → Reopen panel
The 3 panel pages:
- RR Tool — direction, price levels, sizing, R:R analysis, execute button
- Order Management — exposure summary, manual partial close, cancel/close actions, Virtual SL/TP
- Trade Automation — Auto BE/Trailing controls,per-level TP1–4 / SL1–2 configuration, Close Lot vs Close % mode switch
RR Quality Badge Reference
- POOR → R:R below 1.0
- OK → R:R between 1.0 – 1.49
- GOOD → R:R between 1.5 – 1.99
- GREAT → R:R above 2.0
Known Limitations & Notes
- Single symbol per EA instance
- Management applies to all positions on the symbol
- Virtual SL/TP requires continuous EA operation
- Global variable tracking persists after restart
- Broker filling mode compatibility may vary
- Slippage setting uses points, not pips
Quick-Start Checklist
- EA compiled successfully
- Algo Trading enabled
- EA attached correctly
- Risk settings reviewed
- Magic number configured
- Colours customised if desired
- Break-even and trailing reviewed
- Partial close settings reviewed
- Tested on demo before live use