ExpertRider Expert Advisor User Guide

Version: 1.8
Copyright: 2025, TradeStaq Technologies
Platform: MetaTrader 5
Product Link: https://www.mql5.com/en/market/product/147936


Table of Contents

  1. Overview
  2. Key Features
  3. Installation & Setup
  4. Configuration Parameters
  5. Trading Modes
  6. Understanding the Strategy
  7. Risk Management Settings
  8. Optimization Guide
  9. Troubleshooting
  10. Best Practices

Overview

ExpertRider is an advanced automated trading system designed for MetaTrader 5 that uses multi-timeframe analysis, dynamic position management, and adaptive risk controls to identify and capitalize on trading opportunities.

What Makes ExpertRider Different?

  • Adaptive Position Sizing: Automatically adjusts trade sizes based on market conditions and account balance
  • Multi-Layer Market Analysis: Evaluates market structure across multiple timeframes for high-probability setups
  • Intelligent Entry Spacing: Uses market volatility to determine optimal entry points
  • Flexible Exit Strategies: Supports full closes, partial profit-taking, and structure-aware stops
  • Multiple Account Types: Works with both netting and hedging accounts

Key Features

Smart Market Analysis

  • Analyzes price action across three configurable timeframes
  • Identifies market structure and key price levels
  • Adapts to changing volatility conditions
  • Detects momentum shifts and trend changes

Dynamic Position Management

  • Automatic lot sizing based on account balance or fixed value
  • Progressive position building at strategic price levels
  • Adaptive spacing between entries based on market volatility
  • Optional lot multiplication in key market zones

Advanced Risk Controls

  • Multiple stop-loss strategies (full close, partial reduction, range-based, structure-aware)
  • Real-time margin monitoring and protection
  • Cooldown periods to prevent overtrading
  • Maximum exposure limits

Flexible Profit-Taking

  • Full position closes at major targets
  • Partial profit-taking for consistent gains
  • Momentum-based exit signals
  • Structure-aware take-profit placement

Installation & Setup

Requirements

  • MetaTrader 5 (latest version recommended)
  • Minimum account balance: $1,000+ recommended
  • Stable internet connection (VPS recommended for 24/7 operation)
  • Works with any tradable instrument (Forex, Crypto, Indices, Commodities)

Installation Steps

  1. Install the EA:

    • Copy ExpertRider.mq5 to your MT5 Experts folder
    • Restart MT5 or compile in MetaEditor
  2. Attach to Chart:

    • Open your desired trading instrument
    • Drag EA from Navigator window onto chart
    • Configure parameters in the inputs dialog
  3. Enable Automated Trading:

    • Click the "Algo Trading" button in MT5 toolbar
    • Verify EA shows a smiling face icon (active)
    • Check Experts tab for initialization messages

Quick Start Settings

For Beginners (Conservative):

TRADE_MODE = TRADE_LONG (or TRADE_SHORT for bearish markets)
MF_TRADING_LIMIT = 100.0
BASE_DCA_PERCENT = 1.0
ENABLE_STOP_LOSS = true
STOP_LOSS_PERCENT = 2.0
ENABLE_SCALPING = false

For Experienced Traders (Balanced):

TRADE_MODE = TRADE_AUTO
MF_TRADING_LIMIT = 500.0
BASE_DCA_PERCENT = 0.8
ENABLE_STOP_LOSS = true
ENABLE_SCALPING = true
ENABLE_DCA_MULTIPLIER = true

Configuration Parameters

Timeframe Settings

These settings control which timeframes the EA uses for market analysis:

ParameterDefaultPurpose
ShortPeriodM5Quick market signals and entry timing
MediumPeriodH4Trend confirmation and structure
LongPeriodD1Overall market direction

How to Configure:

  • Scalping: M1, M15, H1 (faster signals)
  • Day Trading: M5, H1, H4 (balanced)
  • Swing Trading: H1, H4, D1 (longer-term)

Capital & Position Sizing

Controls how much capital is used per trade:

ParameterDefaultDescription
MF_TRADING_LIMIT10.0Base trade size amount
MF_CAPITAL10000.0Reference account size
TRADING_LIMIT_TYPEvalueHow to calculate trade size

TRADING_LIMIT_TYPE Options:

  • value: Uses MF_TRADING_LIMIT as fixed dollar amount per trade

    • Example: MF_TRADING_LIMIT = 100 means $100 per trade
  • balance_multiplier: Uses MF_TRADING_LIMIT as percentage of balance

    • Example: MF_TRADING_LIMIT = 0.02 means 2% of account per trade

Recommended Settings:

  • Small Accounts ($1K-$5K): Use value with $50-$200 per trade
  • Medium Accounts ($5K-$20K): Use balance_multiplier with 0.01-0.03
  • Large Accounts ($20K+): Use balance_multiplier with 0.005-0.02

Entry Spacing & DCA Settings

Controls how the EA spaces multiple entries:

ParameterDefaultDescription
BASE_DCA_PERCENT1.0Base distance between entries (%)
DCA_QUOTIENT1Entry frequency in normal conditions
BATTLEGROUND_DCA_QUOTIENT3Entry frequency in contested zones
ENFORCE_DCA_MIN_STEPtrueRequire minimum distance between entries
ENFORCE_DCA_MIN_STEP_QUOTIENT1.0Multiplier for minimum step

Understanding Entry Spacing:

The EA automatically adjusts entry spacing based on:

  • Current market volatility
  • Distance from key price levels
  • Overall market trend strength
  • Your margin usage

Configuration Tips:

  • Tight Spacing (0.5-0.8%): More entries, faster position building
  • Normal Spacing (1.0-1.5%): Balanced approach
  • Wide Spacing (2.0-3.0%): Fewer entries, more selective

BATTLEGROUND_DCA_QUOTIENT should typically be 2-3x higher than DCA_QUOTIENT to be more cautious in uncertain price zones.


Position Multiplier Settings

Allows increasing position sizes at strategic levels:

ParameterDefaultDescription
ENABLE_DCA_MULTIPLIERfalseEnable lot size multiplication
DCA_MULTIPLIER0.5(Deprecated) Use MAX instead
MAX_DCA_MULTIPLIER3Maximum lot multiplication factor
DCA_MULTIPLIER_RANGE7Market level where multiplier activates
BULLISH_DCA_MULTPLIER_RANGE5Range in trending conditions

How Multipliers Work:

