W

WquGuru·QuantLearn

BreakoutIntermediate

Dual Thrust

Range breakout strategy with dynamic thresholds

Historical Backtest Results

Backtesting results demonstrating Dual Thrust strategy performance across different market conditions.

Dual Thrust Trading Positions

Dual Thrust Trading Positions

Intraday position changes showing long/short signals triggered by upper and lower threshold breaks.

Dynamic Threshold Levels

Dynamic Threshold Levels

Daily upper and lower thresholds calculated using previous day's range, showing breakout trigger levels.

Strategy Performance

Strategy Performance

Cumulative returns comparing Dual Thrust strategy performance against buy-and-hold benchmark.

Opening Range Breakout Theory

Dual Thrust is a classic opening range breakout strategy developed by Michael Chalek, founder of Universal Technical Systems.

The strategy is based on the concept that significant price movements often occur when markets break out of established trading ranges.

Unlike complex rocket science algorithms, Dual Thrust relies on elementary mathematical calculations accessible to any trader.

The strategy establishes upper and lower thresholds based on previous days' high, low, open, and close prices.

When the current price exceeds these thresholds, it signals potential momentum continuation, triggering long or short positions.

The beauty of this strategy lies in its simplicity - it requires no stop-loss mechanisms as positions are reversed when price crosses from one threshold to another.

Mathematical Foundation

1
Range Calculation

Range=Max(Ht1Ct1,Ct1Lt1)Range = Max(H_{t-1} - C_{t-1}, C_{t-1} - L_{t-1})

Daily range is the maximum of yesterday's high minus close or close minus yesterday's low.

2
Upper Threshold

Upper=Ot+k1×RangeUpper = O_t + k_1 \times Range

Upper breakout threshold where k₁ is typically 0.7. Long positions initiated when price exceeds this level.

3
Lower Threshold

Lower=Otk2×RangeLower = O_t - k_2 \times Range

Lower breakout threshold where k₂ is typically 0.7. Short positions initiated when price falls below this level.

4
Alternative Range Formula

Range=Ht1Lt1Range = H_{t-1} - L_{t-1}

Simple high-low range calculation, often used as alternative to the max formula above.

Core Algorithm Implementation

The Dual Thrust algorithm calculates dynamic thresholds each day and generates signals when price breaks these levels.

Threshold Calculation

python
def dual_thrust_thresholds(df, k1=0.7, k2=0.7):
    """Calculate Dual Thrust upper and lower thresholds"""
    df = df.copy()
    
    # Calculate daily range using max formula
    df['range'] = np.maximum(
        df['High'].shift(1) - df['Close'].shift(1),
        df['Close'].shift(1) - df['Low'].shift(1)
    )
    
    # Alternative: simple high-low range
    # df['range'] = df['High'].shift(1) - df['Low'].shift(1)
    
    # Calculate thresholds
    df['upper_threshold'] = df['Open'] + k1 * df['range']
    df['lower_threshold'] = df['Open'] - k2 * df['range']
    
    return df

Calculates dynamic upper and lower thresholds based on previous day's range and current day's opening price.

Signal Generation

python
def generate_signals(df):
    """Generate Dual Thrust trading signals"""
    df = df.copy()
    df['position'] = 0
    df['signal'] = 0
    
    current_position = 0
    
    for i in range(1, len(df)):
        price = df['Close'].iloc[i]
        upper = df['upper_threshold'].iloc[i]
        lower = df['lower_threshold'].iloc[i]
        
        # Long signal when price breaks upper threshold
        if price > upper and current_position <= 0:
            df.loc[df.index[i], 'signal'] = 1
            current_position = 1
            
        # Short signal when price breaks lower threshold  
        elif price < lower and current_position >= 0:
            df.loc[df.index[i], 'signal'] = -1
            current_position = -1
            
        df.loc[df.index[i], 'position'] = current_position
    
    return df

Generates trading signals when price breaks through upper or lower thresholds, automatically reversing positions.

Intraday Position Management

python
def intraday_dual_thrust(df, k1=0.7, k2=0.7):
    """Complete intraday Dual Thrust implementation"""
    df = dual_thrust_thresholds(df, k1, k2)
    df = generate_signals(df)
    
    # Clear all positions at end of trading day
    df['date'] = pd.to_datetime(df.index).date
    for date in df['date'].unique():
        day_mask = df['date'] == date
        day_data = df[day_mask]
        if len(day_data) > 0:
            # Force close at end of day
            df.loc[day_data.index[-1], 'position'] = 0
    
    # Calculate returns
    df['strategy_returns'] = df['position'].shift(1) * df['Close'].pct_change()
    df['cumulative_returns'] = (1 + df['strategy_returns']).cumprod() - 1
    
    return df

Complete implementation including intraday position management and mandatory end-of-day position clearing.

Implementation Steps

  1. 1Calculate previous day's trading range using high, low, open, and close prices
  2. 2Determine upper threshold: Today's open + k₁ × Range
  3. 3Determine lower threshold: Today's open - k₂ × Range
  4. 4Monitor intraday price movements against calculated thresholds
  5. 5Enter long position when price breaks above upper threshold
  6. 6Enter short position when price breaks below lower threshold
  7. 7Reverse positions when price crosses from one threshold to another
  8. 8Clear all positions at the end of trading day (mandatory rule)
  9. 9Recalculate thresholds for next trading day

Key Metrics

Average daily range as percentage of opening price
Breakout success rate (percentage of profitable threshold breaks)
Average holding period per position
Maximum intraday drawdown
Win rate vs average win/loss ratio
Optimal k₁ and k₂ parameters for different markets
Transaction cost impact on net returns

Risk Considerations

False breakouts in sideways markets can generate multiple whipsaw trades
Strategy performs poorly during low volatility periods with minimal price movement
Overnight gaps can cause significant slippage when markets open beyond thresholds
High-frequency trading may require substantial transaction cost considerations
Market microstructure noise can trigger premature signals in liquid markets
Strategy assumes immediate execution at threshold prices, which may not be realistic
Lacks stop-loss protection, relying entirely on threshold reversal signals

Practice Implementation

Prerequisites

Mathematical Background

  • • Linear regression and OLS estimation
  • • Time series analysis (stationarity, unit roots)
  • • Hypothesis testing and p-values
  • • Basic econometrics (error correction models)

Technical Skills

  • • Python programming (pandas, numpy)
  • • Statistical libraries (statsmodels)
  • • Data visualization (matplotlib)
  • • Financial data handling (yfinance)

Complete Implementation

Access the full Python implementation from the original quantitative trading repository:

bash
# Complete pair trading implementation
git clone https://github.com/je-suis-tm/quant-trading.git
cd quant-trading
python "Pair trading backtest.py"
# Modify tickers and parameters for your own analysis

Learning Checkpoints

1

Understand Cointegration

Can you explain why two assets might be cointegrated and what breaks this relationship?

2

Interpret Statistical Tests

Practice reading ADF test results and understanding when to accept/reject cointegration.

3

Signal Generation

Implement Z-score calculations and understand threshold selection (±1σ vs ±2σ).

4

Risk Management

Understand position sizing, monitoring regime changes, and exit strategies.

Recommended Learning Path

Immediate Actions

  • Download and run the Python script
  • Test with different asset pairs
  • Experiment with threshold parameters

Advanced Studies

  • Learn Johansen cointegration test
  • Study Vector Error Correction Models
  • Explore multiple asset pair trading

Important Disclaimer

This strategy involves significant risk. Historical cointegration relationships can break permanently. Always use proper risk management, position sizing, and never risk more than you can afford to lose. Paper trade extensively before using real capital.

Quick Navigation