The Schism2 strategy is a trading strategy implemented as a class that inherits from the IStrategy interface. Here is a brief description of what the strategy does:
It first populates various indicators using the input dataframe and metadata. These indicators include:
rmi-slow: RMI (Relative Momentum Index) with a length of 21 and momentum of 5.
rmi-fast: RMI with a length of 8 and momentum of 4.
roc: Rate of Change with a time period of 6.
mp: RSI (Relative Strength Index) calculated on the roc indicator with a time period of 6. rmi-up: Binary indicator set to 1 when rmi-slow is greater than or equal to its previous value, 0 otherwise. rmi-dn: Binary indicator set to 1 when rmi-slow is less than or equal to its previous value, 0 otherwise. rmi-up-trend: Binary indicator set to 1 when the sum of the last 3 values of rmi-up is greater than or equal to 2, 0 otherwise. rmi-dn-trend: Binary indicator set to 1 when the sum of the last 3 values of rmi-dn is greater than or equal to 2, 0 otherwise. Additional indicators related to fiat, stake currency, and informative data are also calculated based on the configuration. The strategy then defines conditions for buy signals in the populate_buy_trend method:
If there is an active trade, it checks conditions related to profit factor, linear growth, and various indicators. If there is no active trade, it checks conditions related to price, RSI, trend indicators, and volume, among others. It also considers additional conditions based on the stake currency and fiat. The strategy also defines conditions for sell signals in the populate_sell_trend method:
If there is an active trade, it checks conditions related to profit cutoff, RMI trend, and volume. If there are other open trades, it checks conditions based on the average profit of other trades and the number of free slots. If there are no other open trades, it checks conditions related to the biggest loser trade and volume. The strategy includes various custom methods, such as retrieving trade data, calculating profit ratios, adjusting rates, and getting current prices. Overall, the Schism2 strategy combines multiple indicators and conditions to generate buy and sell signals for trading.