SUPERTREND OSCILATOR TRADING STRATEGIES EA MT4/MT5 BACKTESTS & NEW OPTIMIZED SET FILES

SUPERTREND OSCILATOR TRADING STRATEGIES EA MT4/MT5 BACKTESTS & NEW OPTIMIZED SET FILES

17 November 2024, 12:34
Biswarup Banerjee
0
1 728

Complete User Documentation — MT4 & MT5

1. OVERVIEW

The SuperTrend Strategy Multicurrency EA automates trading across multiple currency pairs from a single chart, using the SuperTrend indicator as its core signal generator. It offers three distinct entry strategies and two exit strategies, plus ATR-based trailing stops, breakeven management, and a trend filter voting system to reduce false signals. This EA solves the problem of manually monitoring SuperTrend signals on several pairs at once, letting you run a consistent, rules-based approach without staring at screens all day.

Who Should Use It: Active forex traders who want a semi-automated or fully automated system based on SuperTrend, especially those trading multiple pairs and looking for configurable entry/exit logic plus built-in risk controls.

Main Benefit: Deploy a customizable SuperTrend strategy across your entire watchlist with one EA, complete with trailing stops, grid recovery, and safety limits — all from a single chart.


2. INPUT PARAMETERS & SETTINGS

This product shares a common set of general input settings with all Multi-Currency Scanner Dashboard products in this series. The following sections are covered in the common guide: General Settings (pairs list, dashboard colors, panel size), Timeframe Signal Settings (individual TF scan per symbol), Timeframe Confluence Settings (multi-TF confluence scan), and Alert Settings (popup, push notification, email). For full details refer to the Common Multi-Currency Scanner Dashboard Settings Guide. The sections below cover only the product-specific inputs unique to this product.

General Settings

These settings control how the EA displays virtual stop levels, manages group-level risk, accounts for swap costs, and records historical trade data for backtesting.

Setting Name Type Default Value Description Example
Chart lines for virtual SL/TP (never drawn during optimization) bool false When enabled, the EA draws horizontal lines on the chart showing where your hidden stop loss and take profit levels sit. Useful for visual confirmation during live trading, but it's automatically suppressed during optimization to avoid clutter. true — turn this on when running live so you can see your virtual SL/TP levels without them being visible to the broker.
Group Stoploss Amount double 0 Sets a maximum total loss in account currency for all positions opened by this EA. Once the combined loss hits this threshold, the EA stops opening new trades. Leave at 0 to disable group-level stop loss. 50 — if you're trading a $500 account, this caps total drawdown from EA trades at $50 before it halts further entries.
Include Swap charges in Profit bool true Determines whether overnight swap fees are factored into the profit calculation used for breakeven and trailing stop logic. Keeping it true gives a more accurate picture of your actual P&L, especially on longer-held trades. true — leave this on if you hold positions overnight; swap costs can eat into profits and you want the EA to account for them.
Enable history for backtests or optimization bool false When enabled, the EA stores trade history in the terminal's global variables so you can review past performance during backtests. Turn it off for live trading to avoid unnecessary storage and potential conflicts. true — enable this only when running a backtest or optimization to track historical trade data; keep it false on live accounts.

Atr Trailingstop Settings

These parameters configure an adaptive trailing stop based on Average True Range, which adjusts the stop distance automatically as market volatility changes.

Setting Name Type Default Value Description Example
Use ATR Trailing Stop bool false Master switch for the ATR-based trailing stop. When enabled, the EA will trail the stop loss using ATR values instead of a fixed pip distance. This is especially useful in volatile markets where a static stop might get hit too early. true — turn this on if you trade pairs like GBPJPY that see wide swings; the ATR trail will adapt to current volatility.
ATR Timeframe ENUM PERIOD_CURRENT See options explained below. PERIOD_H1 — use the 1-hour chart's ATR for trailing if you want a broader volatility measure than the current timeframe.
ATR Period int 14 Number of bars used to calculate the ATR value. A shorter period (e.g., 7) makes the trail more responsive to recent volatility, while a longer period (e.g., 21) smooths out noise. The default 14 is a solid starting point for most pairs. 21 — use a longer period for slower, smoother trailing on major pairs like EURUSD during low-volatility regimes.
Activation (ATR multiplier) double 2.0 The profit threshold (in ATR multiples) that must be reached before the trailing stop kicks in. A value of 2.0 means the trade must be up by 2 ATR before trailing begins. This prevents the trail from activating on small fluctuations. 3.0 — set this higher if you want the trade to build a bigger cushion before the trail starts, useful in ranging markets.
Trail distance (ATR multiplier) double 1.0 The distance behind the current price at which the trailing stop is placed, expressed as a multiple of ATR. A value of 1.0 means the stop trails 1 ATR below price for longs. Lower values tighten the stop, higher values give more breathing room. 1.5 — increase to 1.5 ATR for pairs with frequent false breakouts, giving the trade more room to breathe.
Trail increment (ATR multiplier) double 0.5 The step size (in ATR multiples) by which the trailing stop moves up as price advances. A value of 0.5 means the stop updates every 0.5 ATR of favorable movement. Smaller increments make the trail more granular but may cause more adjustments. 1.0 — use a larger increment for less frequent stop adjustments, reducing slippage risk during fast moves.

