The Heracles strategy is a trading strategy designed for backtesting on a trading website. It utilizes various indicators and conditions to determine buy signals. Here is a breakdown of its important components:
Libraries: The strategy uses several libraries such as TA-Lib, pandas, qtpylib, and numpy.
Indicator Calculation: The strategy calculates two indicators: "volatility_kcw" and "volatility_dcp" using the Keltner Channel and Donchian Channel methods from TA-Lib.
Buy Signal Generation: The strategy generates buy signals based on specific conditions.
It calculates a ratio between the "volatility_dcp" and "volatility_kcw" indicators, using shift values defined by hyperparameters. If the calculated ratio falls within a defined range, it triggers a buy signal. Sell Signal Generation: The strategy does not define any specific sell conditions and leaves the sell signals as 0 (no action). Hyperparameters: The strategy includes hyperparameters that can be optimized during backtesting. The hyperparameters control the shift values for the indicator calculations and define the range for the buy signal ratio. ROI Table: The strategy defines a minimal return on investment (ROI) table, indicating the expected ROI at different time intervals. Stoploss: The strategy defines a stoploss value (-0.256), which represents the maximum tolerable loss before triggering a sell signal. Timeframe: The strategy is optimized for a 4-hour timeframe. Note: It's important to install the TA-Lib library before running the strategy (using "pip install ta").