When price reaches significant levels, the EA can increase position size to:

  • Capitalize on high-probability reversal zones
  • Build positions more aggressively at value prices
  • Reduce average entry cost more quickly

Risk Warning: Multipliers increase exposure rapidly. Start with MAX_DCA_MULTIPLIER = 1.5-2.0 and test thoroughly.

Recommended Usage:

  • Beginners: ENABLE_DCA_MULTIPLIER = false
  • Intermediate: MAX_DCA_MULTIPLIER = 2.0
  • Advanced: MAX_DCA_MULTIPLIER = 3.0-4.0 (with small base size)

Profit Target Settings

Controls when positions are closed for profit:

ParameterDefaultDescription
GAIN0.3Fixed profit target (%) when AUTO_GAIN disabled
AUTO_GAINtrueCalculate targets based on market volatility
MIN_FULL_PROFIT2.0Minimum profit for full position close (%)
MIN_PARTIAL_PROFIT0.3Minimum profit for partial close (%)
PROFIT_QUOTIENT4.0Volatility multiplier for full profit targets
PARTIAL_PROFIT_QUOTIENT2.0Volatility multiplier for partial targets

Understanding AUTO_GAIN:

When enabled, the EA calculates dynamic profit targets:

  • Low Volatility: Smaller targets (faster exits)
  • High Volatility: Larger targets (room to run)
  • Always respects minimum thresholds

Configuration Examples:

Conservative (Quick profits):

AUTO_GAIN = false
GAIN = 0.5
MIN_FULL_PROFIT = 1.0

Balanced (Dynamic):

AUTO_GAIN = true
MIN_FULL_PROFIT = 2.0
PROFIT_QUOTIENT = 4.0

Aggressive (Larger targets):

AUTO_GAIN = true
MIN_FULL_PROFIT = 3.0
PROFIT_QUOTIENT = 6.0

Stop Loss Configuration

Protects against excessive losses:

ParameterDefaultDescription
ENABLE_STOP_LOSSfalseEnable stop-loss protection
STOP_LOSS_PERCENT2.0Loss threshold to trigger stop (%)
STOP_LOSS_THRESHOLD50.0Margin level for activation (%)
STOP_LOSS_SELL_TYPEFULLType of stop-loss action
STOP_LOSS_SHARP_LEVEL2Level sensitivity for structure-aware stops
STOP_LOSS_RANGE8Range parameter for range-based stops
STOP_LOSS_RANGE_MULTIPLIER5Distance multiplier for range stops

Stop-Loss Types Explained:

  1. FULL - Complete Position Close

    • Closes all positions when loss reaches threshold
    • Simple and immediate protection
    • Recommended for beginners
  2. REDUCE - Partial Position Close

    • Reduces position size to bring margin back to safe level
    • Keeps you in the trade with smaller exposure
    • Good for trending markets
  3. RANGE - Distance-Based Stop

    • Triggers when price moves beyond critical levels
    • Uses market structure for validation
    • More sophisticated protection
  4. SHARP - Structure-Aware Stop

    • Places stops near key market levels
    • Adapts to current market structure
    • Best for experienced traders

Recommended Settings:

Conservative:

ENABLE_STOP_LOSS = true
STOP_LOSS_PERCENT = 1.5
STOP_LOSS_SELL_TYPE = FULL

Moderate:

ENABLE_STOP_LOSS = true
STOP_LOSS_PERCENT = 2.0
STOP_LOSS_SELL_TYPE = REDUCE

Advanced:

ENABLE_STOP_LOSS = true
STOP_LOSS_PERCENT = 2.5
STOP_LOSS_SELL_TYPE = SHARP

Margin & Safety Settings

Controls risk exposure limits:

ParameterDefaultDescription
SAFE_MARGIN_PERCENT100.0Maximum margin usage for new trades (%)
BEARISH_MARGIN_PERCENT5.0Special threshold for adverse conditions
IN_POSITION_MARGIN2.0Margin multiplier for position calculations

Understanding Margin Controls:

  • SAFE_MARGIN_PERCENT: Prevents opening new trades when margin usage exceeds this level
  • Lower values = More conservative (recommended 40-60% for safety)
  • Higher values = More aggressive (80-100% for growth)

Risk Levels:

  • Ultra Conservative: 30-40%
  • Conservative: 40-60%
  • Moderate: 60-80%
  • Aggressive: 80-100%

⚠️ Warning: High margin usage increases liquidation risk. Never use more than 80% unless you fully understand the risks.


Trading Control Parameters

Basic on/off controls for trading operations:

ParameterDefaultDescription
TRADE_MODETRADE_LONGOverall trading direction
BUY_ENABLEDtrueAllow opening long positions
SELL_ENABLEDtrueAllow opening short positions
magicTimer120Cooldown between trades (seconds)
MIN_VOLUME_TO_SELL0.05Minimum lot size for closing
STOP_AFTER_SELLfalsePause trading after closing position

Magic Timer Explained:

Prevents overtrading by enforcing minimum time between entries:

  • 30-60 seconds: Very active (scalping)
  • 120-300 seconds: Moderate (default)
  • 600+ seconds: Conservative (swing trading)

Market Level Configuration

Controls which market levels trigger actions:

ParameterDefaultDescription
LAUNCHPAD_TRADE_INDEX1Entry level for long positions
FIREWALL_TRADE_INDEX1Entry level for short positions
CLOSE_LONG_RANGE4Exit level for long positions
CLOSE_SHORT_RANGE4Exit level for short positions
PARTIAL_SELL_CLOSE_RANGE2Level for partial profit-taking
TRADE_RANGE14Maximum level depth to consider
EXTREME_BEAR_TRADE_INDEX10Level for extreme bearish conditions
MODERATE_BEAR_TRADE_INDEX7Level for moderate bearish conditions

Understanding Level Indices:

The EA analyzes market structure at multiple levels (1-14):

  • Level 1-3: Very short-term (minutes to hours)
  • Level 4-7: Short-term (hours to days)
  • Level 8-11: Medium-term (days to weeks)
  • Level 12-14: Long-term (weeks to months)

Configuration Strategy:

Aggressive Trading:

LAUNCHPAD_TRADE_INDEX = 1
CLOSE_LONG_RANGE = 2
PARTIAL_SELL_CLOSE_RANGE = 1

Conservative Trading:

LAUNCHPAD_TRADE_INDEX = 3
CLOSE_LONG_RANGE = 7
PARTIAL_SELL_CLOSE_RANGE = 4

