The Solipsis5 strategy is a trading strategy that uses various indicators to generate buy and sell signals for backtesting. Here's a breakdown of what the strategy does:
Indicator Population:
Calculates the KAMA (Kaufman Adaptive Moving Average) with a length of 233. Computes the RMI (Relative Momentum Index) with a length of 24 and a momentum period of 5.
Calculates the Rate of Change (ROC) with a time period of 1.
Computes the RSI (Relative Strength Index) based on the ROC with a time period of 3.
Determines the streak of consecutive positive or negative values using the mastreak function with a period of 4. Calculates the upper and lower bands of the PCC (Percentage Channel Channel) indicator with a period of 40 and a multiplier of 3. Calculates the streak-roc, which represents the percentage change between the current close price and the previous close price. Determines whether each candle is bullish (close price >= open price) or bearish (close price < open price). Identifies bullish trends based on the number of consecutive bullish candles in a rolling window of 5. Determines whether the RMI is increasing (rmi-up) or decreasing (rmi-dn) and counts the number of consecutive decreasing values in a rolling window of 8. Identifies streak breakouts by comparing streak-roc with the lower PCC band and counts the number of streak breakouts in a rolling window of 8. Calculates the SROC (Smoothed Rate of Change) with a rate of change length of 21, an EMA length of 13, and a smoothing period of 21. Determines the direction of the SSL (Simplified SuperSmoother) channels based on the SSLChannels_ATR indicator with a length of 21. Additional Data:
Retrieves informative data for a specified pair and timeframe. Calculates the 24-hour high and low prices based on the informative data. Computes the average daily range (ADR) as the difference between the 24-hour high and low prices. Stake Currency:
If the stake currency is BTC or ETH, additional indicators are calculated for the base currency and stake currency. Calculates the RMI for the base currency and stake currency with a length of 55 and a momentum period of 5. Buy Signal:
Generates buy signals based on multiple conditions, including:
The close price being below the informative 24-hour low price plus a specified percentage of the ADR. The count of consecutive RMI decreasing values (rmi-dn-count) exceeding a specified threshold. The count of streak breakouts (streak-bo-count) exceeding a specified threshold. The RMI value being within a specified range. The MP (Moving Percentage) value being below a specified threshold. Depending on the base trigger type ('pcc' or 'rmi'), additional conditions may be considered. If the stake currency is BTC or ETH, additional conditions based on the RMI values of the base and stake currencies are included. The volume being greater than zero. Sell Signal:
No specific sell signals are generated in this strategy. Custom Stoploss:
Calculates the current trade duration in minutes. Considers the current profit, custom trade information (had-trend), and specified parameters to determine whether to apply a stop loss. The stop loss can be triggered based on the rate of change (sroc) or the trade duration. Returns a stop loss factor (0.01 for a stop loss or 1 for no stop loss). Custom Sell:
Calculates the current trade duration in minutes and the maximum profit ratio. Considers the current profit, last candle's SROC value, trade duration, and specified parameters to determine whether to sell. Returns a sell factor based on the specified conditions. Please note that this description is a high-level summary of the strategy's functionality and may not capture all the details and nuances of its implementation.