Stochastic Oscillator MT4 Expert Advisor

The stochastic oscillator indicator is often used to check for overbought and oversold state when analyzing a currency pair or any other trading instrument. In many cases, it can be also serve as a trigger for orders. Below you can download a free expert advisor for MetaTrader 4 that uses the stochastic oscillator for entry and exit signals.

EA Stochastic Oscillator Presentation

EA Stochastic Oscillator Presentation

Parameters

EA Stochastic Oscillator Parameters

EA Stochastic Oscillator Parameters
  • Position Size — to define the position size.
  • Use next entry to close the trade — to specify whether to use a given take-profit or to wait for the next entry signal.
  • Stop-loss in pips.
  • Take-profit in pips.
  • Slippage in pips.
  • Enable trade — to enable or disable the trading function.
  • Stochastic Oscillator K Period.
  • Stochastic Oscillator D Period.
  • Stochastic Oscillator Slowing.
  • Stochastic Oscillator Lower Threshold.
  • Stochastic Oscillator Upper Threshold.

The type of moving average used for the signal line is a simple moving average.

Entry Signal

  • Buy signal when the stochastic oscillator crosses the lower threshold from below.
  • Sell signal when the stochastic oscillator crosses the upper threshold from above.

Exit Signal

  • Fixed take-profit or stop-loss hit.
  • Close Buy when the stochastic oscillator reaches the upper threshold.
  • Close sell when the stochastic oscillator reaches the lower threshold.

In the following image you can see examples of Entry and Exit Signals, however this may not be accurate as the Stochastic drawn is with close prices.

MT4 EA Stochastic Threshold - Examples of Entry and Exit Signals

Examples of Entry and Exit Signals

Results on EUR/USD @ M15

Backtesting this expert advisor on the EUR/USD @ 15-minute timeframe shows that the Expert Advisor is very lossy. The EA is, in fact, limited by the use of only one indicator. This isn't enough to establish accurate entry points. The situation does not become profitable in other timeframes and it isn't suggested to use this EA on a real trading account.

Backtesting report for Stochastic Oscillator EA - EUR/USD @ M15

Strength

The expert advisor works well only in case of a clear overbought or oversold situation that triggers a trend reversal.

Weakness

The stochastic oscillator alone is insufficient to determine correct entry and exit signals. It should be integrated with other indicators.

The example chart screenshot below shows a series of three losses in a row generated by this EA:

MT4 EA Stochastic Threshold - Three Losing Trades in a Row

What Is It Good For?

Although it couldn't be recommended for the use in a live account, this expert advisor can be used as a foundation for further development and optimization. You need to understand that it is not profitable on its own because it is affected too strongly by false reversals.

This expert advisor is free to download and you can use its .mq4 source file to develop your own EA's.

Download MT4 Stochastic Oscillator Expert Advisor

➥ Download EA-StochThresholds_v1-0.mq4

Installation instructions:

  1. Download the expert advisor .mq4 file.
  2. Open the MetaTrader 4 data folder (via File→Open Data Folder).
  3. Open the MQL4 Folder.
  4. Copy the .mq4 file to MQL4/Experts/ subfolder.
  5. Restart MetaTrader 4 or refresh the expert advisors list by right-clicking the Navigator subwindow of the platform and choosing Refresh.

Or you can read a more detailed instruction on how to perform the installation.

If you are interested in building your own expert advisor or knowing more about how to do it, check our MT4 Expert Advisor Template.

You can open a trading account with any of the MT4 Forex brokers to freely use the presented here expert advisor for MetaTrader 4.

© 2005–2021

EarnForex.com

Design — Mart Studio

Forex trading bears intrinsic risks of loss. You must understand that Forex trading, while potentially profitable, can make you lose your money. Never trade with the money that you cannot afford to lose! Trading with leverage can wipe your account even faster.

CFDs are leveraged products and as such loses may be more than the initial invested capital. Trading in CFDs carry a high level of risk thus may not be appropriate for all investors.