Installation

  1. Copy RR_Tool_EA.mq5 to:
    <MT5 Data Folder>\MQL5\Experts\
  2. Open the file in MetaEditor and press F7 to compile. Ensure there are no errors.
  3. Open the chart for the instrument you want to trade.
  4. Drag the EA from the Navigator panel onto the chart or right-click the EA and select "Attach to a chart".
  5. In the EA settings:
    • Configure your preferred inputs
    • Enable Allow Algo Trading
    • Click OK
  6. Ensure the MT5 Algo Trading button is green.
Note: The EA operates on a single chart symbol per instance. For multi-symbol trading, attach a separate EA instance to each chart.

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

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

  • Two TP-side automatic partial closes
  • One defensive SL-side partial close
  • Manual Close X% configuration

RR Tool Appearance

  • Custom RR colours
  • Overlay font sizing
  • RR tool width adjustment
  • Movable panel positioning

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 — Choose Direction

Click:

  • ▲ LONG for buy trades
  • ▼ SHORT for sell trades

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
  • Use the Set button and click on chart
Important: LONG setups require TP above Entry and SL below Entry. SHORT setups require TP below Entry and SL above Entry.

Step 4 — Review Analysis

The panel displays:

  • Live R:R ratio
  • Trade quality badge
  • Estimated reward and risk
  • Risk/Reward pip values
  • 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

Step 7 — Reset or Cancel

  • Reset → Resets RR levels
  • Cancel → Removes overlay without placing a trade

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.

Order Management Page

Access the management page using the gear icon in the panel header.

Exposure Summary

  • Current symbol
  • Open exposure
  • Pending orders
  • Floating P/L

Automation Controls

  • Auto Break-Even
  • Auto Trailing Stop

Manual Actions

  • BE Now
  • Trail Now
  • Close X%
  • Cancel Pending
  • 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
Important: MT5 and the EA must remain running while Virtual SL/TP is enabled.

Automatic Partial Close Logic

The EA supports multiple independent partial-close stages.

  • TP Partial #1
  • TP Partial #2
  • SL Defensive Partial

Each stage only triggers once per position and uses internal tracking variables.

Lot Size Calculation

When automatic lot sizing is enabled:

  1. Risk amount is calculated from account balance
  2. Stop distance is measured in pips
  3. Pip value is calculated
  4. 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
  • ⚙ Gear Icon → Switch pages
  • ✕ Button → Collapse panel
  • [RR] → Reopen panel

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