Tags: SMABB

This strategy employs a hybrid quantitative analysis approach, combining binomial distribution model and regression analysis, to identify different market regimes. The strategy first calculates the Simple Moving Average (SMA) and Bollinger Bands (BB) indicators, then computes the Z-score based on the mean and standard deviation of historical returns. When the Z-score is below the lower threshold and the price is below the lower band, the strategy enters a long position; when the Z-score is above the upper threshold and the price is above the upper band, the strategy closes the position.

The core principle of this strategy is to use the Z-score to measure the position of current returns relative to the distribution of historical returns. The formula for calculating the Z-score is: (Current Return - Historical Return Mean) / Historical Return Standard Deviation. A higher Z-score indicates that the current return is more extreme and the probability of overbought is higher; a lower Z-score indicates that the current return is more extreme and the probability of oversold is higher. At the same time, the strategy also incorporates the Bollinger Bands indicator, using price breakouts above or below the bands as a secondary confirmation. The strategy generates trading signals only when both the Z-score and Bollinger Bands conditions are met simultaneously. This combination approach can effectively reduce the occurrence of false signals.

- Quantitative Analysis: The strategy is entirely based on quantitative indicators, with clear rules that are easy to implement and backtest.
- Dual Confirmation: The strategy employs both the Z-score and Bollinger Bands indicators, forming a dual filtering mechanism to improve signal accuracy.
- Statistical Foundation: The Z-score originates from the normal distribution theory in statistics, with a solid theoretical foundation, and can objectively measure the extremity of current returns.
- Parameter Flexibility: Users can adjust parameters such as the SMA period, Bollinger Bands multiplier, and Z-score thresholds according to their needs, flexibly adapting to different markets.

- Parameter Sensitivity: Different parameter settings may lead to significant differences in strategy performance, requiring extensive parameter optimization and stability testing.
- Trend Risk: When the market exhibits strong trends, the Z-score may remain in extreme regions for an extended period, resulting in infrequent or completely absent strategy signals.
- Overfitting Risk: If the strategy parameters are over-optimized, it may lead to overfitting and poor out-of-sample performance.
- Black Swan Risk: Under extreme market conditions, historical statistical patterns may fail, exposing the strategy to significant drawdown risks.

- Dynamic Parameters: Consider dynamically adjusting the Z-score thresholds and Bollinger Bands multiplier based on indicators such as market volatility and trend strength to improve adaptability.
- Trend Filtering: Overlay trend determination indicators, such as MA crossover or DMI, on top of the existing mechanism to avoid excessive invalid signals during strong trends.
- Portfolio Optimization: Combine this strategy with other quantitative strategies (such as momentum, mean reversion, etc.) to leverage their respective strengths and improve robustness.
- Stop-Loss and Take-Profit: Introduce reasonable stop-loss and take-profit mechanisms to control risk exposure per trade and improve risk-adjusted returns.

The Hybrid Binomial Z-Score Quantitative Strategy is a quantitative trading strategy based on statistical principles, identifying potential overbought and oversold opportunities by comparing current returns with the distribution of historical returns. Additionally, the strategy employs the Bollinger Bands indicator for secondary confirmation, enhancing signal reliability. The strategy rules are clear and easy to implement and optimize, but it also faces challenges such as parameter sensitivity, trend risk, overfitting risk, etc. In the future, the strategy can be optimized in terms of dynamic parameters, trend filtering, portfolio optimization, stop-loss and take-profit mechanisms, etc., to improve its adaptability and robustness. Overall, this strategy provides a simple yet effective approach for quantitative trading, worthy of further exploration and refinement.

/*backtest start: 2023-05-22 00:00:00 end: 2024-05-27 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=5 strategy("Estratégia Híbrida Quantitativa", overlay=true) // Definição de parâmetros sma_length = input.int(20, title="Período da SMA") threshold_high = input.float(1.5, title="Threshold Alto") threshold_low = input.float(-1.5, title="Threshold Baixo") lookback_period = input.int(252, title="Período de Retorno Histórico (dias)") // Funções auxiliares f_sma(source, length) => ta.sma(source, length) f_bollinger_band(source, length, mult) => basis = ta.sma(source, length) dev = mult * ta.stdev(source, length) [basis + dev, basis - dev] // Cálculo dos indicadores sma = f_sma(close, sma_length) [upper_band, lower_band] = f_bollinger_band(close, sma_length, 2) // Regime de Mercado: Binomial retornos = ta.change(close, 1) media_retornos = ta.sma(retornos, lookback_period) desvio_padrao_retornos = ta.stdev(retornos, lookback_period) // Indicador de Regime: Z-Score z_score = (retornos - media_retornos) / desvio_padrao_retornos // Sinal de Compra e Venda sinal_compra = z_score < threshold_low and close < lower_band sinal_venda = z_score > threshold_high and close > upper_band // Execução de Ordem if (sinal_compra) strategy.entry("Long", strategy.long) if (sinal_venda) strategy.close("Long") // Plotagem dos Indicadores plot(sma, title="SMA", color=color.blue) plot(upper_band, title="Upper Bollinger Band", color=color.red) plot(lower_band, title="Lower Bollinger Band", color=color.green) hline(threshold_high, "Threshold Alto", color=color.red, linestyle=hline.style_dashed) hline(threshold_low, "Threshold Baixo", color=color.green, linestyle=hline.style_dashed) plot(z_score, title="Z-Score", color=color.purple)

- Technical Support and Resistance Indicator Precision Trading Strategy
- Bollinger Band Overbought/Oversold Strategy
- Bollinger Bands Breakout Strategy
- Bollinger Bands Dynamic Breakout Strategy
- Bollinger Bands Momentum Reversal Quantitative Strategy
- Bollinger Bands Breakout Quantitative Trading Strategy
- Bollinger Bands Precise Crossover Quantitative Strategy
- Bollinger Bands Mean Reversion Trading Strategy with Dynamic Support
- Bollinger Bands RSI Trading Strategy
- Bollinger Bands Strategy: Precision Trading for Maximum Gains

- RSI+Supertrend Trend-Following Trading Strategy
- Ichimoku Kumo Trading Strategy
- Dynamic ATR Stop Loss and Take Profit Moving Average Crossover Strategy
- EMA Trend Momentum Candlestick Pattern Strategy
- G-Channel Trend Detection Strategy
- Moving Average Crossover with Trailing Stop Loss Strategy
- EMA Crossover Trading Strategy with Dynamic Take Profit and Stop Loss
- Bollinger Bands and EMA Trend Following Strategy
- WaveTrend Oscillator Divergence Strategy
- Volatility and Linear Regression-based Long-Short Market Regime Optimization Strategy
- RSI and MA Combination Strategy
- EMA Momentum Trading Strategy
- FVG Momentum Scalping Strategy
- ATR and EMA-based Dynamic Take Profit and Stop Loss Adaptive Strategy
- Trend Following with Breakout and Frequency Filter (Long Only)
- Fibonacci Golden Harmony Breakout Strategy
- Dynamic Market Regime Identification Strategy Based on Linear Regression Slope
- Trend Reversal Trading Strategy Based on RSI Divergence
- Dual Moving Average RSI Momentum Strategy Based on EMA and Trendline Breakouts
- Dynamic Position Management Daily Trading Strategy