Skip to content

Latest commit

 

History

History
386 lines (235 loc) · 9 KB

File metadata and controls

386 lines (235 loc) · 9 KB

Academic Foundation - Theoretical Underpinnings


Introduction

This document explains the academic theories, mathematical frameworks, and financial principles underlying our trading strategies.


Core Financial Theories

1. Efficient Market Hypothesis (EMH) & Its Violations

Theory: Markets are informationally efficient; prices reflect all available information.

Our Exploitation: Markets exhibit weak-form inefficiencies at intraday timeframes due to:

  • Behavioral biases (overreaction, momentum)
  • Market microstructure effects (order flow, liquidity shocks)
  • Mean reversion after temporary price dislocations

Evidence in Our Data:

  • SUNPHARMA showed 73% win rate on mean reversion trades (RSI < 30)
  • If EMH held perfectly, win rate would be ~50%
  • This suggests exploitable short-term inefficiencies

2. Mean Reversion Theory

Mathematical Foundation:

Ornstein-Uhlenbeck Process: $$dX_t = \theta(\mu - X_t)dt + \sigma dW_t$$

Where:

  • $\theta$: Speed of mean reversion
  • $\mu$: Long-term mean
  • $\sigma$: Volatility
  • $W_t$: Wiener process

Application: Our RSI strategies exploit this - when prices deviate from mean (RSI < 30), they tend to revert.

Half-Life Calculation: $$t_{1/2} = \frac{\ln(2)}{\theta}$$

For SUNPHARMA: $\theta \approx 0.18$$t_{1/2} \approx 3.85$ hours

This informs our max hold time of 11 hours (~3× half-life).

3. Regime-Switching Models

Markov Switching Model (Hamilton, 1989):

$$P(S_t = j | S_{t-1} = i) = p_{ij}$$

Where $S_t$ is market regime at time $t$.

Our Implementation (VBL):

Three regimes based on volatility:

  • $S_1$: Low Vol ($\sigma &lt; 18%$) - Mean reversion
  • $S_2$: Medium Vol ($18% \leq \sigma &lt; 35%$) - Hybrid
  • $S_3$: High Vol ($\sigma \geq 35%$) - Breakout

Transition probabilities estimated from historical data.

4. Technical Analysis Foundations

RSI (Relative Strength Index):

$$RSI = 100 - \frac{100}{1 + RS}$$

where $RS = \frac{\text{Average Gain}}{\text{Average Loss}}$

Why It Works:

  • Captures momentum exhaustion
  • Bounded indicator (0-100) provides clear thresholds
  • Fast RSI(2) captures short-term overextensions

Our Innovation - RSI Boosting:

$$RSI_{boosted}(t) = RSI(t) + \beta$$

where $\beta \in [3,4]$ optimally.

This effectively lowers entry threshold from 30 to 26-27, capturing mean reversion earlier.


Statistical Foundations

1. Sharpe Ratio

Definition: $$SR = \frac{E[R_p - R_f]}{\sigma_p} \sqrt{T}$$

Where:

  • $R_p$: Portfolio return
  • $R_f$: Risk-free rate
  • $\sigma_p$: Standard deviation of excess returns
  • $T$: Periods per year (252 for daily)

Why Sharpe?

  • Risk-adjusted return metric
  • Accounts for volatility (not just raw returns)
  • Comparable across different strategies/assets

Our Results:

  • Portfolio Sharpe: 2.276 (excellent - industry standard is > 1.0)
  • Best strategy (SUNPHARMA): 4.292 (exceptional)

2. Bayesian Optimization (Optuna)

Tree-structured Parzen Estimator (TPE):

Models parameter space as mixture of distributions:

$$p(\theta | y &lt; y^_) = l(\theta)$$<br> $$p(\theta | y \geq y^_) = g(\theta)$$

Where $y$ is objective function (Sharpe), $y^*$ is threshold.

Acquisition Function:

$$\alpha(\theta) = \frac{l(\theta)}{g(\theta)}$$

Next trial samples $\theta$ maximizing $\alpha$.

Advantage: Converges 5-10× faster than grid search by learning from previous trials.

3. Walk-Forward Validation

Framework:

  1. Split data: Training (60%), Validation (20%), Test (20%)
  2. Optimize on Training
  3. Verify on Validation
  4. Final test on Test

Combating Over-fitting:

$$\text{Robustness Score} = 1 - \frac{|SR_{train} - SR_{test}|}{SR_{train}}$$

Our score: $1 - \frac{|2.68 - 2.46|}{2.68} = 0.918$ (91.8% robustness - excellent)

4. Bootstrap Confidence Intervals

Method:

  1. Resample trades with replacement (10,000 iterations)
  2. Calculate Sharpe for each sample
  3. Construct 95% CI

Results:

  • Mean Sharpe: 2.563
  • 95% CI: [2.378, 2.741]
  • P-value: < 0.001 (highly significant)

Interpretation: Our Sharpe is statistically significant, not due to luck.


Risk Management Theory

1. Kelly Criterion

Optimal Position Sizing:

$$f^* = \frac{p(b+1) - 1}{b}$$

Where:

  • $p$: Win probability
  • $b$: Win/loss ratio

For SUNPHARMA:

  • $p = 0.73$ (73% win rate)
  • $b = 0.44/0.58 = 0.76$ (avg win/loss)
  • $f^* = \frac{0.73(1.76) - 1}{0.76} = 0.38$ (38% of capital)

Our Implementation: We use fractional Kelly (50% of optimal) for safety:

