The BackTestStrategy is a trading strategy implemented in Python for backtesting purposes. It incorporates various technical analysis (TA) indicators to make buy and sell decisions based on the given price data. The strategy uses the following TA indicators:
Stochastic Oscillator (STOCH): Calculates the slow %K value, representing the level of the current price relative to the highest and lowest prices over a specific period.
Relative Strength Index (RSI): Measures the magnitude of recent price changes to determine overbought or oversold conditions.
Fisher Transform on RSI: Applies the inverse Fisher transform on the RSI values to normalize them between -1.0 and 1.0.
Bollinger Bands: Plots dynamic price channels based on the standard deviation of the typical price. SAR Parabolic: Calculates the Stop and Reverse (SAR) values, which help identify potential reversal points in the price trend. Hammer Candlestick Pattern (CDLHAMMER): Identifies hammer candlestick patterns, which can signal trend reversals. The strategy's buy signal is generated when the following conditions are met:
RSI is below 30 (indicating oversold conditions). Stochastic slow %K is below 20 (indicating the price is near the lowest point of the recent range). The lower Bollinger Band is above the current closing price. A hammer candlestick pattern is detected. The sell signal is generated when the following conditions are met:
The SAR value is above the current closing price. The Fisher-transformed RSI value is above 0.3. The strategy also defines the minimal return on investment (ROI) and stop-loss values, as well as the ticker interval for the backtesting. Please note that this is a brief description of the strategy's functionality, and there may be additional details and considerations not covered here.