Balanced Trading:

LAUNCHPAD_TRADE_INDEX = 2
CLOSE_LONG_RANGE = 4
PARTIAL_SELL_CLOSE_RANGE = 2

Scalping & Partial Profit Settings

Controls how the EA takes partial profits:

ParameterDefaultDescription
ENABLE_SCALPINGtrueEnable partial profit-taking
PARTIAL_REDUCE_RATIO0.5Portion of position to close (0-1)
PARTIAL_SELL_COOLDOWN_MINUTES1.0Minutes between partial closes

How Partial Profits Work:

Instead of closing entire position, the EA can:

  1. Close a percentage of the position
  2. Lock in some profits
  3. Let remainder run for bigger gains

PARTIAL_REDUCE_RATIO Examples:

  • 0.3: Close 30% of position
  • 0.5: Close half the position
  • 0.7: Close 70%, keep 30% running

Strategy Recommendations:

Quick Scalping:

ENABLE_SCALPING = true
PARTIAL_REDUCE_RATIO = 0.5
PARTIAL_SELL_COOLDOWN_MINUTES = 0.5
MIN_PARTIAL_PROFIT = 0.2

Swing Trading:

ENABLE_SCALPING = false
(Takes only full profits at larger targets)

Hybrid Approach:

ENABLE_SCALPING = true
PARTIAL_REDUCE_RATIO = 0.3
MIN_PARTIAL_PROFIT = 0.5

Hedging Mode Settings

For accounts that support hedging (holding both long and short simultaneously):

ParameterDefaultDescription
ENFORCE_HEDGE_ALLOWANCEfalseBalance long/short positions
LONG_HEDGE_RATIO0.3Target ratio of shorts to longs
SHORT_HEDGE_RATIO0.7Target ratio of longs to shorts
HEDGE_CLOSEfalseClose both directions together
MAX_UNHEDGED7Maximum position imbalance allowed

⚠️ Hedging Accounts Only - These settings only work if your broker account supports hedging.

Understanding Hedge Ratios:

Example with LONG_HEDGE_RATIO = 0.3:

  • If you have 10 lots long
  • EA will limit shorts to 3 lots (30% of longs)
  • Prevents excessive opposite exposure

When to Use Hedging:

  • ✅ Highly volatile markets
  • ✅ Uncertain direction
  • ✅ Want to profit from both directions
  • ❌ Beginners (use directional modes first)

Configuration Examples:

Balanced Hedge:

LONG_HEDGE_RATIO = 0.5
SHORT_HEDGE_RATIO = 0.5
HEDGE_CLOSE = true

Directional Bias:

LONG_HEDGE_RATIO = 0.3 (mostly long)
SHORT_HEDGE_RATIO = 0.7
HEDGE_CLOSE = false

Advanced Features

Special features for experienced traders:

ParameterDefaultDescription
ENABLE_CROSS_TRADEtrueUse trend crossover signals
ENABLE_WICK_TRADEfalseTrade based on candlestick patterns
WICK_TRADE_LEVEL7Minimum level for wick trading
SET_TPtrueAutomatically set take-profit orders
SET_SLtrueAutomatically set stop-loss orders
TP_MAX_LEVEL7Maximum level for TP placement
USE_HYBRID_TPtrueUse adaptive TP placement
MIN_ATR_PERCENT0.5Minimum volatility threshold (%)
ADX_THRESHOLD0Minimum trend strength (0-100)
PANIC_CLOSEfalseEmergency exit on strong reversals
DISABLE_PROTECTIONfalseBypass trend filters
DYNAMIC_TRADE_XfalseReserved for future use

Feature Explanations:

ENABLE_CROSS_TRADE:

  • Uses trend indicator crossovers for entries/exits
  • Recommended: true for most strategies

ENABLE_WICK_TRADE:

  • Looks for rejection candles (long wicks)
  • More aggressive, higher risk
  • Test thoroughly before enabling

SET_TP / SET_SL:

  • Automatically places TP/SL orders on broker
  • If false, EA manages exits internally
  • Keep true unless you have specific reasons

ADX_THRESHOLD:

  • Filters out low-trend conditions
  • 0 = No filter (default)
  • 20-25 = Only trade decent trends
  • 30+ = Only strong trends

PANIC_CLOSE:

  • Emergency exit when strong reversal detected
  • Use with caution, may exit prematurely
  • Good for very volatile instruments

Logging & Debugging

ParameterDefaultDescription
ENABLE_LOGGING"NO"Enable detailed logs
MAGIC_NUMBER100300Unique ID for EA orders

Logging Options:

  • "NO": Minimal logging (production use)
  • "DEBUG": Detailed logs (testing/troubleshooting)

Debug logs are saved to: MT5_Data/MQL5/Files/mfride-logs.txt

When to Enable Debug Logging:

  • Setting up EA for first time
  • Troubleshooting issues
  • Understanding EA decisions
  • Optimizing parameters

Trading Modes

TRADE_AUTO (Automatic Direction)

How it works:

  • EA analyzes market structure
  • Chooses long or short based on current conditions
  • Can switch directions as market changes

Best for:

  • Ranging markets
  • Uncertain direction
  • Hands-off trading

Netting Accounts:

  • Trades one direction at a time
  • Switches based on market signals

Hedging Accounts:

  • Can hold both long and short
  • Manages both independently

TRADE_LONG (Long Only)

How it works:

  • Only opens buy positions
  • Ignores short signals
  • Waits for long opportunities

Best for:

  • Bullish markets
  • Long-term uptrends
  • Assets with upward bias

Configuration Tips:

TRADE_MODE = TRADE_LONG
BUY_ENABLED = true
SELL_ENABLED = false  (redundant but safe)

TRADE_SHORT (Short Only)

How it works:

  • Only opens sell positions
  • Ignores long signals
  • Waits for short opportunities

Best for:

  • Bearish markets
  • Downtrends
  • Shorting opportunities

Configuration Tips:

TRADE_MODE = TRADE_SHORT
BUY_ENABLED = false  (redundant but safe)
SELL_ENABLED = true

TRADE_HEDGE (Hedging Mode)

⚠️ Requires hedging account

How it works:

  • Opens both long and short positions
  • Manages each direction independently
  • Can close both together on combined profit

Best for:

  • Very volatile markets
  • Advanced traders
  • Sophisticated strategies