$$f_{actual} = 0.5 \times f^* \approx 0.19$$ (19% per trade)

This provides buffer against estimation errors while capturing growth.

2. Value at Risk (VaR)

95% VaR (Daily):

$$VaR_{95} = \mu - 1.65\sigma$$

Portfolio VaR:

  • Mean daily return: $\mu = 0.12%$
  • Std dev: $\sigma = 1.8%$
  • $VaR_{95} = 0.12 - 1.65(1.8) = -2.85%$

Interpretation: 95% probability daily loss won't exceed 2.85% of capital.

3. Maximum Drawdown Theory

Expected Max Drawdown (Brownian Motion):

$$E[MDD] \approx 0.63\sigma\sqrt{T}$$

Our Results:

  • Theoretical MDD: $0.63 \times 0.018 \times \sqrt{252} = 18.0%$
  • Actual MDD: 8.2%
  • Conclusion: Our strategies exhibit better drawdown control than random walk

Optimization Theory

1. Bias-Variance Tradeoff

Model Complexity:

Total Error = Bias² + Variance + Irreducible Error

Our Approach:

  • Simple strategies (low variance, slight bias)
  • Over complex ML (low bias, high variance - avoided)

Optimal Complexity: 8-12 parameters per strategy

2. Cross-Validation

K-Fold Walk-Forward:

For time-series, standard k-fold invalid (look-ahead bias).

Our Method:

Fold 1: Train [0:60%], Test [60%:70%]
Fold 2: Train [0:70%], Test [70%:80%]  
Fold 3: Train [0:80%], Test [80%:90%]
Fold 4: Train [0:90%], Test [90%:100%]

Average test performance: 2.41 Sharpe (minimal decay ✅)


Market Microstructure

1. Bid-Ask Spread

Effective Spread:

$$ES = 2|P - M|$$

Where $P$ is execution price, $M$ is midpoint.

Typical Spreads (India):

  • NIFTY50: 0.05%
  • Large caps (RELIANCE): 0.08%
  • Mid caps (SUNPHARMA): 0.12%
  • Small caps (VBL): 0.25%

Our Cost Model: Accounts for full spread crossing on each trade.

2. Market Impact

Square-Root Law (Almgren et al.):

$$MI = \sigma \cdot \gamma \cdot \sqrt{\frac{Q}{V}}$$

Where:

  • $\sigma$: Daily volatility
  • $\gamma$: Impact coefficient (~0.1 for Indian equities)
  • $Q$: Order size
  • $V$: Daily volume

Our Impact: < 2 bps for all symbols (negligible at ₹1L scale)


Behavioral Finance

1. Overreaction Hypothesis

De Bondt & Thaler (1985):

Markets overreact to news → Mean reversion opportunities

Our Exploitation:

  • RSI < 30 indicates overreaction to negative news
  • Mean reversion captures bounce-back
  • Win rate 67-73% validates theory

2. Anchoring Bias

Traders anchor to recent prices → Under-reaction to new information

Our Edge: Fast RSI(2) captures moves before market fully adjusts


Probability & Statistics

1. Law of Large Numbers

$$\lim_{n \to \infty} \frac{1}{n}\sum_{i=1}^n X_i = E[X]$$

Application: With 757 trades, our observed Sharpe converges to true Sharpe.

Standard Error:

$$SE = \frac{\sigma}{\sqrt{n}} = \frac{1.8}{\sqrt{757}} = 0.065$$

95% CI: $2.276 \pm 1.96(0.065) = [2.15, 2.40]$

2. Central Limit Theorem

For large $n$, sample mean is approximately normal:

$$\bar{X} \sim N(\mu, \frac{\sigma^2}{n})$$

Application: Enables statistical testing (t-tests, confidence intervals)


Information Theory

1. Shannon Entropy

Portfolio Diversification:

$$H = -\sum_{i=1}^n p_i \log_2(p_i)$$

Our Portfolio:

  • 5 symbols with allocations [0.25, 0.30, 0.22, 0.13, 0.10]
  • $H = 2.21$ bits (good diversification)
  • Maximum $H_{max} = \log_2(5) = 2.32$ (equal weight)

2. Information Ratio

$$IR = \frac{E[R_p - R_b]}{\sigma(R_p - R_b)}$$

vs. NIFTY50 Benchmark:

  • Excess return: 14.3% annually
  • Tracking error: 8.1%
  • IR = 1.77 (excellent - > 0.5 is good)

Time Series Analysis

1. Autocorrelation Function (ACF)

Returns Autocorrelation:

$$\rho_k = \frac{Cov(r_t, r_{t-k})}{Var(r_t)}$$

Our Finding:

  • Lag-1 autocorrelation: -0.08 (slight mean reversion)
  • Lag-2: -0.05
  • Supports short-term mean reversion strategies

2. GARCH Models (Not Used, But Considered)

GARCH(1,1):

$$\sigma_t^2 = \omega + \alpha\epsilon_{t-1}^2 + \beta\sigma_{t-1}^2$$

Why Not Used:

  • Too complex for intraday strategies
  • Simple rolling volatility worked better (Occam's Razor)

Conclusion

Our strategies rest on solid academic foundations:

Finance Theory: Mean reversion, regime switching
Statistics: Bayesian optimization, walk-forward validation
Risk Management: Kelly criterion, VaR, drawdown control
Behavioral Finance: Overreaction exploitation
Market Microstructure: Transaction cost modeling

Key Insight: Simple strategies grounded in theory, rigorously tested, outperform complex black-box approaches.


Document Version: 1.0
Last Updated: January 19, 2026