ATR Timeframe — Options Explained

This setting determines which timeframe's ATR value is used for the trailing stop calculation. You can choose any standard timeframe from M1 to MN1. The default PERIOD_CURRENT uses the chart's own timeframe, which works fine for most cases.

PERIOD_CURRENT: Uses the ATR from the chart the EA is attached to. This is the simplest choice and aligns the trailing stop with the same timeframe you're trading. Good for day traders on H1 or H4.

PERIOD_H1, PERIOD_H4, PERIOD_D1: Select a higher timeframe if you want a broader, more stable volatility measure. For example, using PERIOD_D1 on a 15-minute chart gives you daily ATR, which smooths out intraday noise and prevents the trail from tightening too aggressively during quiet hours.

Grid Settings

This single setting controls whether the EA attempts to recover losses from all open grid trades by closing them as a group when total profit turns positive.

Setting Name Type Default Value Description Example
Recover profit from all grid trades bool false When enabled, the EA will close all open positions from the same symbol when the combined net profit of those trades turns positive. This is useful for grid or martingale strategies where you want to exit the whole basket at breakeven or a small profit. true — enable this if you're running a grid-style approach and want to exit all positions as soon as the group is in profit, rather than managing each trade individually.

Safeguard Settings

These backtest-only parameters let you define minimum performance criteria — profit percentage, trade count, and inactivity days — that the EA must meet during optimization to be considered a valid result.

Setting Name Type Default Value Description Example
Max Loss from initial balance [0: disable] double 0.0 Sets a maximum allowable drawdown as a percentage of the initial account balance. If the equity drops below this level, the EA stops trading entirely. Leave at 0 to disable this safety net. Critical for protecting capital during adverse market conditions. 20 — on a $1000 account, this stops all trading if equity falls below $800, preventing further losses during a bad streak.
Minimum Profit Percent [backtesting only] [0: disable] double 0 During optimization, any backtest result with a total profit below this percentage is discarded. This helps filter out unprofitable parameter sets. Only applies in backtesting mode — has no effect on live trading. 5 — ignore any optimization result that doesn't achieve at least 5% profit over the test period, saving you time reviewing weak strategies.
Minimum Trades [backtesting only] [0: disable] double 0 Sets a minimum number of trades that must be executed during a backtest for the result to be considered valid. Use this to avoid over-optimizing on parameter sets that only produce a handful of lucky trades. 30 — require at least 30 trades in the backtest period to ensure the result has statistical significance, not just a few lucky entries.
Max inactive days [backtesting only] [0: disable] int 0 If the EA goes longer than this many days without opening a trade during backtest, the result is flagged or discarded. Helps identify parameter sets that are too conservative and miss opportunities. 7 — discard any optimization result where the EA didn't trade for a full week, indicating the strategy is too inactive for your liking.

Supertrend Settings

These are the core parameters that define how the SuperTrend indicator is calculated and how the EA uses it to generate entry and exit signals.

Setting Name Type Default Value Description Example
Time frame ENUM

3. HOW IT WORKS

Core Calculation & Logic

This EA monitors multiple currency pairs simultaneously from a single chart, applying the SuperTrend indicator across each symbol you've listed. The SuperTrend itself is a volatility-based trend follower that plots a line above or below price action — when price stays above the line, the trend is up; below it, the trend is down. What makes this EA different from a simple indicator is that it can combine multiple SuperTrend strategies (different ATR periods and multipliers) into one decision, then execute trades automatically with your chosen risk parameters.

The EA identifies trending conditions by checking whether price has crossed the SuperTrend line on the current bar or a recent bar. It's most effective when markets are moving directionally — think hourly or 4-hour trends in EUR/USD or GBP/JPY. In choppy, sideways markets you'll get whipsaw entries, so pair this with a filter like a moving average or time-of-day check if you want to reduce noise.

Entry Strategies Explained

The EA supports multiple SuperTrend strategies, each defined by its own ATR period and multiplier. You can enable one or several — when multiple are active, the EA waits for confluence (all enabled strategies agree) before entering. Below are the three built-in strategies you'll find in the inputs.

SuperTrend Strategy 1 (Default: ATR 10, Multiplier 3)

