The "AlwaysBuy" strategy is a simple trading strategy implemented in Python using the Freqtrade library. Here's a description of what the strategy does:
The strategy inherits from the IStrategy interface provided by Freqtrade. It defines the INTERFACE_VERSION as 3, indicating compatibility with a specific version of the Freqtrade interface.
The strategy sets a predefined ROI (Return on Investment) table, indicating the expected returns at different points in time.
In this case, it specifies that after 0 time units, the return is 1, after 100 time units the return is 2, after 200 time units the return is 3, and after 300 time units the return is -1.
It sets a stoploss value of -0.2, which means that if the trade goes against the desired direction and the loss reaches 20%, the trade will be stopped. The strategy does not use a trailing stop, as trailing_stop is set to False. It defines the timeframe for the strategy as "5m", indicating a 5-minute timeframe for trading decisions. The strategy does not use an exit signal, as use_exit_signal is set to False. The strategy also includes three methods to populate different aspects of the trading data:
populate_indicators: This method is responsible for calculating any required indicators based on the input dataframe and metadata. In this case, it returns the input dataframe without any modifications. populate_entry_trend: This method is responsible for determining the entry conditions for trades. It modifies the input dataframe by adding columns for the entry signal, setting the value to 1, and adding an entry tag as "entry_reason" for all rows. populate_exit_trend: This method is responsible for determining the exit conditions for trades. It returns the input dataframe without any modifications. Overall, the "AlwaysBuy" strategy is a very basic strategy that always generates a long (buy) signal and sets predefined ROI levels for different time periods. It does not incorporate any complex indicators or exit signals, making it a straightforward strategy to backtest.