FX AVALANCHE EA - HOW TO SET UP

FX AVALANCHE EA - HOW TO SET UP

14 April 2026, 12:11
Kestutis Balciunas
0
19
FX AVALANCHE EA - HOW TO SET UP

INFO

Working Specifications:

  • Symbols: Any Forex pair, XAUUSD, metals (multi-pair capable)
  • Timeframe: Any (M15-H1 recommended for RSI/MA strategies)
  • Minimum Deposit: $5,000 recommended for the included presets ($1,000 minimum for conservative use)
  • Leverage: 1:100 or higher recommended (1:500 used in the backtests)
  • Account Type: Hedging recommended (required for the full two-sided Hedge-mode grid; RSI/MA modes work on any account)
  • Broker: ECN broker with tight spreads recommended
  • VPS: Highly recommended for uninterrupted 24/5 operation

Core Features:

  • Hard Risk Core (NEW in v2.0): per-basket equity stop, account max-drawdown failsafe, re-entry cooldown after a loss cut, total exposure cap, optional hard stop-loss
  • Four trading strategies: RSI (Low Risk), MA (Medium Risk), Hedge (High Reward), Manual
  • Five ready-made optimized presets (one per pair) tuned for each platform
  • Adaptive grid system with configurable distances and lot multiplier
  • Drawdown Recovery engine that pairs opposite-end orders for accelerated grid resolution
  • Loss Cut (equity-based, ON by default) plus Amount and None modes
  • Live News Filter with economic calendar integration and pattern-based fallback
  • Auto or Manual lot sizing with configurable multiplier and hard cap
  • Interactive on-chart dashboard (Full/Mini/None) with Buy/Sell toggle buttons
  • Time and day management with overnight session support

INCLUDED OPTIMIZED PRESETS

Version 2.0 ships with five ready-to-load  .set  presets per platform, optimized on one year of M15 data at a $5,000 balance for the best return under a hard drawdown cap. Load the preset for your pair from the Inputs tab > Load button. Presets are tuned separately per platform (the MT4 and MT5 testers fill grids differently).

MetaTrader 4 (MT4 Strategy Tester):

Pair Strategy Return Max DD Profit Factor
EURUSD Hedge +78% 11.6% 1.64
GBPUSD Hedge +74% 9.8% 2.02
USDCHF Hedge +65% 14.4% 1.79
XAUUSD RSI +36% 24.0% 1.16
USDCAD RSI +17% 8.8% 1.98

MetaTrader 5 (MT5 Strategy Tester, hedging account):

Pair Strategy Return Max DD Profit Factor
GBPUSD MA Cross +75% 10.1% 1.99
EURUSD Hedge +53% 9.4% 1.79
USDCHF Hedge +42% 9.3% 1.56
XAUUSD RSI +27% 38.5% 1.08
USDCAD MA Cross +7% 0.9% 1.56

Backtests use the Open-Prices (M15) model over 2025-2026 data. XAUUSD is the most volatile pair and runs the widest drawdown budget. Past performance does not guarantee future results - forward-test on demo first.

Download PRESET Files


STEP 1 - INSTALLATION

For MT5:

  1. Purchase FX Avalanche EA from the MQL5 Market
  2. The EA installs automatically into your MetaTrader 5 terminal
  3. Open the Navigator panel (Ctrl+N)
  4. Find "FX Avalanche EA" under Expert Advisors > Market
  5. Drag it onto your desired chart (any symbol, any timeframe)

For MT4:

  1. Purchase FX Avalanche EA from the MQL5 Market
  2. The EA installs automatically into your MetaTrader 4 terminal
  3. Open the Navigator panel (Ctrl+N)
  4. Find "FX Avalanche EA" under Expert Advisors > Market
  5. Drag it onto your desired chart (any symbol, any timeframe)

Important: Enable WebRequest for News Filter

The News Filter requires internet access to fetch the economic calendar.

MT4: Go to Tools > Options > Expert Advisors > Check "Allow WebRequest for listed URL" and add:

https://nfs.faireconomy.media

MT5: Go to Tools > Options > Expert Advisors > Check "Allow WebRequest for listed URL" and add:

    https://nfs.faireconomy.media

Also make sure "Allow algorithmic trading" is enabled and "Allow live trading" is checked in the EA's Common tab.


STEP 2 - STRATEGY SELECTION

FX Avalanche EA offers four distinct trading strategies controlled by the strattype parameter:

RSI - Low Risk (strattype = 0)

  • Generates entries based on RSI overbought/oversold levels
  • BUY: RSI falls below  roversold  (default 30)
  • SELL: RSI rises above  roverbought  (default 70)
  • Works with any number of existing positions (grid expands on signal)
  • Can enter new cycles even when positions are already open

