The Heracles Strategy, named after the strongest son of God, is a trading strategy designed for backtesting. It uses a single genome, which represents a bacterium. The strategy aims to achieve optimal results by implementing certain configurations and dependencies.
To use the Heracles Strategy, the following important steps need to be followed:
Add the strategy to your pairlists inside the config.json file under StaticPairList.
Install the TA (Technical Analysis) library before running the strategy (pip install ta).
The strategy utilizes various libraries, including logging, numpy, pandas, ta (Technical Analysis), freqtrade, and qtpylib. These libraries provide essential functions and indicators required for the strategy. The HeraclesDOGEBTCBULL strategy has been fine-tuned and optimized to produce favorable results. It has specific parameters for buying and selling, along with a defined ROI (Return on Investment) table, stoploss, and trailing stop. For buying, the strategy uses the volatility_kcw and volatility_dcp indicators and checks for a cross condition. The buy signal is generated when volatility_kcw is less than volatility_dcp. For selling, the strategy uses the trend_macd_signal and trend_ema_fast indicators. The sell signal is generated when the trend_macd_signal equals the trend_ema_fast. The strategy also includes a minimal ROI table, which indicates the expected return at different time intervals. Additionally, the strategy incorporates a stoploss of -0.05, meaning that if the trade's loss exceeds this threshold, it will be automatically closed. To optimize gains, a trailing stop is implemented. The trailing stop activates when the profit reaches a positive threshold of 0.013 and maintains a trailing stop offset of 0.014. Once the trailing stop offset is reached, the stop-loss level is adjusted to the offset value. The timeframe used for analysis and trading decisions is 4 hours. The strategy's populate_indicators() function adds various technical analysis features to the input dataframe. These features include volatility_kcw, volatility_dcp, trend_macd_signal, and trend_ema_fast. The populate_buy_trend() function generates the buy signal based on the defined buy parameters. It compares the buy indicator (buy-indicator-0) with the buy cross condition (buy-cross-0) and sets the 'buy' column to 1 when the condition is met. Similarly, the populate_sell_trend() function generates the sell signal based on the sell parameters. It compares the sell indicator (sell-indicator-0) with the sell cross condition (sell-cross-0) and sets the 'sell' column to 1 when the condition is met. Overall, the Heracles Strategy aims to provide a robust backtesting approach for trading by incorporating specific indicators, buying and selling parameters, stoploss, and trailing stop mechanisms.