Idea by: Evgeny.
MQL5 code by: Vladimir Karputov.
The Spasm Expert Advisor is designed to capitalize on market volatility, helping traders make the most of price fluctuations.
Input Parameters
- Lots - This defines the position volume you'll be trading with;
- Multiplier relative to current volatility - A multiplier to adjust based on the current volatility;
- Period for calculating volatility in bars - This sets the timeframe (in bars) used for volatility calculations;
- Volatility smoothing mode - Choose your averaging method: 0 for simple moving average and 1 for linear-weighted;
- Volatility calculation mode - Select how you want to calculate volatility: 1 for open/close and 0 for high/low;
- Stop loss as a percentage of volatility - Set your stop loss as a percentage of volatility (between 0 and 1);
- Magic number - A unique identifier for your EA, helping it stand out in your trading portfolio.
Testing has been conducted on all symbols in H1 timeframe using the "Every tick" mode from January 1, 2017, to May 8, 2018.

Related Posts
- Harnessing MQL5 Wizard for Trading Signals: 3 Black Crows & 3 White Soldiers with MFI
- Leveraging MQL5 Wizard: Crafting Trade Signals with Meeting Lines and Stochastic
- Creating an Expert Advisor for Dark Cloud Cover and Piercing Line Patterns with CCI Confirmation
- Creating a Stochastic-Based EA for Hammer and Hanging Man Patterns in MetaTrader 5
- Mastering Bullish and Bearish Harami Patterns with Stochastic in MT5