Gaussian Auto EA — Band Breakout Strategy with R-Multiple Trailing Stop
## 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.