Configuration Tips:

TRADE_MODE = TRADE_HEDGE
ENFORCE_HEDGE_ALLOWANCE = true
HEDGE_CLOSE = true
LONG_HEDGE_RATIO = 0.4
SHORT_HEDGE_RATIO = 0.6

Understanding the Strategy

How the EA Makes Decisions

1. Market Structure Analysis

The EA continuously analyzes:

  • Price Levels: Identifies key support and resistance zones
  • Trend Direction: Evaluates momentum across multiple timeframes
  • Volatility: Measures current market volatility for adaptive spacing
  • Market Strength: Assesses trend strength and reliability

2. Entry Conditions

The EA looks for multiple confirmations before entering:

Stage 1 Entries (Primary):

  • Price reaches identified opportunity zone
  • Momentum indicators align with direction
  • Trend confirmation across timeframes
  • Sufficient margin available
  • Cooldown period elapsed

Stage 2 Entries (Trend Following):

  • Strong trending conditions
  • No existing position in that direction
  • Momentum strongly aligned
  • Clear directional bias

Stage 3 Entries (Pattern Based):

  • Specific price rejection patterns detected
  • Multiple level confirmations
  • Counter-trend exhaustion signals
  • Additional validation from volatility

3. Position Building

When conditions remain favorable, the EA builds positions:

  • Spacing: Based on market volatility (wider in volatile markets)
  • Sizing: Can remain constant or increase at key levels
  • Limits: Respects maximum DCA counts and margin limits
  • Adaptation: Adjusts to changing market conditions

4. Exit Strategy

The EA uses multiple exit mechanisms:

Profit Exits:

  • Full close when major targets reached
  • Partial closes for incremental gains
  • Momentum-based exits on signal reversals
  • Structure-based exits near resistance/support

Risk Exits:

  • Stop-loss when threshold exceeded
  • Margin protection when usage too high
  • Emergency exits on strong reversals
  • Partial reductions to manage exposure

Key Concepts

Dynamic Volatility Adaptation

The EA adjusts its behavior based on current market volatility:

High Volatility:

  • Wider entry spacing
  • Larger profit targets
  • More cautious position building

Low Volatility:

  • Tighter entry spacing
  • Smaller profit targets
  • More frequent entries

Multi-Timeframe Confirmation

Decisions are validated across three timeframes:

Short Timeframe:

  • Entry timing
  • Quick momentum signals
  • Immediate price action

Medium Timeframe:

  • Trend confirmation
  • Structure validation
  • Overall direction

Long Timeframe:

  • Major trend bias
  • Long-term structure
  • Strategic direction

Adaptive Position Sizing

Position sizes adapt to:

  • Account balance changes
  • Current market volatility
  • Distance from key levels
  • Margin usage
  • Market confidence levels

Risk Management Settings

Setting Appropriate Risk Levels

Conservative Profile:

Account Size: Any
Risk per Trade: 0.5-1% of balance
Settings:
  TRADING_LIMIT_TYPE = balance_multiplier
  MF_TRADING_LIMIT = 0.005 - 0.01
  SAFE_MARGIN_PERCENT = 40
  ENABLE_STOP_LOSS = true
  STOP_LOSS_PERCENT = 1.5
  BASE_DCA_PERCENT = 1.5

Moderate Profile:

Account Size: $5,000+
Risk per Trade: 1-2% of balance
Settings:
  TRADING_LIMIT_TYPE = balance_multiplier
  MF_TRADING_LIMIT = 0.01 - 0.02
  SAFE_MARGIN_PERCENT = 60
  ENABLE_STOP_LOSS = true
  STOP_LOSS_PERCENT = 2.0
  BASE_DCA_PERCENT = 1.0

Aggressive Profile:

Account Size: $10,000+
Risk per Trade: 2-3% of balance
Settings:
  TRADING_LIMIT_TYPE = balance_multiplier
  MF_TRADING_LIMIT = 0.02 - 0.03
  SAFE_MARGIN_PERCENT = 80
  ENABLE_STOP_LOSS = true
  STOP_LOSS_PERCENT = 2.5
  BASE_DCA_PERCENT = 0.8
  ENABLE_DCA_MULTIPLIER = true

Position Size Calculator

Formula for Fixed Value:

Lot Size = MF_TRADING_LIMIT / (Price × Contract Size)

Formula for Balance Multiplier:

Trading Limit = Account Balance × MF_TRADING_LIMIT
Lot Size = Trading Limit / (Price × Contract Size)

Example:

  • Account: $10,000
  • MF_TRADING_LIMIT: 0.02 (2%)
  • BTC/USD Price: $50,000
  • Contract Size: 1.0
Trading Limit = $10,000 × 0.02 = $200
Lot Size = $200 / ($50,000 × 1.0) = 0.004 BTC

Optimization Guide

Finding Your Optimal Settings

Step 1: Start Conservative

Begin with safe settings and gradually adjust:

Initial Settings:
  TRADE_MODE = TRADE_LONG or TRADE_SHORT (choose one)
  MF_TRADING_LIMIT = 0.01 (1% of balance)
  TRADING_LIMIT_TYPE = balance_multiplier
  BASE_DCA_PERCENT = 1.5
  SAFE_MARGIN_PERCENT = 50
  ENABLE_STOP_LOSS = true
  ENABLE_SCALPING = true
  ENABLE_DCA_MULTIPLIER = false

Run for 1-2 weeks on demo account.

Step 2: Optimize Entry Spacing

Monitor how frequently EA enters trades:

Too Many Entries:

  • Increase BASE_DCA_PERCENT (1.5 → 2.0)
  • Increase magicTimer (120 → 300)
  • Increase LAUNCHPAD_TRADE_INDEX (1 → 2)

Too Few Entries:

  • Decrease BASE_DCA_PERCENT (1.5 → 1.0)
  • Decrease magicTimer (120 → 60)
  • Enable ENABLE_CROSS_TRADE = true

Step 3: Optimize Profit Targets

Monitor win rate and average profit:

Exits Too Early:

  • Increase MIN_FULL_PROFIT (2.0 → 3.0)
  • Increase PROFIT_QUOTIENT (4.0 → 5.0)
  • Increase CLOSE_LONG_RANGE (4 → 6)

Exits Too Late (Giving Back Profits):

  • Decrease MIN_FULL_PROFIT (2.0 → 1.5)
  • Enable more aggressive scalping
  • Decrease CLOSE_LONG_RANGE (4 → 3)