Best for: Conservative traders who prefer indicator-confirmed entries. Suitable for ranging and mean-reverting pairs.

MA - Medium Risk (strattype = 1) — DEFAULT

  • Generates entries based on Moving Average crossover with price
  • BUY: MA value > Close price (price below MA)
  • SELL: MA value < Close price (price above MA)
  • Only opens new cycles when no positions exist (waits for grid to close first)
  • Uses SMA period 5 on Close price by default

Best for: Balanced approach that avoids opening new grids while an existing one is active. Good general-purpose strategy.

HED - High Reward (strattype = 2)

  • Automatically opens opposing positions to maintain both a buy and sell grid
  • If no sell orders exist, opens a sell. If no buy orders exist, opens a buy
  • Relies entirely on grid management and DD Recovery for profit
  • Does not use indicator signals for entry

Best for: Aggressive hedge/grid traders who want continuous market exposure in both directions. Requires larger accounts and understanding of grid risk.

MAN - Manual (strattype = 3)

  • No automatic entry signals
  • Trading is triggered exclusively by clicking the Buy or Sell buttons on the dashboard
  • Once a manual entry is placed, the grid system manages additional orders automatically

Best for: Traders who want to control entry timing while letting the EA manage the grid and exits.


STEP 3 - LOT SIZE CONFIGURATION

Manual Mode (Default)

When lottype = Manual (default), you set the base lot directly:

  • lotSize = 0.01 (base lot for the first order)
  • All subsequent grid orders are calculated from this base using the lot multiplier

Auto Mode

Set lottype = Automatic to calculate lots from account balance:

  • Formula:  lot = (AccountBalance - deduction) / 500,000
  • Minimum: 0.01 lot
  • The deduction accounts for floating profit on the opposite side, preventing over-exposure when one side is profitable

Grid Lot Progression

Each subsequent grid order multiplies the lot size by lotMul (default 1.3x in v2.0, down from 1.5x for gentler progression). The mulSkip parameter controls how frequently the multiplier applies (v2.0 default 2 = every 2nd order). The tables below use 1.5x / mulSkip=1 purely to illustrate the mechanics:

Grid Level Calculation (lotMul=1.5, mulSkip=1) Lot Size
Level 1 0.01 × 1.5^0 0.01
Level 2 0.01 × 1.5^1 0.02
Level 3 0.01 × 1.5^2 0.03
Level 4 0.01 × 1.5^3 0.05
Level 5 0.01 × 1.5^4 0.08
Level 6 0.01 × 1.5^5 0.11
Level 7 0.01 × 1.5^6 0.17
Level 8 0.01 × 1.5^7 0.26
Level 9 0.01 × 1.5^8 0.38
Level 10 0.01 × 1.5^9 0.58

With mulSkip = 2, the multiplier applies every 2nd order:

Grid Level Calculation (lotMul=1.5, mulSkip=2) Lot Size
Level 1 0.01 × 1.5^0 0.01
Level 2 0.01 × 1.5^0 0.01
Level 3 0.01 × 1.5^1 0.02
Level 4 0.01 × 1.5^1 0.02
Level 5 0.01 × 1.5^2 0.03

All lots are rounded to your broker's lot step and capped by lotMax (0 = no cap).


STEP 4 - GRID SETTINGS

These parameters control how the grid is built and expanded:

Parameter Default Description
takeprofit 10 Take profit in pips (applied to weighted average price)
dist2 20 Distance in pips for the 2nd trade
dist3 1 3rd trade distance multiplier (dist3 × dist2)
dist4 1 4th+ trades distance multiplier (recursive)
tradeLimit 8 Maximum orders per side (v2.0 default, down from 20; 0 = no limit, hard max 80)
allowHedge true Allow buy and sell positions simultaneously

Distance Formula

The grid uses a three-phase distance calculation that widens as depth increases:

Trade # Formula Example (dist2=20, dist3=1, dist4=1)
2nd dist2 20 pips
3rd dist3 × dist2 1 × 20 = 20 pips
4th dist4 × dist3 × dist2 1 × 1 × 20 = 20 pips
5th dist4 × (4th distance) 1 × 20 = 20 pips
6th+ dist4 × (previous distance) Recursive multiplication

With widening distances (dist2=20, dist3=1.5, dist4=1.2):

Trade # Formula Distance
2nd 20 20 pips
3rd 1.5 × 20 30 pips
4th 1.2 × 1.5 × 20 36 pips
5th 1.2 × 36 43 pips
6th 1.2 × 43 52 pips

