The Ichimoku_v9 strategy is a trading strategy that uses the Ichimoku Cloud indicator to generate buy and sell signals. Here's a breakdown of how the strategy works:
The strategy calculates the Ichimoku Cloud indicator using the ichimoku function from the technical.indicators module. The indicator is calculated with specific parameters such as conversion line period, base line periods, lagging span, and displacement.
The calculated Ichimoku Cloud values are stored in different columns of the dataframe object:
tenkan: The Tenkan-sen line
kijun: The Kijun-sen line
senkou_a: The Senkou Span A line
senkou_b: The Senkou Span B line
cloud_green: A boolean value indicating if the price is above the cloud (green region)
cloud_red: A boolean value indicating if the price is below the cloud (red region)
The populate_buy_trend function determines the buy signals based on specific conditions:
When the price crosses above the Senkou Span A and is above both Senkou Span A and Senkou Span B, a buy signal is generated.
The populate_sell_trend function determines the sell signals based on specific conditions:
When the Tenkan-sen line crosses below the Kijun-sen line, and the price is below both Senkou Span A and Senkou Span B, and the cloud color is red, a sell signal is generated.
The strategy sets the minimal_roi (minimum return on investment) parameter to 100, indicating that the strategy aims to achieve a minimum 100% return. The stoploss parameter is set to -1, which means there is no fixed stop loss defined for this strategy. The ticker_interval parameter is set to '4h', indicating that the strategy operates on 4-hour candlestick data. The informative_pairs function returns an empty list, indicating that there are no additional pairs needed for informative purposes. Overall, the Ichimoku_v9 strategy uses the Ichimoku Cloud indicator to identify buy and sell signals based on specific conditions related to the cloud and the crossover of the Tenkan-sen and Kijun-sen lines.