The Hour Strategy is a trading strategy that focuses on finding the best hours of the day to buy and sell assets. It operates in the hourly timeframe, so it is recommended to use a 1-hour timeframe when using this strategy. The strategy is implemented in the HourBasedStrategy class.
It uses the freqtrade library and requires the hyperopt module for optimization.
The author of the strategy is Masoud Azizi (@Mablue), and the strategy code is available on GitHub at https://github.com/mablue/.
The strategy defines several parameters and settings that can be customized:
buy_hour_min and buy_hour_max: The minimum and maximum hours for buying assets. sell_hour_min and sell_hour_max: The minimum and maximum hours for selling assets. minimal_roi: A table specifying the minimum return on investment (ROI) at different time intervals. stoploss: The stop-loss threshold for selling assets at a loss. timeframe: The timeframe used for the strategy (set to '1h' for hourly timeframe). The strategy also includes methods for populating indicators, buy signals, and sell signals based on the specified hours. The populate_indicators method adds an 'hour' column to the dataframe, indicating the hour of each data point. The populate_buy_trend method generates buy signals when the hour is within the specified buy hour range. The populate_sell_trend method generates sell signals when the hour is within the specified sell hour range. By backtesting different combinations of buy and sell hour ranges and optimizing the parameters, the strategy aims to identify profitable trading opportunities based on the best hours of the day to buy and sell assets.