Step 4: Test Position Multipliers

Once comfortable with base strategy:

ENABLE_DCA_MULTIPLIER = true
MAX_DCA_MULTIPLIER = 1.5  (start small)
DCA_MULTIPLIER_RANGE = 7

Monitor for 1 week, then gradually increase MAX_DCA_MULTIPLIER to 2.0-3.0 if performing well.

Step 5: Optimize by Market Type

Trending Markets:

ENABLE_CROSS_TRADE = true
CLOSE_LONG_RANGE = 6-8 (let winners run)
ENABLE_SCALPING = false (or less aggressive)

Ranging Markets:

ENABLE_SCALPING = true
PARTIAL_REDUCE_RATIO = 0.5
CLOSE_LONG_RANGE = 3-4 (take profits quicker)

Volatile Markets:

BASE_DCA_PERCENT = 1.5-2.0 (wider spacing)
STOP_LOSS_PERCENT = 2.5-3.0 (more room)
MIN_FULL_PROFIT = 2.5-3.0 (larger targets)

Optimization Checklist

Before going live, verify:

  • Tested on demo for minimum 2 weeks
  • Positive results in various market conditions
  • Maximum drawdown acceptable (< 20% recommended)
  • Win rate reasonable for strategy type
  • No excessive margin usage (stayed below SAFE_MARGIN_PERCENT)
  • Stop-losses triggered appropriately
  • Profit targets being reached
  • No technical errors in logs
  • Position sizing appropriate for account
  • Comfortable with risk exposure

Troubleshooting

EA Not Opening Trades

Check These Settings:

  1. Trade Mode:

    • Verify TRADE_MODE matches market direction
    • If unsure, use TRADE_AUTO
  2. Enable Flags:

    • BUY_ENABLED = true (for longs)
    • SELL_ENABLED = true (for shorts)
  3. Cooldown Timer:

    • Check magicTimer - may need to wait
    • View last trade time in logs
  4. Margin:

    • Current margin < SAFE_MARGIN_PERCENT
    • Check margin ratio in terminal
    • Reduce position sizes if margin high
  5. Signal Conditions:

    • Market may not meet entry criteria
    • Enable ENABLE_LOGGING = "DEBUG" to see why
    • Check if ADX_THRESHOLD is too high (try 0)
  6. Broker Restrictions:

    • Verify algo trading is enabled
    • Check if symbol is tradable
    • Verify trading hours (market open)

Quick Fix:

TRADE_MODE = TRADE_AUTO
ENABLE_CROSS_TRADE = true
ADX_THRESHOLD = 0
magicTimer = 60
DISABLE_PROTECTION = false

Excessive Losses

Immediate Actions:

  1. Enable Stop-Loss:
ENABLE_STOP_LOSS = true
STOP_LOSS_PERCENT = 2.0
STOP_LOSS_SELL_TYPE = FULL
  1. Reduce Position Sizes:
MF_TRADING_LIMIT = [current value] × 0.5
  1. Lower Margin Limit:
SAFE_MARGIN_PERCENT = 40.0
  1. Widen Entry Spacing:
BASE_DCA_PERCENT = 2.0
ENFORCE_DCA_MIN_STEP = true

Long-term Solutions:

  • Use TRADE_MODE = AUTO instead of forcing direction
  • Enable PANIC_CLOSE = true for volatile markets
  • Test strategy on demo account first
  • Review win rate and average loss size
  • Consider different timeframe settings

Positions Not Closing at Profit

Check These Settings:

  1. Profit Targets Too High:
Current: MIN_FULL_PROFIT = 5.0
Try: MIN_FULL_PROFIT = 1.5-2.0
  1. Auto-Gain Disabled:
Enable: AUTO_GAIN = true
This adapts targets to market volatility
  1. Level Range Too Narrow:
Current: CLOSE_LONG_RANGE = 2
Try: CLOSE_LONG_RANGE = 4-6
  1. Scalping Disabled:
ENABLE_SCALPING = true
PARTIAL_REDUCE_RATIO = 0.5
MIN_PARTIAL_PROFIT = 0.5

Quick Fix:

AUTO_GAIN = true
MIN_FULL_PROFIT = 1.5
MIN_PARTIAL_PROFIT = 0.3
ENABLE_SCALPING = true
CLOSE_LONG_RANGE = 5

Partial Closes Not Working

Common Causes:

  1. Scalping Disabled:
ENABLE_SCALPING = true
  1. Profit Threshold Not Met:
Reduce: MIN_PARTIAL_PROFIT = 0.3
  1. Cooldown Active:
Reduce: PARTIAL_SELL_COOLDOWN_MINUTES = 0.5
  1. Level Requirements:
Reduce: PARTIAL_SELL_CLOSE_RANGE = 1-2
  1. Position Too Small:
Check: MIN_VOLUME_TO_SELL = 0.05
Calculated partial may be below minimum

Hedging Mode Issues

Problem: Can't Open Hedge Positions

Check if broker supports hedging:

  • MT5 Terminal → Tools → Options → Trade tab
  • Look for "Hedging" mode
  • If not available, use netting modes instead

Problem: Excessive Imbalance

ENFORCE_HEDGE_ALLOWANCE = true
MAX_UNHEDGED = 5
Adjust ratios:
LONG_HEDGE_RATIO = 0.5
SHORT_HEDGE_RATIO = 0.5

Problem: Not Closing Together

HEDGE_CLOSE = true
Ensure both positions profitable before close trigger

High Margin Usage

Immediate Actions:

  1. Stop New Entries:
SAFE_MARGIN_PERCENT = 30.0  (very restrictive)
  1. Reduce Position Sizes:
MF_TRADING_LIMIT = [reduce by 50%]
  1. Close Some Positions Manually

    • Keep profitable positions
    • Close or reduce losing positions
  2. Enable Protective Stops:

ENABLE_STOP_LOSS = true
STOP_LOSS_SELL_TYPE = REDUCE

Prevention:

Long-term Settings:
SAFE_MARGIN_PERCENT = 50-60
MF_TRADING_LIMIT = 0.01 (1% of balance)
TRADING_LIMIT_TYPE = balance_multiplier
BASE_DCA_PERCENT = 1.5 (wider spacing)

"Not Enough Money" Errors

Solutions:

  1. Reduce Trade Size:
MF_TRADING_LIMIT = 50.0  (or lower)
Or use:
TRADING_LIMIT_TYPE = balance_multiplier
MF_TRADING_LIMIT = 0.005  (0.5% of balance)
  1. Check Free Margin:

    • View in MT5 Terminal
    • Should have 2-3x margin requirement free
  2. Close Losing Positions:

    • Manually close some positions
    • Or wait for stop-loss to trigger
  3. Reduce Leverage Exposure:

SAFE_MARGIN_PERCENT = 30
DCA_QUOTIENT = 2  (fewer entries)

Debug Logging

Enable Detailed Logs:

ENABLE_LOGGING = "DEBUG"

Log File Location:

[MT5 Data Folder]/MQL5/Files/mfride-logs.txt

What Logs Show:

  • Why trades were opened or rejected
  • Margin calculations
  • Market level analysis
  • Entry/exit decision reasoning
  • Position sizing calculations
  • Stop-loss and profit target calculations

Reading Logs:

Look for these key phrases:

  • "executed" → Trade opened
  • "full close" → Position fully closed
  • "partial close" → Partial profit taken
  • "Stop loss triggered" → Risk exit
  • "Margin ratio" → Current margin usage
  • "allowable" → How many more entries allowed

Best Practices

Initial Setup

Week 1-2: Demo Testing

  1. Start with conservative settings
  2. Monitor daily for first week
  3. Check logs to understand decisions
  4. Verify EA behaving as expected
  5. Note any issues or questions

Week 3-4: Demo Optimization

  1. Adjust one parameter at a time
  2. Test each change for 3-5 days
  3. Keep notes on what works
  4. Compare different configurations
  5. Find your optimal settings

Week 5+: Small Live Testing

  1. Start with minimum account/trade sizes
  2. Monitor closely for first month
  3. Gradually increase as confidence grows
  4. Keep detailed performance records

Daily Management

Morning Routine:

  1. Check overnight positions and profits
  2. Review margin usage
  3. Check for any errors in logs
  4. Verify EA is still running (VPS check)
  5. Note any major economic events scheduled

Evening Routine:

  1. Review day's trades
  2. Check win rate and profitability
  3. Adjust settings if needed
  4. Backup MT5 settings/logs
  5. Plan for next trading day

Weekly Review

Analyze performance:

  • Win Rate: Should be 40%+ depending on strategy
  • Average Win vs Loss: Wins should be larger than losses
  • Maximum Drawdown: Should stay under 20% ideally
  • Margin Usage: Peak usage vs average
  • Number of Trades: Not overtrading or undertrading

Adjust if needed:

  • Poor win rate → Tighten entry conditions
  • Small profits → Adjust profit targets
  • Large drawdowns → Enable/tighten stops
  • Overtrading → Increase cooldown timer
  • Undertrading → Loosen entry conditions

VPS Setup (Recommended)

Why Use VPS:

  • 24/7 operation without computer running
  • Faster execution (server near broker)
  • No internet connection issues
  • Reliable for crypto/forex 24hr markets

VPS Requirements:

  • Windows Server (for MT5)
  • 2GB RAM minimum
  • 20GB storage minimum
  • Located near broker server (low ping)

Popular VPS Providers:

  • Forex VPS services (optimized for trading)
  • Amazon AWS
  • Digital Ocean
  • Vultr

Setup Steps:

  1. Purchase VPS subscription
  2. Install MT5 on VPS
  3. Configure EA with your settings
  4. Test connection and execution
  5. Monitor remotely via phone/computer

Risk Management Rules

The 2% Rule: Never risk more than 2% of account on any single trade.

The 6% Rule: Never have more than 6% of account at risk simultaneously.

Position Sizing:

  • Small accounts: 0.5-1% per trade
  • Medium accounts: 1-2% per trade
  • Large accounts: 0.5-1.5% per trade (lower % of larger amount)

Diversification:

  • Don't use entire account on one EA
  • Don't trade too many correlated instruments
  • Keep 20-30% of account in reserve

Stop-Loss: Always use stop-losses. No exceptions.

Margin Safety: Keep margin usage under 60% in normal conditions.


Performance Expectations

Realistic Goals:

Conservative Strategy:

  • Expected monthly return: 3-8%
  • Win rate: 55-65%
  • Maximum drawdown: 10-15%
  • Trade frequency: Low to moderate

Moderate Strategy:

  • Expected monthly return: 5-15%
  • Win rate: 45-55%
  • Maximum drawdown: 15-20%
  • Trade frequency: Moderate

Aggressive Strategy:

  • Expected monthly return: 10-25%
  • Win rate: 40-50%
  • Maximum drawdown: 20-30%
  • Trade frequency: High

⚠️ Reality Check:

  • Past performance ≠ future results
  • Markets change constantly
  • Drawdowns WILL happen
  • No strategy wins 100% of time
  • Risk management is crucial

Common Mistakes to Avoid

1. Overleveraging

  • Using too much of account per trade
  • Not respecting margin limits
  • Disabling stop-losses

2. Impatience

  • Changing settings too frequently
  • Not giving strategy time to work
  • Abandoning during normal drawdown

3. Overoptimization

  • Adjusting based on single trade
  • Chasing perfect settings
  • Overfitting to recent market conditions

4. Ignoring Market Conditions

  • Not adjusting for volatility changes
  • Trading during major news events
  • Using same settings for all market types

5. Poor Record Keeping

  • Not tracking changes made
  • No performance benchmarks
  • Not learning from losing periods

6. Emotional Trading

  • Manually interfering with EA
  • Panic closing positions
  • Overriding EA signals
  • Revenge trading after losses

Configuration Templates

Template 1: Conservative Growth

Goal: Steady, low-risk growth
Risk Level: Low
Recommended Account: $3,000+

# Timeframes
ShortPeriod = PERIOD_M5
MediumPeriod = PERIOD_H4
LongPeriod = PERIOD_D1

# Capital & Risk
MF_TRADING_LIMIT = 0.01
MF_CAPITAL = 10000.0
TRADING_LIMIT_TYPE = balance_multiplier

# Position Management
BASE_DCA_PERCENT = 1.5
DCA_QUOTIENT = 1
BATTLEGROUND_DCA_QUOTIENT = 3
ENFORCE_DCA_MIN_STEP = true
ENABLE_DCA_MULTIPLIER = false

