The Obelisk_TradePro_Ichi_v1_1 strategy is an implementation of the Ichimoku Cloud trading strategy. Here is a breakdown of what the strategy does:
populate_indicators function:
Calculates the Ichimoku Cloud indicators (conversion line, base line, lagging span, chikou span, senkou span, leading senkou span) using the provided parameters and adds them to the dataframe. Multiplies the 'cloud_green' values by 1 and 'cloud_red' values by -1.
Determines the 'future_green' value by checking if the leading senkou span A is greater than the leading senkou span B, and converts it to an integer (2 for True, 0 for False).
Calculates the 'chikou_high' value by checking if the chikou span is higher than both senkou span A and senkou span B, shifted by a displacement and fills any NaN values with 0.
Determines the 'go_long' value by checking multiple conditions including the tenkan sen being higher than the kijun sen, the close price being higher than both senkou span A and senkou span B, the 'future_green' value being greater than 0, and the 'chikou_high' value being greater than 0. The result is converted to an integer (3 for True, 0 for False). Returns the updated dataframe with the added indicator values. populate_buy_trend function:
Sets the 'buy' column of the dataframe to 1 when the 'go_long' value crosses above 0 using the qtpylib.crossed_above function. Returns the updated dataframe. populate_sell_trend function:
Sets the 'sell' column of the dataframe to 1 when either the tenkan sen crosses below the kijun sen or the close price crosses below the kijun sen using the qtpylib.crossed_below function. Returns the updated dataframe. In summary, this strategy uses the Ichimoku Cloud indicators to generate buy and sell signals. It identifies potential buying opportunities when certain conditions are met (go_long value crosses above 0), and selling opportunities when the tenkan sen or close price crosses below the kijun sen.