The BinHV45 strategy is a trading strategy that uses Bollinger Bands and various price indicators to identify buying opportunities in the market. Here's a brief description of what the strategy does:
It calculates the Bollinger Bands using the closing prices of the stock over a specified window size and number of standard deviations. It populates several indicators in the dataframe:
'mid': The middle band of the Bollinger Bands.
'lower': The lower band of the Bollinger Bands.
'bbdelta': The absolute difference between the middle and lower bands.
'pricedelta': The absolute difference between the open and close prices. 'closedelta': The absolute difference between the current close price and the previous close price. 'tail': The absolute difference between the close price and the low price. It identifies buying opportunities based on the following conditions:
The lower band of the Bollinger Bands in the previous period is greater than zero. The 'bbdelta' is greater than 0.8% of the current close price. The 'closedelta' is greater than 1.75% of the current close price. The 'tail' is less than 25% of the 'bbdelta'. The current close price is lower than the previous lower band. The current close price is less than or equal to the previous close price. It populates the 'buy' column in the dataframe with a value of 1 for the identified buying opportunities. It does not provide any specific sell signals, as the 'sell' column is set to 0 for all data points. The strategy aims to achieve a minimal return on investment (ROI) of 99% and has a stoploss of -5%. It operates on a 1-minute timeframe and includes trailing stop functionality, where a positive stoploss is triggered if the price crosses above a certain percentage and a sell signal is generated if the price dips down by a specified amount.