Parabolic SAR Trend Follower
The Parabolic SAR Trend Follower first detects a trend and then enters the market based on the parabolic SAR indicator.
It uses a trailing stop to protect your capital and to maximize the profit on winning positions.
In order to enter the market, the following conditions have to be met:
No trades at night or after hours. The user can define the starting hour as well as the ending hour when the EA will stop entering the market.
2. Trend on the current timeframe
The Parabolic SAR Trend Follower uses the ADX indicator to identify a trend on the current timeframe.
The Average Directional Index (ADX) developed by Welles Wilder is a very powerful and time tested tool to identify trends in price movement.
3. Trend on a higher timeframe
To avoid trading against a trend on a higher timeframe, the ADX indicator is checked again. The user has the option to specify this reference timeframe.
Current timeframe: M5
Reference timeframe: M15
The EA will only enter the market if the ADX confirms a trend on both timeframes.
4. Entry signal by the parabolic SAR indicator
As soon as the parabolic SAR indicates a change in price movement, an entry signal is produced.
5. Stochastic filter (optional)
To avoid strongly overbought or oversold market areas, the EA will not enter the market if the Stochastic indicator is at one of its extremes.
Stochastic Filter Width: 20
The EA will not open a long position when the Stochastic is above 80, the EA will not open a short position when the Stochastic is below 20.
Stochastic Filter Width: 30
The EA will not open a long position when the Stochastic is above 70, the EA will not open a short position when the Stochastic is below 30.
If you want to disable the Stochastic filter, just set stochasticFilterWidth equal to zero.
- volume - position size in lots.
- maxDeviation - maximum slippage in points.
- trailingDistance - distance between the price and the trailing stop in points.
- startingHour - hour when the EA will begin entering the market in GMT time.
- endingHour - hour when the EA will stop entering the market in GMT time.
Parabolic SAR settings:
- sarStep - step of price increment, usually 0.02.
- sarMax - maximum step, usually 0.2.
ADX settings on the current timeframe:
- adxPeriod - period of the ADX indicator.
- adxMin - minimum value of the ADX to enter.
- adxMax - maximum value of the ADX to enter.
ADX settings on the reference timeframe:
- adxReferencePeriod - period of the reference ADX indicator.
- adxReferenceMin - minimum value of the reference ADX to enter.
- adxReferenceMax - maximum value of the reference ADX to enter.
- adxReferenceTimeframe - reference timeframe, usually higher than the current timeframe.
Stochastic filter settings:
- stochasticKPeriod - main period of the Stochastic indicator.
- stochasticDPeriod - moving average of the Stochastic indicator. Be aware that this value is not used by this EA!
- stochasticSlowing - slowing parameter of the Stochastic indicator.
- stochasticFilterWidth - width of the filter (see examples above). Set this parameter to 0 to disable the Stochastic filter.