The FreqGymNormalized strategy is a trading strategy that aims to backtest various trading strategies using technical analysis (TA) indicators. The strategy consists of three main methods: populate_indicators, populate_buy_trend, and populate_sell_trend. In the populate_indicators method, the strategy calculates multiple TA indicators and adds them to the given DataFrame.
These indicators include:
PLUS_DI: Normalized value of the Plus Directional Indicator.
MINUS_DI: Normalized value of the Minus Directional Indicator.
UO: Normalized value of the Ultimate Oscillator. HT_SINE: Normalized values of the Hilbert Transform - Sine and Hilbert Transform - Lead Sine. BOP: Normalized value of the Balance of Power. STOCH: Normalized values of the Stochastic Oscillator (Slow %K and Slow %D). STOCHF: Normalized value of the Fast Stochastic Oscillator %K. Bollinger Bands: Two sets of Bollinger Bands (with different standard deviations) indicating whether the lower band is greater than the closing price. ADX: Normalized values of the Average Directional Index for different time periods. AROON: Normalized values of the Aroon Up, Aroon Down, and Aroon Oscillator for different time periods. CMO: Normalized value of the Chande Momentum Oscillator for different time periods. DX: Normalized value of the Directional Movement Index for different time periods. MFI: Normalized value of the Money Flow Index for different time periods. WILLR: Normalized value of the Williams %R for different time periods. RSI: Normalized value of the Relative Strength Index for different time periods. Fisher RSI: Normalized value of the Fisher Transform of RSI for different time periods. STOCHRSI: Normalized values of the Stochastic RSI (Fast %K and Fast %D). LINEARREG_ANGLE: Normalized value of the Linear Regression Angle for different time periods. After calculating these indicators, the method returns the DataFrame with all the mandatory indicators. In the populate_buy_trend method, the strategy generates a buy signal based on the TA indicators calculated in the previous step. It uses an RL (Reinforcement Learning) model to predict the action, and the buy signal is set to 1 if the predicted action is a buy. In the populate_sell_trend method, similar to the populate_buy_trend method, the strategy generates a sell signal based on the TA indicators and the RL model's predictions. The sell signal is set to 1 if the predicted action is a sell. Overall, this strategy aims to populate a DataFrame with TA indicators, generate buy and sell signals based on those indicators using an RL model, and provide the backtesting capability for various trading strategies.