The Hour Strategy is designed to find the best hours of the day for buying and selling assets in a trading strategy. It operates on an hourly timeframe and analyzes the price data within specific hours to make trading decisions. The strategy is implemented in the HourBasedStrategy class.
It requires the hyperopt library to be installed before running.
The strategy defines parameters for buying and selling hours, as well as a minimal return on investment (ROI) table and a stop-loss value.
During the backtesting process, the strategy populates indicators based on the input data, including the hour of each data point. It then determines the buying and selling trends by comparing the current hour with the specified buy and sell hour ranges. The strategy aims to optimize trading performance by identifying profitable hours for trading. By adjusting the buy and sell hour parameters, users can explore different time periods to find the most favorable trading windows. Please note that the strategy provided in the code includes specific examples for different trading pairs such as SHIB/USDT, SAND/USDT, and KDA/USDT, each with their own parameter settings and performance metrics. These examples can be used as references or starting points for further customization.