BUY Signal: Price closes above the SuperTrend line AND the trend direction flips from down to up on the current bar. The EA checks that the close is strictly greater than the SuperTrend value.

SELL Signal: Price closes below the SuperTrend line AND the trend direction flips from up to down. The close must be strictly less than the SuperTrend value.

Best For: Medium-term trends on H1–H4 timeframes. The 10-period ATR with a 3x multiplier gives a fairly tight band — good for catching moves early, but expect more false signals in ranging markets.

SuperTrend Strategy 2 (Default: ATR 12, Multiplier 4)

BUY Signal: Same logic as Strategy 1 — close above the line with a direction flip — but using a wider ATR (12) and larger multiplier (4). This makes the SuperTrend band wider and less sensitive.

SELL Signal: Close below the line with a direction flip from up to down, using the wider band parameters.

Best For: Strong, sustained trends on D1 or higher. The wider band filters out minor pullbacks, so you'll enter later but with fewer false starts. I prefer this one on commodities or indices rather than forex pairs.

SuperTrend Strategy 3 (Default: ATR 8, Multiplier 2)

BUY Signal: Close above the SuperTrend line with a direction flip, using a tight 8-period ATR and a 2x multiplier — the most sensitive of the three.

SELL Signal: Close below the line with a direction flip, using the same tight parameters.

Best For: Scalping or very short-term trades on M5–M15. You'll get many signals, so pair this with a volume filter or trade only during high-liquidity sessions (London open, for example).

Step-by-Step Workflow

Step 1: Choose Your Symbols In the SYMBOLS input, list the pairs you want to trade — comma-separated, no spaces. Example: EURUSD,GBPUSD,USDCHF . The EA will open positions on each symbol from the chart it's attached to.

Step 2: Set Lot Size and Risk Enter your base LOTS value (0.01 is a good starting point for a $1,000 account). Then configure your stop-loss and take-profit mode — I recommend starting with AMOUNT mode and setting STOPLOSS_AMOUNT to 1 and TAKEPROFIT_AMOUNT to 2 for a 1:2 risk-reward ratio.

Step 3: Enable Strategies In the strategy inputs, set USE_STRATEGY_1, USE_STRATEGY_2, and USE_STRATEGY_3 to true or false . For beginners, enable only Strategy 1 first to keep things simple.

Step 4: Attach to a Chart Drag the EA onto any chart — it doesn't matter which pair, because the EA reads the SYMBOLS list. Make sure auto-trading is enabled in the terminal. The EA will start scanning and trading immediately.

Step 5: Monitor and Adjust Check the Experts tab for log messages showing entry signals and trade execution. If you see too many false signals, increase the ATR multiplier or switch to confluence mode (all strategies must agree).


4. RISK MANAGEMENT FEATURES

This EA gives you several ways to control risk — from simple fixed stops to group-level loss limits that protect your entire portfolio of open positions.

Feature Description
Stoploss and Takeprofit Mode Choose from six modes: PIPS, AMOUNT, PERCENT, GROUP_AMOUNT, GROUP_PERCENT, or NOSLTP. PIPS mode uses fixed pip distances; AMOUNT mode uses a cash amount; PERCENT mode uses a percentage of account equity. Group modes calculate SL/TP across all open positions combined — useful for hedging or multi-pair strategies.
Hidden SL/TP When HIDDEN_SL_TP is true, the EA places stop-loss and take-profit orders that are not visible to the broker (virtual). This prevents other traders or algorithms from seeing your levels. The EA manages them internally and closes positions when price hits the hidden level.
Group Stop Loss Set GROUP_STOPLOSS_AMOUNT or GROUP_STOPLOSS_PERCENT to cap total loss across all open positions. For example, if you have three EUR/USD lots and one GBP/USD lot, a group stop of $50 will close all positions if the combined loss reaches $50. This is a portfolio-level safety net.
Risk-Reward Ratio The RISK_REWARD_RATIO input lets you set a fixed ratio (e.g., 1:2) that automatically calculates take-profit from your stop-loss distance. If your stop is 20 pips and ratio is 2, take-profit becomes 40 pips. This enforces discipline without manual calculation.
Chart Lines for Virtual SL/TP When SHOW_HIDDEN_SL_TP_LINES is true, the EA draws horizontal lines on the chart showing where the virtual stop and target are. This is purely visual — the lines are never sent to the broker. Disable during optimization to avoid clutter.

5. IMPORTANT NOTES & WARNINGS

Known Limitations

