Gaussian Auto EA: Trend Following with ATR-Scaled Bands and Trailing Stop
Info
The Gaussian Auto EA: Trend Following with ATR-Scaled Bands and Trailing Stop is a Expert Advisor for MetaTrader 5 that gaussian auto ea - band breakout strategy with r-multiple trailing stopoverviewgaussian auto ea is a trend-following/breakout expert advisor based on a gaussian-filtered price channel with atr-scaled bands. It enters on candle closes outside the channel and manages risk with a fixed R-multiple target and a dynamic trailing stop.
Usage
This tool is typically used for trend following strategies across multiple currency pairs.
Platform
This Expert Advisor works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Experts folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use Gaussian Auto EA: Trend Following with ATR-Scaled Bands and Trailing Stop
1. Installation: Open the "File" menu, select "Open Data Folder," navigate to MQL/Experts, paste your file, and restart the terminal.
2. Activation: Drag the EA from the Navigator onto a chart, ensure "Allow live trading" is checked in the Common tab, and verify the AutoTrading button is green.
3. Optimization: Right-click your chart, choose "Expert List," click "Properties" to adjust inputs, and save your preferred setup as a set file for future use.
4. Maintenance: Regularly check the "Experts" tab in the terminal window to monitor trade logs and potential execution errors.
Frequently Asked Questions
Q: Why is my EA not opening trades? A: Check the "AutoTrading" button, ensure "Allow live trading" is enabled, and verify your broker allows automated trading on your account type.
Q: Can I run multiple EAs on one chart? A: No, each chart can only host one active EA; however, you can open multiple charts for different currency pairs to run several EAs.
Q: What does the "smiley face" icon mean? A: A smiley face in the top-right corner of the chart indicates the EA is successfully running; a frowny face means it is disabled.
What this tool does
Gaussian Auto EA - Band Breakout Strategy with R-Multiple Trailing StopOverviewGaussian Auto EA is a trend-following/breakout expert advisor based on a Gaussian-filtered price channel with ATR-scaled bands.
Typical Use Case
This Expert Advisor excels in trend following on MetaTrader 5.
Compatible Platform & Setup
This Expert Advisor works on MetaTrader 5. Place the file in the MQL5/Experts folder and restart the terminal.
Description & Settings
Related: Automated Stop Loss and Take Profit Setter - another powerful expert for MetaTrader 5 traders.
Gaussian Auto EA - Band Breakout Strategy with R-Multiple Trailing StopAlso recommended: Trail Guard: Automated Break-Even and Trailing Stop Management for MetaTrader 5 - similar expert with strong performance on MetaTrader 5.
Overview
Gaussian Auto EA is a trend-following/breakout expert advisor based on a Gaussian-filtered price channel with ATR-scaled bands. It enters on candle closes outside the channel and manages risk with a fixed R-multiple target and a dynamic trailing stop.
Strategy Logic
- Gaussian Middle Line: Exponential smoothing of close prices (Ehlers-style Gaussian filter approximation) with period InpPeriod.
- Bands: Middle ± (ATR(Period) × InpMultiplier).
- BUY signal: Candle closes above the upper band and opens below it.
- SELL signal: Candle closes below the lower band and opens above it.
- Optional confirmation: Requires the next candle to also close beyond the band.
- Stop Loss: Outer band (opposite side) or Gaussian middle line — user selectable.
- Take Profit: Entry ± (SL distance × InpRR).
- Trailing: Activates once profit reaches InpTrailingActivationRR × R, then trails the SL along the opposite band/middle line.
Features
- Risk-based position sizing (% of balance per trade).
- Configurable Risk:Reward ratio.
- Two SL modes (outer band/middle line).
- Optional second-candle confirmation.
- R-multiple trailing stop with per-ticket state memory.
- Single-position per symbol/magic.
- Works on any symbol & timeframe.
- Fully MQL5-native (uses indicator handles, no MQL4 legacy functions).
Inputs
- InpRisk (default 1.0): Risk % of balance per trade.
- InpRR (default 2.0): Reward:Risk ratio.
- InpSLType (default Outer Band): SL placement mode.
- InpMagic (default 999): Magic number.
- InpRequireSecondCandle (default false): Require follow-through candle.
- InpUseTrailing (default true): Enable trailing.
- InpTrailingActivationRR (default 1.0): Activate trailing at this R.
- InpPeriod (default 20): Gaussian / ATR period.
- InpMultiplier (default 2.0): Band width multiplier.
- InpVerbose (default false): Print detailed debug info.
Recommended Settings
- Timeframe: H1 / H4
- Symbols: Major FX pairs, indices with clear trends
- Risk: 0.5–1% per trade (default 1%)
- RR: 1.5–3.0
How to Install
1. Copy the .mq5 file to MQL5/Experts/.
2. Compile in MetaEditor (F7).
3. Attach to a chart, enable AutoTrading.
4. Adjust inputs and run Strategy Tester first.
Disclaimer
For educational purposes. Test thoroughly in the Strategy Tester before any live deployment. No guarantee of profitability. Last updated 2026.
You may also like: Ezo Lot Calculator: Automated Risk-Based Lot Sizing with One-Click Execution - excellent alternative for expert users on MetaTrader 5.
Source Code
#property copyright "RobotFX"
#property link "https://robotfx.org"
#property version "1.00"
#property description "This code is educational. Feel free to use, modify and upgrade as you wish. Visit ROBOTFX.ORG for professional trading tools"
#include <Trade\Trade.mqh>
#include <Trade\HistoryOrderInfo.mqh>
#include <Trade\PositionInfo.mqh>
#include <Trade\DealInfo.mqh>
enum ENUM_SL_TYPE
{
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.