Increasing dist3 and dist4 above 1.0 creates a widening grid that spaces orders further apart as drawdown deepens.

Grid Expansion Logic

BUY Grid: First order opens on signal. Additional buy orders are placed when Bid drops the required distance below the lowest existing buy order.

SELL Grid: First order opens on signal. Additional sell orders are placed when Bid rises the required distance above the highest existing sell order.

Take Profit Mechanism

The EA calculates a volume-weighted average entry price across all open orders of the same type:

avgPrice = Sum(lots × openPrice) / Sum(lots)

When more than 1 order exists, individual TPs are removed and the EA manages a single TP level at  avgPrice + takeprofit  (buy) or  avgPrice - takeprofit  (sell). Two horizontal lines are drawn on the chart:

  • Yellow line = Volume-weighted average price (breakeven reference)
  • Cyan line = Take profit target level

STEP 5 - DD RECOVERY

The Drawdown Recovery engine reduces grid exposure by pairing orders for combined profit closing.

Parameter Default Description
ddRecovery true Enable DD Recovery mechanism
ddrCount 3 Minimum open orders before DDR activates
ddrProfit 1 Combined profit target ($) for pair closing

How It Works

  1. DDR activates when the number of open orders of one type (buy or sell) exceeds ddrCount
  2. The EA finds the highest open price order and the lowest open price order of that type
  3. It calculates the combined profit (including swap and commission) of both orders
  4. If the combined profit exceeds ddrProfit ($1 default), both orders are closed
  5. This process repeats on every tick, gradually peeling orders from the grid edges

Example

With 5 buy orders (prices: 1.1000, 1.0980, 1.0960, 1.0940, 1.0920) and current Bid at 1.0970:

  • Highest price order: 1.1000 (deep loss)
  • Lowest price order: 1.0920 (in profit)
  • If the profit from 1.0920 + the loss from 1.1000 = +$1.50, both are closed (exceeds $1 threshold)
  • Grid reduces from 5 to 3 orders, freeing margin

Important: DDR does not guarantee profit. It reduces grid size when favorable pairings exist but cannot overcome a strongly trending market.


STEP 6 - LOSS CUT

The Loss Cut feature provides an emergency exit when losses exceed a threshold. In v2.0 it ships ON by default (Percentage mode, measured against equity).

Parameter Default (v2.0) Description
lossCutType Percentage Loss cut mode: None, Amount, or Percentage
lcvalue 10 Threshold value ($ for Amount, % of equity for Percentage)

Percentage Mode (Default in v2.0)

Closes all orders of one type when their combined loss exceeds a percentage of equity (v2.0 measures against equity, not balance, so the threshold reacts as floating losses grow):

  • lcvalue = 10  means close that side if its loss > 10% of equity

Amount Mode

Closes all orders of one type when their combined loss exceeds the dollar amount:

  • lcvalue = 1000  means close if loss > $1,000

None

No loss cut. The EA relies on the v2.0 hard risk core (below), grid recovery, and take profit.

Note: Loss cut is evaluated independently for the buy side and sell side. It closes only the side that breached the threshold. After a loss cut, the re-entry cooldown (below) keeps that side disabled.


V2 HARD RISK CONTROLS (NEW IN v2.0)

This is the headline addition in v2.0 and the answer to the most common request - a way to stop the EA after a loss is cut instead of re-entering straight away. All controls are ON in the included presets.

Parameter Default Description
equityStopPercent 5.0 Basket equity stop - closes a side when its floating loss exceeds this % of equity (0 = off)
maxDDPercent 15.0 Account failsafe - closes ALL orders and HALTS trading if drawdown from the equity peak breaches this % (0 = off)
cooldownMinutes 240 Re-entry lockout - after any loss cut, that side cannot re-open for this many minutes (0 = off)
maxTotalLots 2.0 Total exposure cap - refuses new grid levels beyond this many summed open lots (0 = off)
hardSLPips 0 Optional hard stop-loss in pips on every order (0 = off)

Per-Basket Equity Stop

When a losing side's floating loss exceeds  equityStopPercent  of live equity, the EA closes that side immediately, realizing a small controlled loss rather than holding the grid to a margin call.

Account Max-Drawdown Failsafe

The EA tracks your equity high-water mark. If equity falls  maxDDPercent  below that peak, it closes everything and halts all trading until you re-attach the EA. This is the ultimate "stop after losses" circuit breaker.

Re-Entry Cooldown

After a loss cut (from either the Loss Cut or the equity stop), the affected side is locked out from opening new trades for  cooldownMinutes . To effectively disable that side for the session after a loss, set this to a very high value (e.g. 99999) - it stays off until you restart the EA.

