AI Model for Technical Indicators Analysis RSI MACD Bollinger

We design and deploy artificial intelligence systems: from prototype to production-ready solutions. Our team combines expertise in machine learning, data engineering and MLOps to make AI work not in the lab, but in real business.
Showing 1 of 1 servicesAll 1566 services
AI Model for Technical Indicators Analysis RSI MACD Bollinger
Medium
~2-3 business days
FAQ
AI Development Areas
AI Solution Development Stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1214
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    852
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_logo-advance_0.png
    B2B Advance company logo design
    561
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    823

Development of AI-based Technical Indicators Analysis Model: RSI, MACD, Bollinger

Technical analysis has existed longer than modern neural networks. RSI, MACD, Bollinger Bands — empirically discovered tools that describe market dynamics. The ML approach does not replace these indicators, but automatically learns from them: finding optimal parameters, combinations and context of application.

RSI: Mean Reversion Prediction

Standard RSI(14):

RSI = 100 - 100 / (1 + RS)
RS = Average Gain / Average Loss over 14 periods

Traditional rule: RSI < 30 → oversold → buy signal. Problem: performs poorly in trending markets (RSI can stay below 30 for weeks in downtrend).

ML Enhancement:

  • Period optimization (7-28) via Optuna for each instrument
  • RSI in trend context: rsi_divergence_from_trend = rsi - trend_adjusted_rsi
  • Multi-timeframe RSI: 7d, 14d, 21d as separate features
  • RSI velocity: RSI change over 3 days (acceleration signal)

MACD: Momentum and Cross-Signals

Standard MACD:

MACD Line = EMA(12) - EMA(26)
Signal Line = EMA(9) of MACD Line
Histogram = MACD - Signal

ML Features from MACD:

  • macd_histogram: value and sign
  • macd_histogram_trend: increasing or decreasing (momentum of momentum)
  • macd_signal_cross: 1 on bullish cross (MACD crossed Signal from below)
  • macd_zero_cross: zero line crossing
  • macd_divergence: new price low, but higher MACD — bullish divergence

Parametric Optimization: Standard (12, 26, 9) — not necessarily optimal for specific instrument/timeframe. Bayesian optimization of (fast_period, slow_period, signal_period) space by Sharpe ratio on walkforward validation.

Bollinger Bands: Volatility and Breakouts

Standard Bollinger Bands(20, 2):

Middle Band = SMA(20)
Upper Band = SMA(20) + 2 × σ(20)
Lower Band = SMA(20) - 2 × σ(20)

ML Features:

  • %b = (Price - Lower) / (Upper - Lower): price position in band (0-1)
  • bandwidth = (Upper - Lower) / Middle: band width, volatility proxy
  • squeeze: bandwidth < 6-month minimum → breakout coming
  • band_walk: price touches upper/lower band for several days → trending market

Bollinger Squeeze Strategy: Squeeze precedes significant movement. Direction uncertain, but magnitude expected. ML predicts breakout direction from squeeze.

Combined ML Model

Integration of all indicators into single model:

Feature matrix:

def build_technical_features(df):
    features = {}

    # RSI family
    for period in [7, 14, 21]:
        features[f'rsi_{period}'] = talib.RSI(df.close, period)
    features['rsi_divergence'] = compute_rsi_divergence(df)

    # MACD family
    macd, signal, hist = talib.MACD(df.close, 12, 26, 9)
    features['macd_hist'] = hist
    features['macd_hist_trend'] = hist.diff(3)
    features['macd_cross'] = (macd > signal).astype(int)

    # Bollinger
    upper, middle, lower = talib.BBANDS(df.close, 20, 2, 2)
    features['bb_pct_b'] = (df.close - lower) / (upper - lower)
    features['bb_bandwidth'] = (upper - lower) / middle
    features['bb_squeeze'] = (features['bb_bandwidth'] < features['bb_bandwidth'].rolling(126).min() * 1.1)

    # Stochastic
    slowk, slowd = talib.STOCH(df.high, df.low, df.close)
    features['stoch_k'] = slowk
    features['stoch_cross'] = (slowk > slowd).astype(int)

    return pd.DataFrame(features)

Model: LightGBM with quantile losses. Target: forward 5-day return. Feature importance will reveal which indicators are truly predictive.

Context-Dependency of Indicators

Key insight: indicators work differently in different market regimes:

  • In trending market: RSI < 30 = continuation of decline (not reversal!)
  • In ranging market: RSI < 30 = real reversal signal
  • High volatility: Bollinger Bands need expansion (3σ instead of 2σ)

Regime-conditional model:

# Regime detector
regime = classify_market_regime(df)  # 'trending', 'ranging', 'volatile'

# Different models for different regimes
if regime == 'trending':
    signal = momentum_model.predict(features)
elif regime == 'ranging':
    signal = mean_reversion_model.predict(features)

Backtesting Technical Approach

Simple strategy for model validation:

  1. When signal > threshold: long position N lots
  2. When signal < -threshold: short
  3. Stop: -2 × ATR(14)
  4. Target: +4 × ATR(14)

Real transaction cost calculation:

  • Commission: 0.04% per side (Interactive Brokers)
  • Slippage: 0.02-0.05%
  • Financing: overnight swap for forex/CFD

Evaluation: Sharpe > 1.0 on out-of-sample after TC — sufficient result for further development.

Timeline: baseline model with RSI+MACD+Bollinger features — 2-3 weeks. Full system with regime detection, parametric optimization and backtesting — 6-8 weeks.