The "SAR_and_BB" strategy is a backtesting strategy that combines the use of Parabolic SAR and Bollinger Bands indicators to generate buy and sell signals for trading. In this strategy, the Bollinger Bands are used to identify potential entry and exit points. The upper and lower bands of the Bollinger Bands are calculated based on a 20-day moving average and a standard deviation of 2.
These bands serve as thresholds for determining overbought and oversold conditions.
The Exponential Moving Average (EMA) with a time period of 144 is also calculated as an additional indicator for trend analysis.
The Parabolic SAR indicator is used to identify potential reversals in the price trend. It helps in determining when to enter or exit a trade based on the direction of the SAR dots. The buy signal is generated when the following conditions are met:
The price crosses above the SAR dots. The price is above the EMA. Or
The price is below the EMA. The price is below 0.99 times the lower Bollinger Band. The volume is below 20 times the rolling average volume of the previous 30 periods. The sell signal is generated when the following conditions are met:
The price crosses below the SAR dots. The price is above 1.05 times the middle Bollinger Band. The strategy uses a trailing stop and sets a stop loss of -0.14, which means that if the price drops by 0.14 from the entry point, the position will be closed. The minimal return on investment (ROI) for this strategy is set to 1, indicating that the strategy aims to achieve at least a 1x return. The strategy operates on a 5-minute timeframe and requires a startup candle count of 30, meaning that it needs 30 candles before producing valid signals. Note: The strategy can be further customized and optimized through the configuration file.