How to configure "disable after loss cut"

  • For a timed pause after each loss cut: set  cooldownMinutes  to your preferred wait.
  • For a full stop for the session after a loss cut: set  cooldownMinutes  very high (e.g. 99999).
  • For a hard account-level stop: keep  maxDDPercent  at your risk limit (default 15%) - the EA halts entirely once it's hit.

STEP 7 - RISK MANAGEMENT

Parameter Default Description
oneTradePerCandle true Only one new trade per candlestick
allowHedge true Allow simultaneous buy and sell positions
maxspread 0 Maximum spread filter in points (0 = disabled)
tradeLimit 8 Maximum orders per direction (v2.0 default; 0 = max)
maxPairs 0 Maximum pairs to trade simultaneously (0 = no limit)

One Trade Per Candle

When enabled, the EA only opens one new order per bar/candlestick on each side. This prevents rapid-fire grid expansion during volatile conditions.

Spread Filter

Set maxspread to your broker's average spread + buffer. When the current spread exceeds this value, no new orders are placed. Set to 0 to disable.

Hedge Control

When allowHedge = false, the EA will not open buy orders if sell orders exist (and vice versa). Only one direction at a time. Useful for brokers that do not support hedging.

Margin Check

Before every order, the EA validates that sufficient free margin exists. If margin is insufficient, the order is rejected and a message is logged.


STEP 8 - NEWS FILTER CONFIGURATION

Activation

The News Filter is always active (no explicit enable/disable toggle). If WebRequest is configured, the EA fetches the live economic calendar. If not, it falls back to pattern-based detection.

How It Works

  1. The EA fetches the weekly economic calendar from the FairEconomy API every 4 hours
  2. It filters events by currency and impact level
  3. Trading pauses 15 minutes before and resumes 30 minutes after each matching event
  4. If the API is unavailable, a built-in fallback detects major events (NFP, FOMC, CPI, GDP, ECB Rate)

Impact Levels

Parameter Default Description
highImpact true Filter high-impact events (NFP, FOMC, etc.)
medImpact true Filter medium-impact events
lowImpact false Filter low-impact events

Timing

Parameter Default Description
closeBefore (mins) 15 Stop trading X minutes before event
startAfter (mins) 30 Resume trading X minutes after event
currencies AUD,CAD,EUR,GBP,JPY,NZD,USD Comma-separated list of currencies to filter

News Display on Chart

Parameter Default Description
showNewsBox true Show countdown box on chart
showNewsLines true Show vertical lines at event times
showText true Show event name text labels
newsCount 5 Number of upcoming events to display
showBg true Background rectangle behind news box
bgcolor Black News box background color

Color coding:

  • Red lines/text = High impact events
  • Orange lines/text = Medium impact events
  • Yellow lines/text = Low impact events

Pattern-Based Fallback

When the API is unavailable, the EA detects these major recurring events:

Event Schedule Time (UTC)
NFP 1st Friday of month 13:30
FOMC Last Wednesday of FOMC months 19:00
US CPI Tue/Wed, 10th-15th of month 13:30
US GDP Last Thursday of Jan/Apr/Jul/Oct 13:30
ECB Rate Thursday, 1st half of month (excl. Aug) 13:15 / 13:45

WebRequest Setup (REQUIRED for live calendar)

You MUST add the news URL to your platform's allowed list:

MT4/MT5: Tools > Options > Expert Advisors > Allow WebRequest for listed URL > Add:

https://nfs.faireconomy.media

Without this step, the news filter will use only the built-in fallback calendar.


STEP 9 - TIME & DAY MANAGEMENT

Trading Hours

Parameter Default Description
use_date false Enable trading hour filter
startTime 7:00 Trading start time (server time)
endTime 19:00 Trading end time (server time)

When use_date = true, the EA only opens new orders within the specified window. Existing positions continue to be managed (TP, DD Recovery) outside trading hours.

Overnight sessions are supported: If startTime > endTime (e.g., start=20:00, end=06:00), the EA inverts the logic and trades during the overnight period.

Day Management

Day Default Description
monday true Allow trading on Monday
tuesday true Allow trading on Tuesday
wednesday true Allow trading on Wednesday
thursday true Allow trading on Thursday
friday false Allow trading on Friday

Note: Friday is disabled by default to reduce weekend gap exposure. Enable it if your strategy and pairs benefit from Friday trading.


STEP 10 - GENERAL SETTINGS

Parameter Default Description
MagicNumber 9244 Unique EA identifier for order management
dbtype Full Dashboard display mode (Full / Mini / None)
highRes false High-resolution dashboard layout
showCandleProf true Show profit text on chart at close positions

