The Expert Advisor is based on mixed price & volume action. Two strategies with automatically adjusted stop losses are available for selection: convergence/divergence between price and cumulative volume, and cumulative volume bands breakout. Only one order is allowed in the market at a single moment. The EA is designed to open new trades at bar opening. Stop loss trailing is performed on ticks. Optimization can be made in the model of "open prices". Then optimal parameters found can be confirmed and refined in the model of "every tick".
The expert utilizes two custom indicators: Volumixer (cumulative volumes) and HZZM (single parameter zigzag).
Note: all volumes are tick volumes.
Convergence/divergence strategy (0)
- Buy signal is formed when new price low does not get confirmed by new cumulative volume low;
- Sell signal is formed when new price high does not get confirmed by new cumulative volume high;
Volume bands breakout strategy (1)
- Buy signal is formed when cumulative volume breaks out its standard deviation band in the upward direction;
- Sell signal is formed when cumulative volume breaks out its standard deviation band in the downward direction;
Volumixer parameters (used in strategies 0 and 1)
- MAPeriod - period of moving average used to calculate cumulative volume, by default - 0, which means number of bars in a single day for current timeframe, or 21 for timeframes D1 and larger;
- SDPeriod (strategy 1 only) - period of standard deviation channel on cumulative volume, by default - 0, which means number of bars in a single day for current timeframe, or 21 for timeframes D1 and larger;
- MAMethod (strategy 1 only) - method of moving average, by default - 1 (exponential);
- Scale (strategy 1 only) - width of the channel as a number of standard deviations, by default - 1.0;
- VolumeDelta - enable/disable separate calculation of buy and sell volumes, by default - false (overall gross volume is used);
HZZM parameters (used in strategy 0 only)
- Range - zigzag range, in points (for details, see HZZM description), by default - 500;
- ZZMA - period of exponential moving average, by default - 0 (smoothing is not used); if it's larger than 0, zigzag is built on the average of typical price instead of highs and lows;
- Original - enable/disable usage of original HZZ algorithm (for details, see HZZM description), by default - false;
- FastSignal - enable/disable special mode to generate trading signal on early stage of zigzag's edges formation, by default - false;
- Strategy - number of selected strategy - 0 or 1, by default - 0;
- MagicBase - magic number for every EA instance, by default - 0, meaning automatic generation of unique number based on current symbol and timeframe (result is printed into the log);
- Lots - size of fixed lot to trade; by default - 0.01;
- Slippage - maximal deviation of price during order execution, in points, by default - 10;
- TrailStops - enable/disable trailing of stop loss, by default - true;
- TrailingStep - step of stop loss trailing, in points, by default - 10;
- TrailNonProfit - enable/disable special mode to start stop-loss trailing for newly opened position (true); otherwise (false) trailing is started only after the moment when position gained a profit of stop-loss points; by default - false;
- RiskManagement - enable/disable variable lot sizing, as a percent of free margin (according to leverage), by default - false;
- Risk - a fraction of available free margin to calculate lot size, by default - 0.01 (1%);
- MaximumLot - maximal lot size allowed for the EA, by default - 0.5;
- PrintLog - enable/disable debug logs, by default - false.
The expert is suitable for a wide range of symbols, for timeframes M1 - D1. Optimization is required.
On the screenshots below strategy tester reports are shown for the built-in strategies with various parameters. Screenshots 1, 2, 3 - for the strategy 0, and screenshots 4, 5 - for the strategy 1. In all cases fixed lot size 0.01 was used. All tests - EURUSD H1, 2010-2015.