The CoreStrategy class is an implementation of the IStrategy interface. It consists of two main methods: populate_indicators and populate_buy_trend. The populate_indicators method takes a DataFrame and metadata as input and returns a DataFrame with populated indicators.
It performs calculations on the input data to generate additional indicators that will be used in the strategy.
These indicators include informative 1-hour indicators and normal timeframe indicators.
The method merges the informative indicators with the original DataFrame and fills any missing values. The populate_buy_trend method populates the buy trend for the strategy. It takes the DataFrame and metadata as input and returns a DataFrame with the buy trend populated. The method sets up multiple buy conditions and enables them based on certain criteria. It calculates various buy signals based on the conditions specified in the code. The buy signals are assigned to the DataFrame based on the enabled conditions and tagged accordingly. Overall, the CoreStrategy class is responsible for populating indicators and determining the buy trend based on specific conditions and calculations performed on the input data.