The CombinedBinHAndClucV6H strategy is a trading strategy that combines multiple indicators and conditions to generate buy and sell signals. The strategy first populates indicators using the provided dataframe and metadata. It checks the run mode and timeframe constraints for backtesting.
It merges informative indicators and gets the main indicators.
For the buy signal, the strategy sets conditions based on various indicators and parameters.
It checks conditions related to the Bollinger Bands (bbdelta, closedelta, tail), exponential moving averages (ema_200, ema_50), and other parameters like buy_bin_guard and buy_bin_enable. It assigns a value of 1 to 'buy_cond_bin' if the conditions are met. Similarly, it sets conditions for the 'buy_cond_cluc' and 'buy_cond_long' variables. The strategy then counts the number of conditions met and assigns it to the 'conditions_count' variable. If the conditions meet the minimum requirements and the volume is greater than 0, a 'buy' signal is generated. For the sell signal, the strategy checks conditions based on the upper Bollinger Band and volume. If these conditions are met, a 'sell' signal is generated. The strategy includes a custom stop loss, which checks the current profit and compares it to the loss threshold. If the profit is below the threshold and the specified time has passed since the trade was opened, a stop loss of 0.01 is returned; otherwise, the default stop loss is returned. The trade exit confirmation part obtains the analyzed dataframe and the last candle's data. If the verbose logging is enabled, it logs the exit trade details. Depending on the sell reason, such as 'force_sell' or 'roi', the strategy decides whether to exit the trade or not based on the specified conditions. Lastly, the strategy includes the SSL Channels with ATR indicator. It calculates the ATR (Average True Range) and calculates the smaHigh and smaLow based on the rolling mean of high and low prices, respectively. It determines the hlv (high-low value) based on the close price's relationship with smaHigh and smaLow. It calculates sslDown and sslUp based on the hlv values. In summary, the CombinedBinHAndClucV6H strategy combines indicators like Bollinger Bands, exponential moving averages, SSL Channels with ATR, and various conditions to generate buy and sell signals for backtesting trading strategies.