Hybrid

Hybrid indicators combine multiple analytical approaches to provide comprehensive market analysis. These indicators often merge trend, momentum, volatility, and volume components for enhanced signal quality.

Import Statement

from openalgo import api, ta

# Get data using OpenAlgo API
client = api(api_key='your_api_key_here', host='http://127.0.0.1:5000')
df = client.history(symbol="SBIN", exchange="NSE", interval="5m", 
                   start_date="2025-04-01", end_date="2025-04-08")

Available Hybrid Indicators


Average Directional Index (ADX)

ADX measures the strength of a trend regardless of direction, providing both directional indicators (+DI, -DI) and trend strength (ADX).

Usage

di_plus, di_minus, adx = ta.adx(high, low, close, period=14)

Parameters

  • high (array-like): High prices

  • low (array-like): Low prices

  • close (array-like): Closing prices

  • period (int, default=14): Period for ADX calculation

Returns

  • tuple: (+DI, -DI, ADX) arrays in the same format as input

Example


Aroon Indicator

Aroon indicators measure the time since the highest high and lowest low, indicating trend strength and potential reversals.

Usage

Parameters

  • high (array-like): High prices

  • low (array-like): Low prices

  • period (int, default=14): Period for Aroon calculation

Returns

  • tuple: (aroon_up, aroon_down) arrays in the same format as input

Example


Pivot Points

Traditional pivot points calculate support and resistance levels based on previous period's high, low, and close.

Usage

Parameters

  • high (array-like): High prices

  • low (array-like): Low prices

  • close (array-like): Closing prices

Returns

  • tuple: (pivot, r1, s1, r2, s2, r3, s3) arrays

Example


Parabolic SAR

Parabolic SAR provides trailing stop levels and trend direction signals.

Usage

Parameters

  • high (array-like): High prices

  • low (array-like): Low prices

  • acceleration (float, default=0.02): Acceleration factor

  • maximum (float, default=0.2): Maximum acceleration factor

Returns

  • tuple: (sar_values, trend_direction) arrays

Example


Directional Movement Index (DMI)

DMI focuses on the directional indicators (+DI and -DI) without the ADX component.

Usage

Parameters

  • high (array-like): High prices

  • low (array-like): Low prices

  • close (array-like): Closing prices

  • period (int, default=14): Period for DMI calculation

Returns

  • tuple: (+DI, -DI) arrays in the same format as input

Example


Williams Fractals

Williams Fractals identify turning points (fractals) in price action using local highs and lows.

Usage

Parameters

  • high (array-like): High prices

  • low (array-like): Low prices

  • periods (int, default=2): Number of periods to check (minimum 2)

Returns

  • tuple: (fractal_up, fractal_down) boolean arrays indicating fractal points

Example


Random Walk Index (RWI)

RWI measures how much a security's price movement differs from a random walk, helping identify trending vs. random price movements.

Usage

Parameters

  • high (array-like): High prices

  • low (array-like): Low prices

  • close (array-like): Closing prices

  • period (int, default=14): Period for RWI calculation

Returns

  • tuple: (rwi_high, rwi_low) arrays in the same format as input

Example


Complete Example: Comprehensive Trend Analysis

Advanced Usage: Multi-Timeframe Analysis

Performance Tips

  1. Vectorized Operations: Use pandas operations for better performance with large datasets

  2. Memory Optimization: Calculate only needed indicators to reduce memory usage

  3. Caching: Store intermediate calculations for reuse across multiple indicators

  4. Batch Processing: Process multiple symbols together when possible

Common Use Cases

  1. Trend Confirmation: Use ADX with Aroon for trend strength validation

  2. Entry Timing: Combine SAR with DMI for precise entry points

  3. Support/Resistance: Use Pivot Points with Fractals for key levels

  4. Risk Management: Use RWI to distinguish trending from random movements

  5. Multi-Timeframe: Align signals across different timeframes for higher probability trades

Last updated

Was this helpful?