The IchimokuStrategy is a trading strategy that uses the Ichimoku Cloud indicator to generate buy and sell signals. The strategy is implemented as a class that inherits from the IStrategy interface. Here is a brief description of how the strategy works:
The strategy calculates various indicators based on the input price data using the populate_indicators method.
These indicators include the Tenkan Sen, Kijun Sen, Senkou Span A, Senkou Span B, Cloud Green, and Cloud Red.
The populate_buy_trend method populates the "buy" column of the DataFrame with a value of 1 when the following conditions are met:
The price crosses above the Kijun Sen line.
The price is above both Senkou Span A and Senkou Span B. The Cloud Red indicator is True. The populate_sell_trend method populates the "sell" column of the DataFrame with a value of 1 when the following conditions are met:
The price crosses above the Kijun Sen line. The price is below both Senkou Span A and Senkou Span B. The Cloud Green indicator is True. The strategy also defines other parameters such as the minimal return on investment (minimal_roi), stop loss percentage (stoploss), ticker interval (ticker_interval), order types, and order time in force. Overall, the IchimokuStrategy aims to capture bullish signals when the price crosses above the Kijun Sen line and is above the cloud, and bearish signals when the price crosses below the Kijun Sen line and is below the cloud. It uses the Ichimoku Cloud indicator to identify these signals and generate trading decisions.