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.
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.
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.
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:
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.
Downloads
➥ EA-StochThresholds_v1-0.mq4Installation instructions:
- Download the expert advisor .mq4 file.
- Open the MetaTrader 4 data folder (via File→Open Data Folder).
- Open the MQL4 Folder.
- Copy the .mq4 file to MQL4/Experts/ subfolder.
- 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.