Smoothed Gaussian Trend Filter Robot MT4
- Experts
-
Duc Hoan Nguyen
I develop practical trading tools for MetaTrader 4/5, with a focus on indicator integration, Multi-Timeframe analysis, market scanning, and automated trading solutions.
My work mainly includes:
• Indicator-to-EA Solutions - Version: 1.0
- Activations: 10
Get ALL my MT4 & MT5 Robots & Indicators FREE — See how here
EA User Guide — All 6 Parts
Learn how the controls work, then use the reference configurations in Part 6 to build your own trading method.
See the MT5 version: Smoothed Gaussian Trend Filter Robot MT5
See the MT4 version: Smoothed Gaussian Trend Filter Robot MT4
See more products: All Products or Trading Indicators, Special Offers & New Releases
Overview
This EA automates trading based on the logic of the Smoothed Gaussian Trend Filter Multi TF Scanner indicator.
Signal logic and entry conditions
The indicator applies a recursive Gaussian filter to closing prices, then smooths the result with linear regression. The smoothed curve is compared with a custom Supertrend threshold calculated from that curve and ATR 21, using a fixed factor of 0.15. With valid data, the trend is bullish when the curve is above the threshold and bearish when it is at or below it.
Entry mode has one option: When Buy/Sell signal appears. With Mid-Trend Signals disabled by default:
- Buy: the trend changes from bearish on the immediately preceding bar to bullish on the signal bar.
- Sell: the trend changes from bullish on the immediately preceding bar to bearish on the signal bar.
Enabling Mid-Trend Signals replaces that reversal rule: Buy/Sell forms only when the immediately preceding bar was ranging and the signal bar has left that phase, in the current trend direction. Ranging means the slope state disagrees with the trend: a curve above its previous value has a bullish slope, while a flat or lower curve is classified as a bearish slope. A bullish trend produces Buy; a bearish trend produces Sell. The robot reads the Buy/Sell events produced by the selected rule.
Signal settings include Gaussian Length (default 15), Poles (1..4) (3), Smoothing Length (22), Flatten Multiplier (7) and Mid-Trend Signals. Gaussian Length and Poles change the recursive filter; Smoothing Length changes the regression window; Flatten Multiplier sets the regression evaluation offset. Maximum bars to process defaults to 10000, with 0 using all available data; the history range can affect initialization and signal results.
The main signal uses the current chart's symbol and timeframe. Buy signal bar shift and Sell signal bar shift default to 1, the most recently closed bar; shift 0 uses the forming bar, so its signal may change before the bar closes. When the panel needs information, up to 1000 bars are searched for the latest signal; a historical match does not itself trigger an entry on the bar being checked.
MTF Filter 1 and MTF Filter 2 are independent trend-confirmation groups, both disabled by default. Each has its own timeframe, Gaussian/regression settings, Buy/Sell conditions and shift. When enabled with the default conditions, Buy is allowed in a bullish trend and Sell in a bearish trend, at shift 1 of the filter timeframe; no new Buy/Sell event is required on that timeframe. Always TRUE allows trading without requiring a trend direction; conditions that need data fail when that data is invalid. These groups provide permission checks for the main signal. Position opening also follows the EA's operating and management settings.
This Expert Advisor combines automated Buy/Sell signals with configurable position sizing, exits and entry filters. Its settings let you define how eligible trades are opened, managed and closed.
Begin with a single-position setup and individual Stop Loss and Take Profit, then add the supported management functions that fit your method. Different configurations can use trailing, basket exits, Grid or Hedging, subject to the compatibility requirements in the user guide.
Important: Default settings have not been optimized. Use the reference methods and example settings in Part 6 to build, adapt and test a configuration for your trading method, instrument, timeframe, account and risk tolerance.
Trade and position management
- Position sizing: fixed lots, balance-based sizing, or risk amount/percentage with a compatible Stop Loss.
- Individual exits: configurable Stop Loss and Take Profit, Reward-to-Risk targets and optional virtual SL/TP.
- Trailing: individual-position or basket trailing in supported configurations.
- Closing rules: Basket TP/SL, closing on signals, or closing before the next eligible entry.
- Volume management: Add, Multiplier or Recover, with the conditions required by each mode.
- Additional-position methods: same-direction Grid entries at configured price distances, or opposite-direction Hedging at a configured loss-distance threshold.
The methods have separate requirements. Recover uses a single-position setup with a valid individual TP and cannot be combined with Grid, Hedging or conflicting basket/signal exits. Grid and Hedging cannot be enabled together. Check Part 4 before combining management functions.
Entry filters and operating controls
Optional technical filters include Moving Average, RSI, Stochastic, ADX, MACD, SuperTrend, Volumatic VIDyA and Predictive Ranges. Enable the filters you need and select the conditions that should confirm the EA's main signal.
Trading controls cover direction, sessions, weekdays, holiday periods, spread, position limits, entries per bar and economic news. Each enabled filter should have a defined role; enabling more filters does not automatically improve a configuration.
Daily drawdown actions, breakeven reference lines and trading panels provide additional monitoring and management controls. Panel functions include Pause and closing controls. Available settings and signal parameters can differ by EA, version and platform edition.
Configuration and testing
Start by checking the signal, lot size and individual exits for the intended instrument and timeframe. Add one compatible management function or filter at a time, inspect the resulting trades and save the configuration you want to evaluate.
Use Strategy Tester to examine supported functions on historical data, then verify operation on Demo. News Filter and News Panel do not operate in Strategy Tester in this EA framework and must be checked separately on Demo. Parts 4 and 5 explain testing, configuration messages and troubleshooting.
Review instrument specifications, account size, spread, commission, swap, margin and execution conditions. Lot progression, Recover, Grid and Hedging require particular attention to total open exposure and exit rules.
The EA does not guarantee profit. Historical results do not guarantee future performance.
Support
For help with configuration, use the product comments or the MQL5 messaging system. Describe the intended entry conditions, lot-sizing method, exit rules and whether additional positions should be allowed. I can explain which settings correspond to that behavior and which combinations are supported.
