The Stavix2 strategy is a trading strategy implemented in Python. It uses the Ichimoku Cloud indicator to generate buy and sell signals. Here's a breakdown of what the strategy does:
The strategy defines a minimal return on investment (ROI) of 0.15 (15%) and a stop loss of -0.10 (-10%).
These values determine the exit conditions for trades.
The ticker interval is set to '1m', indicating that the strategy operates on 1-minute candlestick data.
The populate_indicators function calculates the components of the Ichimoku Cloud indicator (tenkan_sen, kijun_sen, senkou_span_a, senkou_span_b, chikou_span) using the provided parameters (conversion_line_period=200, base_line_periods=350, lagging_span=150, displacement=75). These indicator values are added to the dataframe. The populate_buy_trend function identifies the conditions for entering a long position (buy signal) based on the Ichimoku Cloud and other indicators. The strategy buys when the close price is above both senkou_span_a and senkou_span_b, and when the kijun_sen line crosses above the tenkan_sen line. The populate_sell_trend function identifies the conditions for exiting a long position (sell signal) based on the Ichimoku Cloud and other indicators. The strategy sells when the close price is below both senkou_span_a and senkou_span_b, and when the tenkan_sen line crosses above the kijun_sen line. The strategy uses these buy and sell signals to generate backtesting results for different trading pairs or instruments.