Issue Explanation
Whipsaws in Ranging Markets The SuperTrend is a trend-following indicator — it will generate false signals when price oscillates without direction. During low-volatility periods (e.g., Asian session on EUR/GBP), you may see repeated buy/sell flips. Consider disabling the EA or using a higher timeframe filter during these hours.
Hidden SL/TP Not Supported by All Brokers Some brokers reject hidden (virtual) stop-loss orders or require specific account types. If you enable HIDDEN_SL_TP and the EA fails to close positions, check the Experts tab for error messages. You may need to switch to visible SL/TP or contact your broker.
Multiple Strategy Confluence Can Delay Entries If you enable all three SuperTrend strategies, the EA waits until all agree on direction before entering. This reduces false signals but can cause late entries — you might miss the first 20–30 pips of a move. For faster entries, use only one strategy.
Group Stop Loss Can Close Winning Positions If you use GROUP_STOPLOSS_AMOUNT, a single losing position can trigger the group stop and close all open positions — even those in profit. This is intentional for risk control, but it can be frustrating if you're net positive on the portfolio. Use with caution.

Settings Beginners Should NOT Change

Setting Why to Leave Default
HIDDEN_SL_TP Default is true, which hides your stop and target from the broker. Changing this to false exposes your levels — other traders could see them and trade against you. Only disable if your broker requires visible stops.
GROUP_STOPLOSS_AMOUNT Default is 0 (disabled). Setting a group stop without understanding it can close all your positions unexpectedly. Leave at 0 until you've tested the EA in a demo account with multiple pairs open.
RISK_REWARD_RATIO Default is 0 (disabled). If you set a ratio without also setting a stop-loss, the EA won't know what distance to use for the take-profit calculation. Always configure stop-loss first, then enable the ratio.
SHOW_HIDDEN_SL_TP_LINES Default is false. Enabling this draws lines on the chart that can clutter your workspace, especially if you have many pairs. Keep it off unless you're debugging or want visual confirmation of levels.

Dashboard Usage Tips

  1. Start with one strategy: Enable only Strategy 1 (ATR 10, multiplier 3) for your first week. Add more strategies only after you understand how the EA behaves in different market conditions.
  2. Use a demo account first: Run the EA on a demo for at least 50 trades before going live. Pay attention to how often it hits the stop-loss — if it's more than 40% of trades, increase the ATR multiplier or switch to a higher timeframe.
  3. Monitor the Experts tab: The EA logs every signal and trade decision. If you see "no trade" messages, check whether your strategy conditions are being met — maybe the SuperTrend hasn't flipped yet.
  4. Adjust lot size based on account equity: For a $1,000 account, 0.01 lots is safe. For $5,000, you can go up to 0.05. Never risk more than 2% of your account on a single trade — use the PERCENT mode to enforce this automatically.
  5. Disable during news events: High-impact news (NFP, interest rate decisions) can cause extreme volatility that triggers false SuperTrend flips. Either remove the EA from the chart or set a time filter to avoid trading during these periods.
  6. Test group stop-loss in simulation: Before using GROUP_STOPLOSS_AMOUNT, run a backtest with multiple pairs to see how it behaves. A single losing trade might close your entire portfolio — make sure you're comfortable with that.

Quick Start Guide

Follow these steps to get started in under 5 minutes:

  1. Download and install: Place the EA file in your MQL4/Experts or MQL5/Experts folder, then restart MetaTrader. You'll find it in the Navigator panel under Expert Advisors.
  2. Set your symbols: In the EA inputs, locate the SYMBOLS field and enter the pairs you want to trade — for example, EURUSD,GBPUSD,USDJPY . No spaces after commas.
  3. Configure lot size: Set LOTS to 0.01 for a small account (under $2,000) or 0.05 for a larger one. Leave stop-loss and take-profit at 0 for now — you'll add them later.
  4. Enable one strategy: Set USE_STRATEGY_1 to true and the other two to false . This keeps things simple while you learn.
  5. Attach to any chart: Drag the EA onto a chart — any pair works. Make sure the smiley face icon appears in the top-right corner, meaning auto-trading is enabled.
  6. Check the Experts tab: Open the Terminal window (Ctrl+T) and click the Experts tab. You should see messages like "SuperTrend Strategy 1: BUY signal on EURUSD" — this confirms the EA is working.
  7. Let it run for a day: Don't touch the settings for the first 24 hours. Let the EA accumulate a few trades, then review the trade history to see if the signals match your expectations.
  8. Add risk controls: After your first day, set a stop-loss (e.g., STOPLOSS_AMOUNT = 1 for a $1 stop per trade) and a take-profit (TAKEPROFIT_AMOUNT = 2 for a 1:2 ratio). Enable HIDDEN_SL_TP to keep your levels private.


Installation Guide for MQL Products | Updating Purchased MQL Products on MT4/MT5 | General Troubleshooting Guide | Backtest and Set Files

Check all my products: https://www.mql5.com/en/users/biswait50/seller

Contact me for support: https://www.mql5.com/en/users/biswait50