The Heracles Strategy is a trading strategy implemented in Python for backtesting purposes. It is designed to analyze and generate buy and sell signals based on various technical indicators. Here's a breakdown of its important components:
Description: The Heracles Strategy is named after the mythical Greek hero, symbolizing strength and power.
It uses a combination of indicators to identify potential buying and selling opportunities in the market.
Author: The strategy was developed by Masoud Azizi (@Mablue), and the source code can be found on GitHub at https://github.com/mablue/.
Dependencies: Before running the strategy, it requires the installation of the TA library (Technical Analysis library) using the command "pip install ta."
Configuration: Inside the configuration file (config.json), you need to add the strategy to your pairlists under "StaticPairList" by specifying the minimum number of days a pair should be listed using the "AgeFilter" method. Buy Signals: The strategy uses two indicators, "volatility_kcw" and "volatility_dcp," to generate buy signals. It checks if the value of "volatility_kcw" is less than the value of "volatility_dcp." If this condition is met, a buy signal is generated. Sell Signals: The strategy uses the "trend_macd_signal" and "trend_ema_fast" indicators to generate sell signals. It checks if the value of "trend_macd_signal" is equal to the value of "trend_ema_fast." If this condition is met, a sell signal is generated. ROI (Return on Investment) Table: The strategy provides a predefined table that specifies the expected returns at different stages of the trade. The table includes timestamps and corresponding ROI values. Stop Loss and Trailing Stop: The strategy implements a stop loss mechanism to limit potential losses. It sets a predefined stop loss value (-0.04655). Additionally, it incorporates a trailing stop feature, which adjusts the stop loss level as the trade progresses positively. The trailing stop parameters are defined as trailing_stop_positive (0.02444) and trailing_stop_positive_offset (0.04406). Timeframe: The strategy operates on a 12-hour timeframe, meaning it analyzes and generates signals based on price data from the last 12 hours. Indicator Calculation: The strategy calculates various technical indicators, including "volatility_kcw," "volatility_dcp," "trend_macd_signal," and "trend_ema_fast," using the TA library. Populate Functions: The strategy defines three populate functions: populate_indicators, populate_buy_trend, and populate_sell_trend. These functions are responsible for calculating indicators, generating buy signals, and generating sell signals, respectively. Overall, the Heracles Strategy aims to identify profitable trading opportunities based on the selected technical indicators and predefined buy/sell conditions.