# Risk Controls
SAFE_MARGIN_PERCENT = 50.0
ENABLE_STOP_LOSS = true
STOP_LOSS_PERCENT = 1.5
STOP_LOSS_SELL_TYPE = FULL
STOP_LOSS_THRESHOLD = 40.0

# Profit Targets
AUTO_GAIN = true
MIN_FULL_PROFIT = 2.0
MIN_PARTIAL_PROFIT = 0.5
PROFIT_QUOTIENT = 5.0
PARTIAL_PROFIT_QUOTIENT = 2.5

# Trading Control
TRADE_MODE = TRADE_LONG
magicTimer = 180
ENABLE_SCALPING = true
PARTIAL_REDUCE_RATIO = 0.3

# Levels
LAUNCHPAD_TRADE_INDEX = 2
CLOSE_LONG_RANGE = 5
PARTIAL_SELL_CLOSE_RANGE = 3
TRADE_RANGE = 14

# Advanced
ENABLE_CROSS_TRADE = true
ENABLE_WICK_TRADE = false
ADX_THRESHOLD = 0
PANIC_CLOSE = false

Template 2: Balanced Strategy

Goal: Balance growth and risk
Risk Level: Medium
Recommended Account: $5,000+

# Timeframes
ShortPeriod = PERIOD_M5
MediumPeriod = PERIOD_H4
LongPeriod = PERIOD_D1

# Capital & Risk
MF_TRADING_LIMIT = 0.02
TRADING_LIMIT_TYPE = balance_multiplier

# Position Management
BASE_DCA_PERCENT = 1.0
DCA_QUOTIENT = 1
BATTLEGROUND_DCA_QUOTIENT = 2
ENABLE_DCA_MULTIPLIER = true
MAX_DCA_MULTIPLIER = 2.0
DCA_MULTIPLIER_RANGE = 7

# Risk Controls
SAFE_MARGIN_PERCENT = 60.0
ENABLE_STOP_LOSS = true
STOP_LOSS_PERCENT = 2.0
STOP_LOSS_SELL_TYPE = SHARP
STOP_LOSS_THRESHOLD = 50.0

# Profit Targets
AUTO_GAIN = true
MIN_FULL_PROFIT = 1.5
MIN_PARTIAL_PROFIT = 0.3
PROFIT_QUOTIENT = 4.0
PARTIAL_PROFIT_QUOTIENT = 2.0

# Trading Control
TRADE_MODE = TRADE_AUTO
magicTimer = 120
ENABLE_SCALPING = true
PARTIAL_REDUCE_RATIO = 0.5

# Levels
LAUNCHPAD_TRADE_INDEX = 1
CLOSE_LONG_RANGE = 4
PARTIAL_SELL_CLOSE_RANGE = 2
TRADE_RANGE = 14

# Advanced
ENABLE_CROSS_TRADE = true
ENABLE_WICK_TRADE = true
WICK_TRADE_LEVEL = 7
USE_HYBRID_TP = true
ADX_THRESHOLD = 0

Template 3: Aggressive Growth

Goal: Maximum growth, higher risk
Risk Level: High
Recommended Account: $10,000+

# Timeframes
ShortPeriod = PERIOD_M5
MediumPeriod = PERIOD_H1
LongPeriod = PERIOD_H4

# Capital & Risk
MF_TRADING_LIMIT = 0.03
TRADING_LIMIT_TYPE = balance_multiplier

# Position Management
BASE_DCA_PERCENT = 0.8
DCA_QUOTIENT = 1
BATTLEGROUND_DCA_QUOTIENT = 2
ENABLE_DCA_MULTIPLIER = true
MAX_DCA_MULTIPLIER = 3.0
DCA_MULTIPLIER_RANGE = 5

# Risk Controls
SAFE_MARGIN_PERCENT = 75.0
ENABLE_STOP_LOSS = true
STOP_LOSS_PERCENT = 2.5
STOP_LOSS_SELL_TYPE = REDUCE
STOP_LOSS_THRESHOLD = 60.0

# Profit Targets
AUTO_GAIN = true
MIN_FULL_PROFIT = 1.0
MIN_PARTIAL_PROFIT = 0.2
PROFIT_QUOTIENT = 4.0
PARTIAL_PROFIT_QUOTIENT = 1.5

# Trading Control
TRADE_MODE = TRADE_AUTO
magicTimer = 60
ENABLE_SCALPING = true
PARTIAL_REDUCE_RATIO = 0.4

# Levels
LAUNCHPAD_TRADE_INDEX = 1
CLOSE_LONG_RANGE = 3
PARTIAL_SELL_CLOSE_RANGE = 1
TRADE_RANGE = 14

# Advanced
ENABLE_CROSS_TRADE = true
ENABLE_WICK_TRADE = true
WICK_TRADE_LEVEL = 5
PANIC_CLOSE = true
DISABLE_PROTECTION = false

Template 4: Scalping Focus

Goal: Frequent small profits
Risk Level: Medium
Recommended Account: $5,000+

# Timeframes
ShortPeriod = PERIOD_M1
MediumPeriod = PERIOD_M15
LongPeriod = PERIOD_H1

# Capital & Risk
MF_TRADING_LIMIT = 0.015
TRADING_LIMIT_TYPE = balance_multiplier

# Position Management
BASE_DCA_PERCENT = 0.5
DCA_QUOTIENT = 1
ENABLE_DCA_MULTIPLIER = false

# Risk Controls
SAFE_MARGIN_PERCENT = 55.0
ENABLE_STOP_LOSS = true
STOP_LOSS_PERCENT = 1.5
STOP_LOSS_SELL_TYPE = FULL

# Profit Targets (Focus on partials)
AUTO_GAIN = true
MIN_FULL_PROFIT = 1.0
MIN_PARTIAL_PROFIT = 0.2
PROFIT_QUOTIENT = 3.0
PARTIAL_PROFIT_QUOTIENT = 1.5

# Trading Control
TRADE_MODE = TRADE_AUTO
magicTimer = 30
ENABLE_SCALPING = true
PARTIAL_REDUCE_RATIO = 0.5
PARTIAL_SELL_COOLDOWN_MINUTES = 0.5

# Levels (Tighter ranges)
LAUNCHPAD_TRADE_INDEX = 1
CLOSE_LONG_RANGE = 2
PARTIAL_SELL_CLOSE_RANGE = 1
TRADE_RANGE = 10

# Advanced
ENABLE_CROSS_TRADE = true
ENABLE_WICK_TRADE = true
WICK_TRADE_LEVEL = 5
USE_HYBRID_TP = true

