The strategy implemented in the provided code is called "BinHV45." It uses Bollinger Bands as a primary indicator for making buy decisions. Here's a breakdown of how the strategy works:
Bollinger Bands Calculation:
The strategy calculates Bollinger Bands using a window size of 40 and 2 standard deviations. The upper band, middle band (average), and lower band are computed.
Indicator Calculation:
The strategy calculates additional indicators based on the price data.
'bbdelta': Absolute difference between the middle band and the lower band.
'pricedelta': Absolute difference between the open and close prices. 'closedelta': Absolute difference between the current close price and the previous close price. 'tail': Absolute difference between the close price and the lowest price within the candle. Buy Signal Generation:
The strategy generates buy signals based on specific conditions. If the previous lower band is greater than 0, and the following conditions are met:
'bbdelta' is greater than a threshold defined by the 'buy_bbdelta' parameter. 'closedelta' is greater than a threshold defined by the 'buy_closedelta' parameter. 'tail' is less than a threshold defined by the 'buy_tail' parameter. The current close price is less than the previous lower band and less than or equal to the previous close price. When all conditions are satisfied, a 'buy' signal is marked as 1 in the dataframe. Sell Signal Generation:
The strategy does not provide any specific sell signals. The 'sell' column in the dataframe is set to 0 for all data points. Other relevant information about the strategy:
It uses a minimal return-on-investment (ROI) setting of 0.0125, meaning a position is closed when it reaches a profit of 1.25%. It has a stop loss set at -5%, meaning a position is closed if it reaches a loss of 5%. The strategy operates on 1-minute timeframe data. There are hyperparameters defined under 'buy_params' for optimization purposes. Overall, the strategy aims to identify potential buying opportunities based on Bollinger Bands and certain price-related conditions. However, it does not provide any specific sell signals, leaving the selling decision to be implemented separately.