Stoch Trend EA
Stoch Trend is an EA that uses the Stochastic Oscillator to determine entry and exit points for trading. To improve performance, our team has incorporated a Grids martingale system and adjusted the Overbought and Oversold settings.
|
Backtest Setup System Table |
|||
| Topic | Details | Topic | Details |
| Data | Tick data (99.90%) | Leverage | 1:500 |
| Spread | Variable | Optimize Slippage | Use |
| Delay of market | 30-40 ms | Delay of Pending | 30-40 ms |
| Maximum period for Backtest is 2.5 years | |||
After importing our 2.5-year XAUUSD Backtest results from MT4 into myfxbook for multi-angle analysis, we found that Max DD is quite high due to using Martingale x 2, but it still couldn’t break the portfolio. Average profit throughout the Backtest was approximately 400%

Looking at monthly profits, we found some months had losses. If you want to use this EA, be prepared that it may have losses in some months.
We also found that the maximum holding time is 5 days. If you hold orders longer than 2.5 days, most will be in the red. So if you’re using this, be careful about this… if holding longer than 2 days, cut loss first.
The EA holds orders for long periods when entering trades during chart reversals and getting dragged, or during sideways movement when the chart moves opposite to our order direction.

Testing the probability of real market scenarios is something we should do before using an EA. From this testing, we found that at 95%CI, Max DD will be 34.99% while %Net Profit is at 241%. The software calculated Return/DD at 4.38, which is considered moderate.

Looking at the Monte Carlo simulation graph, we found the graph shape has reasonable distribution. Although there are slight losses in the early run period, it ultimately makes profit without breaking the portfolio.

Additionally, future predictions if we continue running the EA indicate that in the worst case scenario, there may be losses around $332, and in the best case scenario, profits of approximately $1,896. Therefore, users should understand and accept these risks before using it.

Stochastic Oscillator, or what we commonly call Stoch, is a top indicator that’s popular both in Thailand and internationally. Stoch can detect market volatility quickly, sometimes even faster than Relative Strength Index (RSI).
Stoch can be adapted into various trading strategies, whether trend following or divergence trading. Use whichever style you’re comfortable with – there’s no right or wrong approach.
Stoch Calculation Formula
Let’s look at the calculation formula to gain some knowledge… The Stoch calculation formula has 2 main parts: %K and %D. These 2 values can be adjusted according to your trading technique.
The %K or %K period is the time period used for calculating Stoch. For example, if we set %K period = 14, it means we use 14 candles back for calculation. The value we use depends on the volatility of the currency pair we’re trading.
Additionally, you’ll notice below the %K period there’s a Slowing value. This Slowing value is the weight delay of the graph line. Many analysts can determine the %K period slowdown time. Slowing = 1 means Fast Stoch, and if Slowing = 3 or more, it means Slow stoch – the higher the number, the slower.
- %K =100 [ ( Current – Low (n) ) / ( High (n) – Low (n) ) ]
- Where Current = current price; High (n) = highest price at n candles; and Low (n) = lowest price at n candles
- %D = average of %K
The next components are Price field and MA method. Price field offers choices between High/Low and Close/Open. This Price field is what we select for the %K calculation equation.

Let’s look at the MA method section. MA method is the calculation method for the Stoch Moving Average line. There are 4 options:
- Simple averaging
- Exponential averaging
- Smoothed averaging
- Linear-weighted averaging
Each calculation method has its own rationale. Each method has different calculation equations with their own pros and cons, which you can read about in detailed Moving Average articles.
Let’s continue with the %D value… The %D value is designed to average the volatility of the %K line. For example, when the market moves very strongly, you’ll notice the %D line doesn’t move much, while the %K line responds very quickly to price.
Therefore, when the market experiences rapid and violent price movements, we should look at the %D line first to prevent confusion from volatility. A small tip for reading %K and %D values in MT4: read %K from Main line and %D from Signal line.

The strategy of using Stochastic for trend trading was inspired by the senior website www.forexthai.in.th. The original method trades in H4 Time Frame (TF) because this TF has fewer false signals than smaller TFs and tends to have longer trends, making trades smoother. Their recommended settings are Stochastic 50, 5, 10 (click to read original)

However, Eaforexcenter.com team has modified the Order entry method to suit gold trading (XAU/USD) with volatile market conditions. We use Forexthai.in.th’s Stoch settings but trade in TF M30 and change the calculation method for %K and MA method.

Buy Entry Signals
- Main line and Signal line pass through Oversold (20)
- Crossover between Main and Signal lines
- Set TP and SL appropriately, possibly R:R = 1:3

Sell Entry Signals
- Main line and Signal line pass through Overbought (80)
- Crossover between Main and Signal lines
- Set TP and SL appropriately, possibly R:R = 1:3

Strengths and Weaknesses
|
Strengths |
Weaknesses |
| Can identify positions (Overbought/Oversold) | May generate false signals |
| Easy to use with few variables | Infrequent order entries |
| 74% win rate and R:R = 1:3 | Lagging Indicator causes signal delays |
| Doesn’t profit consistently every month (focus on yearly investment) |
Summary
Stochastic Oscillator is an indicator that can trade in both trending and sideways forex markets. We adapted the trading strategy from Forexthai.in.th and modified it for gold trading, then created this Forex EA.


















Reviews
There are no reviews yet.