Template 5: Swing Trading

Goal: Larger moves, fewer trades
Risk Level: Low-Medium
Recommended Account: $5,000+

# Timeframes (Longer)
ShortPeriod = PERIOD_H1
MediumPeriod = PERIOD_H4
LongPeriod = PERIOD_D1

# Capital & Risk
MF_TRADING_LIMIT = 0.02
TRADING_LIMIT_TYPE = balance_multiplier

# Position Management
BASE_DCA_PERCENT = 2.0
DCA_QUOTIENT = 1
BATTLEGROUND_DCA_QUOTIENT = 3
ENFORCE_DCA_MIN_STEP = true
ENABLE_DCA_MULTIPLIER = true
MAX_DCA_MULTIPLIER = 2.0
DCA_MULTIPLIER_RANGE = 9

# Risk Controls
SAFE_MARGIN_PERCENT = 50.0
ENABLE_STOP_LOSS = true
STOP_LOSS_PERCENT = 2.5
STOP_LOSS_SELL_TYPE = SHARP

# Profit Targets (Larger)
AUTO_GAIN = true
MIN_FULL_PROFIT = 3.0
PROFIT_QUOTIENT = 6.0
ENABLE_SCALPING = false

# Trading Control
TRADE_MODE = TRADE_AUTO
magicTimer = 600
MIN_VOLUME_TO_SELL = 0.05

# Levels (Wider ranges)
LAUNCHPAD_TRADE_INDEX = 2
CLOSE_LONG_RANGE = 7
TRADE_RANGE = 14

# Advanced
ENABLE_CROSS_TRADE = true
ENABLE_WICK_TRADE = false
USE_HYBRID_TP = true
ADX_THRESHOLD = 20

Quick Reference Guide

Key Parameters Cheat Sheet

Want To...Adjust ThisDirection
Take more tradesmagicTimerDecrease
Take fewer tradesmagicTimerIncrease
Bigger positionsMF_TRADING_LIMITIncrease
Smaller positionsMF_TRADING_LIMITDecrease
Tighter entriesBASE_DCA_PERCENTDecrease
Wider entriesBASE_DCA_PERCENTIncrease
Exit fasterMIN_FULL_PROFITDecrease
Hold longerMIN_FULL_PROFITIncrease
More protectionSAFE_MARGIN_PERCENTDecrease
More aggressiveSAFE_MARGIN_PERCENTIncrease
Enable multipliersENABLE_DCA_MULTIPLIERtrue
Take partial profitsENABLE_SCALPINGtrue
Tighter stopsSTOP_LOSS_PERCENTDecrease

Emergency Settings

If Account Losing Rapidly:

SAFE_MARGIN_PERCENT = 20
ENABLE_STOP_LOSS = true
STOP_LOSS_PERCENT = 1.5
STOP_LOSS_SELL_TYPE = FULL
PANIC_CLOSE = true

If Not Trading At All:

ADX_THRESHOLD = 0
DISABLE_PROTECTION = false
ENABLE_CROSS_TRADE = true
magicTimer = 60
TRADE_MODE = TRADE_AUTO

If Overtrading:

magicTimer = 300
BASE_DCA_PERCENT = 2.0
LAUNCHPAD_TRADE_INDEX = 3
DCA_QUOTIENT = 2

Glossary

Balance Multiplier: Position sizing based on percentage of account balance

DCA (Dollar Cost Averaging): Building positions by adding at different price levels

Entry Spacing: Distance between consecutive position entries

Hedging: Holding both long and short positions simultaneously

Level Index: Numbered tiers representing different timeframe structures

Lot Multiplier: Increasing position size at strategic price levels

Margin Ratio: Percentage of account equity used as collateral

Netting: Account type allowing one direction per symbol

Partial Close: Closing portion of position while keeping remainder open

Scalping: Taking frequent small profits through partial closes

Structure-Aware: Using market price levels for decision-making

Volatility Adaptation: Adjusting strategy based on market movement size


Support & Resources

Official Product Page: https://www.mql5.com/en/market/product/147936
Developer: Olumide Omotoso (TradeStaq Technologies)
Website: https://www.tradestaq.com

Getting Help

Before Contacting Support:

  1. Read this documentation thoroughly
  2. Check troubleshooting section
  3. Enable debug logging and review logs
  4. Test on demo account first
  5. Try template configurations

When Contacting Support, Include:

  • MT5 version and build number
  • Broker name
  • Account type (netting/hedging)
  • Symbol being traded
  • Your configuration settings
  • Description of issue
  • Log file excerpts (if available)
  • Screenshots of terminal/chart

Risk Disclaimer

IMPORTANT NOTICE:

Trading financial instruments involves substantial risk of loss and is not suitable for all investors. You should carefully consider your investment objectives, level of experience, and risk appetite before using this Expert Advisor.

Key Risks

  • Market Risk: Prices can move against your positions rapidly
  • Leverage Risk: Amplifies both profits and losses
  • System Risk: Technical failures, connectivity issues
  • Strategy Risk: No strategy guarantees profits
  • Slippage Risk: Orders may execute at different prices

Your Responsibility

  • Trade only with capital you can afford to lose
  • Test thoroughly on demo accounts before live trading
  • Monitor EA performance regularly
  • Understand all configuration parameters
  • Use appropriate position sizing and risk management
  • Keep stop-losses enabled
  • Never risk more than 2-3% per trade

No Guarantee

This Expert Advisor is provided as a trading tool. The developer makes no guarantee of profitability, performance, or suitability for any purpose. Past performance does not indicate future results. Users are solely responsible for their trading decisions and outcomes.


Final Notes

Success Checklist

  • Read entire documentation
  • Understand all parameters you're using
  • Tested on demo for minimum 2 weeks
  • Optimized settings for your account and instrument
  • Set up proper risk management
  • Enabled stop-losses
  • Using appropriate position sizing
  • Have VPS for 24/7 operation (recommended)
  • Keep trading journal for continuous improvement
  • Ready to monitor and adjust as needed

Remember

  • Patience: Give strategy time to work
  • Discipline: Stick to your risk management rules
  • Learning: Review performance and adjust
  • Realistic: Set achievable profit expectations
  • Protection: Always use stop-losses
  • Testing: Try new settings on demo first

Happy Trading! 🚀📈


Last Updated: November 2025
Document Version: 2.0 (User Guide Edition)