Important: If running multiple instances of FX Avalanche on the same account, each instance MUST have a unique Magic Number to prevent order conflicts.

RSI Signal Settings (strattype = RSI)

Parameter Default Description
rsiperiod 9 RSI calculation period
rsiprice Close RSI applied price
roverbought 70 Overbought level (triggers sell signal)
roversold 30 Oversold level (triggers buy signal)

MA Signal Settings (strattype = MA)

Parameter Default Description
ma1period 5 Moving Average period
ma1shift 0 MA shift
ma1method SMA MA method (SMA, EMA, SMMA, LWMA)
ma1price Close MA applied price

PANEL

Once running, the EA displays a real-time dashboard on your chart. Three display modes are available:

Full Dashboard

Shows all information:

  • EA name and server time
  • Current spread in points
  • Net profit (buy + sell combined) with color indication (green = profit, red = loss)
  • Drawdown amount and percentage
  • Weekly profit from order history
  • Account balance and equity
  • User name, broker, and account ID
  • Interactive Buy/Sell toggle buttons

Mini Dashboard

Compact display showing only:

  • Net profit
  • Balance
  • Equity
  • Buy/Sell toggle buttons

No Dashboard

No panel displayed. Buy/Sell buttons still appear for control.

Interactive Buy/Sell Buttons

Strategy Button Behavior
RSI / MA / HED Click to toggle that direction ON (green) or OFF (red). Disabling prevents new entries but existing positions continue to be managed.
Manual Click to place a Buy or Sell market order immediately.

If you are new to FX Avalanche, the easiest start is:

  1. Load the included preset for your pair (Inputs tab > Load) - it already has the strategy, grid, and full v2.0 risk core configured. Match the platform (MT4 vs MT5 presets differ).
  2. Keep the risk core ON - equityStopPercent, maxDDPercent (15%), and cooldownMinutes are pre-set in the presets; leave them enabled.
  3. lotSize = 0.01 on a $5,000 account - halve/double the lot if your balance is smaller/larger to keep the same % risk.
  4. Start on a demo account - test for at least 2-4 weeks before going live.
  5. One pair first - master grid behavior on one pair before adding more.
  6. Enable News Filter - add the WebRequest URL and keep highImpact = true.
  7. friday = false - keep Friday trading disabled to avoid weekend gaps.
  8. VPS - run on a VPS so the risk core and grid management stay active 24/5.

If you prefer to configure manually instead of using a preset: strattype = MA, lottype = Manual, lotSize = 0.01, tradeLimit = 8, lotMul = 1.3, and the v2.0 risk core enabled.


IMPORTANT NOTES

  1. Strategy Selection: RSI and MA strategies generate indicator-based signals. HED mode opens positions automatically without signal confirmation. Manual mode requires you to click buttons. Choose based on your involvement preference and risk tolerance.

  2. Grid Risk: Grid mode with lot multiplier increases exposure geometrically. A 10-level grid with lotMul=1.5 results in a final order approximately 38x the initial lot size. Always test on demo first and use tradeLimit + lotMax to cap risk.

  3. DD Recovery: DDR is not a guaranteed profit mechanism. It reduces grid size when favorable order pairs exist. In a strongly trending market with all orders on one side, DDR compares orders of the same type (e.g., all buys) — the highest and lowest priced buy orders are paired.

  4. Multi-Pair: FX Avalanche supports running on multiple pairs simultaneously. Each chart instance must have a unique Magic Number. Use maxPairs to limit total simultaneous pair exposure.

  5. VPS: For best results, run on a VPS located close to your broker's server. The news filter and grid management require the EA to be running continuously.

  6. Broker: Choose an ECN broker with tight spreads. Wide spreads will trigger the maxspread filter and prevent trading. If your broker does not support hedging, set allowHedge = false.

  7. WebRequest: The news filter REQUIRES the WebRequest URL to be added in platform settings. Without it, only the pattern-based fallback works (NFP, FOMC, CPI, GDP, ECB only).

  8. Hedging Account (MT5): The Hedge-mode presets need an MT5 hedging account to run their full two-sided grid. On a netting account the EA detects this, logs a notice, and automatically limits to a single direction (it will not fail). For MT5, use the MT5 presets - GBPUSD/EURUSD/USDCHF use hedge mode; XAUUSD/USDCAD use single-direction modes that work on any account.

  9. One Trade Per Candle: The default oneTradePerCandle = true prevents the grid from expanding more than one level per bar. Disabling this allows faster grid building but increases risk during volatile moves.



    CONTACT & SUPPORT