Stochastic 1 Settings Documentation
This Expert Advisor (EA) integrates a Stochastic Oscillator-based strategy to capture market momentum and trend reversals. The Stochastic Oscillator is a widely used technical indicator that measures the relative position of the closing price to the price range over a specified period. This EA offers customizable Stochastic settings, entry, and exit strategies for enhanced trade precision.
The documentation is divided into indicator-related settings and additional features. The indicator-related settings focus on configuring the Stochastic parameters. Additional features like grid recovery, hedging, and martingale strategies are consistent across EAs. Refer to the for additional features.
MT4 Version is available here Stochastic EA MT4
MT5 Version is available here Stochastic OverBought OverSold EA MT5
1. Stochastic 1 Settings
Stochastic 1 Input Parameters
- STOCHASTIC1__TEXT_1 – Divider text for visual clarity in the input section. (Not used in calculations)
- STOCHASTIC1_TEXT – Label for Stochastic 1 settings. (Not used in calculations)
- STOCHASTIC1__TEXT_2 – Divider text for visual clarity in the input section. (Not used in calculations)
- STOCHASTIC1_TIMEFRAME – Selects the timeframe for Stochastic 1 calculation. Default: PERIOD_CURRENT .
- STOCHASTIC1_KPERIOD – Defines the %K period for the Stochastic Oscillator. Default: 14 .
- STOCHASTIC1_DPERIOD – Defines the %D period (signal line) for the Stochastic Oscillator. Default: 3 .
- STOCHASTIC1_SLOWING – Sets the slowing factor for the %K line. Default: 3 .
- STOCHASTIC1_MA_METHOD – Moving Average method for smoothing (%D line). Options include MODE_SMA (Simple), MODE_EMA (Exponential), etc. Default: MODE_SMA .
- STOCHASTIC1_PRICE_FIELD – Specifies the price field for the calculation:
- STO_LOWHIGH: Uses the High/Low range.
- STO_CLOSECLOSE: Uses the Close/Close range.
Default: STO_LOWHIGH .
2. Stochastic Calculation Mode
Input Parameter
- CALCULATION_MODE
- MANUAL: Uses the specified upper and lower Stochastic levels.
- AUTO: Automatically calculates the levels based on the upper level input.
Default: MANUAL .
Levels
- STOCHASTIC1_UPPER_LEVEL – Defines the upper level for the Stochastic Oscillator. Default: 80 .
- STOCHASTIC1_LOWER_LEVEL – Defines the lower level for the Stochastic Oscillator. Default: 20 .
3. Entry Strategies
ENUM_ENTRY_STRATEGY Options
- ENTRY_STRATEGY1:
- Buy Entry: Stochastic enters the oversold zone.
- Sell Entry: Stochastic enters the overbought zone.
- ENTRY_STRATEGY2:
- Buy Entry: Stochastic exits the oversold zone.
- Sell Entry: Stochastic exits the overbought zone.
- ENTRY_STRATEGY3:
- Buy Entry: Stochastic enters the overbought zone.
- Sell Entry: Stochastic enters the oversold zone.
- ENTRY_STRATEGY4:
- Buy Entry: Stochastic %K and %D lines cross below the oversold level.
- Sell Entry: Stochastic %K and %D lines cross above the overbought level.
Default: ENTRY_STRATEGY1 .
4. Exit Strategies
ENUM_EXIT_STRATEGY Options
- EXIT_STRATEGY1:
- Buy Exit: Stochastic enters the overbought zone.
- Sell Exit: Stochastic enters the oversold zone.
- EXIT_STRATEGY2:
- Buy Exit: Stochastic exits the overbought zone.
- Sell Exit: Stochastic exits the oversold zone.
- EXIT_STRATEGY3:
- Buy Exit: Stochastic enters the oversold zone.
- Sell Exit: Stochastic enters the overbought zone.
- EXIT_STRATEGY4:
- Buy Exit: Stochastic %K and %D lines cross above the overbought level.
- Sell Exit: Stochastic %K and %D lines cross below the oversold level.
- EXIT_STRATEGY5:
Default: EXIT_STRATEGY1 .
Summary
This Stochastic-based EA enables traders to leverage momentum and overbought/oversold conditions for accurate trade entries and exits. Customizable smoothing, price fields, and calculation modes provide the flexibility to adapt the EA to various trading styles and market conditions.
2. Additional Features
Moving Average (MA) Filter on Higher Timeframe
The MA filter enables trades that align with the broader trend based on a higher timeframe moving average:
- Uptrend Condition – Allows buy trades when the close price is above the moving average.
- Downtrend Condition – Allows sell trades when the close price is below the moving average.
Loss Recovery Strategies
There are couple of loss recovery strategies popular in the market. Grid, Hedge and Martingale is most popular among them. In this EA, we have these strategies inbuilt. But only one loss recovery strategy can be active at a time. EA will not load, if we enable more than one loss recovery strategies. There is one important point regarding these strategies, we can not set stoploss if you enable Grid or Hedge strategy. It will close trades earlier and will compromise the purpose of these strategies. All of these strategies are by default disabled.
Grid Recovery Strategy
In a losing position, the EA places additional trades in a grid pattern, averaging down the entry price to capitalize on retracements.
Hedge Strategy
To balance exposure during a losing position, the EA opens opposing trades (hedges), allowing profit potential in countertrend movements.
Martingale Strategy
Increases lot size after a loss on each subsequent signal, aiming for overall profitability.
Position Sizing Based on Profit
This feature adjusts the position size dynamically based on cumulative profit, aiming to optimize gains in favourable conditions. As profit accumulates, the EA increases the position size, allowing for scaled growth and larger potential returns.
Day Filter
Specifies trading days to avoid trading during specific days of the week, aligning with your strategy’s optimal market conditions. You can disable the entire day filter.
Time Filter
Limits trading to specific times, preventing trades during low-liquidity periods or other non-ideal market conditions. You can disable entire time filter.
This ADX-based EA, with versatile entry and exit strategies and advanced risk management features, is a comprehensive tool designed to adapt to various market conditions while offering robust control over trading operations. Use each feature thoughtfully to align with your trading objectives and risk management strategy.
3 .Backtests and Optimized Set files
The EA can be back tested with various different strategies with the help of different combinations of these options
- Stop-Loss and Take-Profit
- Single or Multiple Entry (Multiple entries is not suitable for Grid)
- Entry Option
- Exit Option (Not suitable for Grid, Hedge and Martingale) (Enable/Disable)
- Time Filter (Enable/Disable)
- Day Filter (Enable/Disable)
- Breakeven (Enable/Disable)
- Trailing Stop-Loss (Enable/Disable)
- Daily, Weekly and Monthly Profit
- Grid (Enable/Disable) with no stoploss
- Hedge (Enable/Disable) with no stoploss
- Martingale (Enable/Disable) with no stoploss
- Higher timeframe Moving Average Trend Filter (Enable/Disable)
We have optimized our EA based on these different combinations in different timeframes (5Minute to 4 Hours). These optimizations are mainly performed on EURUSD, USDCHF, AUDUSD, GBPUSD, USDCAD, NZDUSD AND XAUUSD. We have run these optimizations on 4-10 years of data. You can find the optimized set files and results below.
Note: We have run the optimizations on every period calculation for faster results. In this approach calculation are perform on every candle loading. You can backtest on everytick mode, but backtest would be much slower. Optimization results may be different in different brokers. It depends on the mt5 data cache and specific broker data. Ideally mt5 has 99.99 tick quality data. For mt4 you need to purchase 99.99 quality data from specific providers. Each individual has their own preference of their settings and symbols. In case you need more optimized data you can always optimize yourself.
You can follow this video to learn how to optimize the EA.