The strategy, called "BinHV45," is a backtesting strategy for trading. Here's a breakdown of what it does:
It uses the Bollinger Bands indicator to identify potential buy signals. Bollinger Bands are calculated using the rolling mean and standard deviation of the stock prices.
The upper band is not explicitly used in this strategy.
The strategy defines a minimum return on investment (ROI) required for a trade to be considered successful.
In this case, the minimum ROI is set to 0.99 (99%). A stop loss is set at -0.05 (5% loss). If the trade reaches this level of loss, it will be automatically sold. The strategy operates on 1-minute timeframe data. It implements a trailing stop, which adjusts the stop loss level as the price moves favorably. The trailing stop is triggered if the price rises above a positive offset percentage (trailing_stop_positive_offset). The asset is sold if the price drops by a certain percentage (trailing_stop_positive) from its highest point since triggering the trailing stop. The strategy populates several indicators based on the price data:
'mid': The middle Bollinger Band value. 'lower': The lower Bollinger Band value. 'bbdelta': The absolute difference between the middle and lower Bollinger Bands. 'pricedelta': The absolute difference between the open and close prices. 'closedelta': The absolute difference between the close price and the previous close price. 'tail': The absolute difference between the close price and the low price. The populate_buy_trend function determines the buy signals based on certain conditions:
The previous lower Bollinger Band value is greater than 0. The 'bbdelta' value is greater than 0.008 times the close price. The 'closedelta' value is greater than 0.0175 times the close price. The 'tail' value is less than 0.25 times the 'bbdelta' value. The close price is lower than the previous lower Bollinger Band value. The close price is less than or equal to the previous close price. The populate_sell_trend function does not provide any specific sell signals. Therefore, there are no explicit conditions for selling in this strategy. Overall, the strategy aims to identify potential buying opportunities based on Bollinger Bands and a set of additional conditions. However, it does not provide specific sell signals and relies on the trailing stop and stop loss to manage exits from trades.