PruningGRID EA - Complete User Manual
Version 1.00
? Overview
PruningGRID is an advanced grid trading Expert Advisor that combines directional bias with intelligent risk management. The EA uses previous timeframe direction (Daily/Weekly/Monthly) to determine initial trade direction and executes a customizable 10-trade sequence with smart drawdown pruning features.
? How The EA Works
Starting Direction Logic
The EA determines its first trade direction based on the previous completed candle of your chosen timeframe:
- Previous Day (Daily): Compares yesterday's CLOSE vs OPEN
- Previous Week (Weekly): Compares last week's CLOSE vs OPEN
- Previous Month (Monthly): Compares last month's CLOSE vs OPEN
If CLOSE > OPEN → Market was BULLISH → First trade direction follows your Sequence 1 setting
If CLOSE < OPEN → Market was BEARISH → First trade direction follows your Sequence 1 setting
10-Trade Sequence System
Once started, the EA follows a repeating 10-trade sequence that YOU control:
Example Sequence:
Seq1: BUY → Trade 1 opens BUY Seq2: BUY → Trade 2 opens BUY Seq3: BUY → Trade 3 opens BUY Seq4: SELL → Trade 4 opens SELL Seq5: SELL → Trade 5 opens SELL Seq6: SELL → Trade 6 opens SELL Seq7: BUY → Trade 7 opens BUY Seq8: BUY → Trade 8 opens BUY Seq9: SELL → Trade 9 opens SELL Seq10: BUY → Trade 10 opens BUY
After Trade 10, the sequence restarts from Seq1 and repeats continuously.
Grid Spacing
New trades open when price moves GridSpacingPips away from any existing trade. This creates a grid of positions at different price levels.
⚙️ INPUT PARAMETERS EXPLAINED
? BASIC TRADING SETTINGS
Lot Size (Default: 0.10)
- The trading volume for each trade
- EA automatically normalizes to broker's minimum/maximum/step requirements
- Example: 0.01 = 1 micro lot, 0.10 = 1 mini lot, 1.00 = 1 standard lot
Magic Number (Default: 123456)
- Unique identifier for this EA's trades
- Change this if running multiple instances on different charts
- Allows the EA to manage only its own trades
Basket TP in Dollars (Default: 10.0)
- Individual trade profit target in account currency
- When ANY single trade reaches this profit, it closes automatically
- Set to 0 to disable individual trade profit closing
Maximum Open Trades (Default: 100)
- Maximum number of positions the EA can open simultaneously
- Safety limit to prevent unlimited grid expansion
- Recommended: 20-50 for most accounts
Grid Spacing (pips) (Default: 30)
- Minimum distance in pips between new trades
- Larger spacing = fewer trades, more distance between entries
- Smaller spacing = more trades, tighter grid
- Recommended: 20-50 pips for major pairs
Maximum Spread (pips) (Default: 5.0)
- EA will NOT open trades if spread exceeds this value
- Protects you from trading during high-spread conditions
- Adjust based on your broker's typical spreads
? ENTRY CONTROL
Pause New Entries (Default: false)
- Enable to activate drawdown-based entry pausing
- Works with "Pause Entries at DD%" below
Pause Entries at DD% (Default: 6.0%)
- When account drawdown reaches this percentage, STOP opening new trades
- Existing trades remain open and can still profit
- Entries resume automatically when DD drops below threshold
- Example: At 6% DD, EA stops adding new positions but manages existing ones
? DRAWDOWN MANAGEMENT
Close All at Max DD (Default: true)
- Emergency stop: closes ALL trades when maximum DD is reached
- This is your final safety net
Max Drawdown % (Default: 10.0%)
- The ultimate drawdown limit before all trades are closed
- Calculated as: (Total Open Losses / Account Balance) × 100
- Example: With $1000 balance and 10% setting, all trades close at -$100 total loss
? DAILY RESTART
Restart Hour (Default: 0 = Midnight)
- Hour of day (0-23) to reset the sequence
- Uses broker's server time
Restart Minute (Default: 0)
- Minute of hour (0-59) for restart timing
- Example: Hour=0, Minute=0 → Resets at midnight
- Example: Hour=9, Minute=30 → Resets at 9:30 AM
What Restart Does:
- Resets the sequence counter back to Seq1
- Does NOT close existing trades
- Useful for daily strategy resets
✂️ PRUNING CONTROLS (Smart Risk Management)
Pruning = Selectively closing losing trades before reaching maximum DD
Close Negative Swap Trades (Default: false)
- Enable to automatically close trades with negative swap charges
- Eliminates positions that cost money to hold overnight
Prune Swap at DD% (Default: 8.0%)
- Drawdown level to start closing negative swap trades
- Only activates if "Close Negative Swap Trades" is enabled
- Example: At 8% DD, all trades with negative swap are closed
Close Worst Trades (Default: false)
- Enable to close the most losing trades when DD threshold reached
- Helps reduce drawdown by cutting biggest losers
Prune Worst at DD% (Default: 7.0%)
- Drawdown level to start closing worst performing trades
- Lower than "Prune Swap" to act as first line of defense
Number of Worst to Close (Default: 2)
- How many worst trades to close when threshold is reached
- Closes equally from BUY and SELL sides (balanced)
- Example: Setting=4 closes 2 worst BUYs + 2 worst SELLs
? GRID SPACING INCREASE (Dynamic Grid)
These settings INCREASE grid spacing as drawdown grows, slowing down new entries in bad market conditions.
Grid Increase 1 (pips) (Default: 10)
- Additional pips added to grid spacing at DD Level 1
Grid Increase 2 (pips) (Default: 20)
- Additional pips added to grid spacing at DD Level 2
Grid Increase 3 (pips) (Default: 30)
- Additional pips added to grid spacing at DD Level 3
DD Level 1 % (Default: 5.0%)
DD Level 2 % (Default: 7.5%)
DD Level 3 % (Default: 10.0%)
How It Works:
- At 0% DD: Grid spacing = 30 pips (base setting)
- At 5% DD: Grid spacing = 30 + 10 = 40 pips
- At 7.5% DD: Grid spacing = 30 + 10 + 20 = 60 pips
- At 10% DD: Grid spacing = 30 + 10 + 20 + 30 = 90 pips
This creates wider spacing as losses grow, reducing trading frequency.
? DIRECTION SETTINGS
Choose ONE timeframe for determining initial trade direction:
Use Daily Direction (Default: true)
- Uses previous day's candle (yesterday)
- Best for: Day trading, shorter-term strategies
Use Weekly Direction (Default: false)
- Uses previous week's candle (last week)
- Best for: Swing trading, medium-term strategies
Use Monthly Direction (Default: false)
- Uses previous month's candle (last month)
- Best for: Long-term position trading
⚠️ Important: Enable only ONE of these three options
? TRADE SEQUENCE (1-10)
Control the exact BUY/SELL pattern for your 10-trade cycle:
Sequence 1-10 (Default: Buy-Sell-Buy-Sell alternating)
Each sequence position can be set to:
- Buy: Opens a BUY trade at this sequence position
- Sell: Opens a SELL trade at this sequence position
Strategy Examples:
Bullish Bias:
Seq1-7: BUY (7 buys)
Seq8-10: SELL (3 sells)
Result: More long positions, bullish approach
Balanced Grid:
Odd sequences (1,3,5,7,9): BUY Even sequences (2,4,6,8,10): SELL Result: Equal buys and sells
Custom Pattern:
Seq1-3: BUY
Seq4-6: SELL
Seq7-8: BUY
Seq9-10: SELL
Result: Your custom trading logic
? RISK MANAGEMENT HIERARCHY
The EA manages risk in this order (from lowest to highest DD):
- 6.0% DD → Pause new entries (if enabled)
- 7.0% DD → Close worst performing trades (if enabled)
- 8.0% DD → Close negative swap trades (if enabled)
- 10.0% DD → Close ALL trades (emergency stop)
This creates multiple safety layers before total closure.
? ON-CHART DISPLAY
The EA shows real-time information on your chart:
Info Panel (Top-left):
- Current sequence number (1-10)
- Number of open trades
- Current drawdown percentage
- Next trade direction (BUY or SELL)
Price Lines:
- Green lines = BUY trades
- Red lines = SELL trades
- Labels show sequence number and direction
Status Alerts:
- ⚠️ NEW ENTRIES PAUSED = Orange warning when entries are paused
? RECOMMENDED SETTINGS
Conservative (Low Risk)
Lot Size: 0.01 Max Trades: 20 Grid Spacing: 50 pips Max Drawdown: 5% Pause Entries at: 3% Prune Worst at: 4%
Moderate (Medium Risk)
Lot Size: 0.10
Max Trades: 50
Grid Spacing: 30 pips
Max Drawdown: 10%
Pause Entries at: 6%
Prune Worst at: 7%
Aggressive (High Risk)
Lot Size: 0.50 Max Trades: 100 Grid Spacing: 20 pips Max Drawdown: 15% Pause Entries at: 10% Prune Worst at: 12%
⚠️ IMPORTANT WARNINGS
- Grid trading can lead to large drawdowns - Always use proper risk management
- Test on DEMO first - Never start on live account without testing
- One timeframe only - Enable only ONE direction setting (Daily/Weekly/Monthly)
- Monitor during news - Major news can cause rapid drawdown
- Adequate margin required - Ensure sufficient account balance for grid expansion
- Broker spread matters - Higher spreads = higher costs on grid strategies
? TROUBLESHOOTING
EA not opening trades:
- Check "Pause New Entries" is disabled or DD is below threshold
- Verify AutoTrading is enabled in MT5
- Check MaxSpreadPips isn't too low for your broker
- Ensure adequate free margin
Too many trades opening:
- Increase Grid Spacing (pips)
- Reduce Maximum Open Trades
- Enable "Pause New Entries" with lower DD threshold
Trades closing unexpectedly:
- Check current drawdown vs. pruning thresholds
- Verify Basket TP isn't set too low
- Review Max Drawdown % setting
? SUPPORT
For questions, updates, or support:
- EA Name: PruningGRID
- Version: 1.00
- Author: Ricky Zoltan Bexnec
? DISCLAIMER
Trading forex involves substantial risk of loss. Past performance is not indicative of future results. This EA is provided as-is without guarantees. Always test thoroughly on demo accounts before live trading.
Happy Trading! ?