The "Stavix" strategy is a trading strategy that uses Bollinger Bands, moving averages, and other indicators to identify buying and selling opportunities in the market. Here is a breakdown of what the strategy does:
Bollinger Bands Calculation:
The strategy calculates the Bollinger Bands for the given stock price data using a window size of 40 and 2 standard deviations. It calculates the lower band and the middle band of the Bollinger Bands.
Indicator Population:
The strategy populates several additional indicators in the DataFrame, including:
'bbdelta': The absolute difference between the Bollinger Bands' middle band and lower band.
'closedelta': The absolute difference between the current close price and the previous close price.
'tail': The absolute difference between the current close price and the lowest price within the same candle. 'bb_lowerband': The lower band of Bollinger Bands based on the typical price. 'bb_middleband': The middle band of Bollinger Bands based on the typical price. 'ema_slow': The exponential moving average with a time period of 50. 'volume_mean_slow': The rolling mean of volume with a window size of 30. Informative Pair Calculation:
The strategy determines a list of informative pairs based on the current whitelist. It sets the informative pairs to be derived from the selected pairs with a timeframe of 6 hours. Buy Trend Definition:
The strategy identifies buy signals based on the following conditions:
The 'rocr_6h' indicator is greater than 0.60. Either of the following conditions is met:
The lower Bollinger Band is positive, and certain criteria involving 'bbdelta', 'closedelta', 'tail', and 'close' are satisfied. The current close price is below the exponential moving average ('ema_slow'), 0.985 times the lower Bollinger Band ('bb_lowerband'), and the volume is lower than the previous mean volume multiplied by 20. Sell Trend Definition:
The strategy identifies sell signals when the current close price is above the middle Bollinger Band ('bb_middleband'). The strategy sets a minimal return on investment (ROI) of 0.15 and a stop-loss of -0.01. It uses 1-minute intervals for ticker data and operates within a 1-minute timeframe. The strategy incorporates informative pairs for better decision-making.