Traditional Systematic
Deterministic, rule-based trading. Strategies are derived from observable market phenomena and codified into explicit "if-then" logic.
- Heuristic Logic: Based on trader intuition verified by data.
- Technical Analysis: Heavy reliance on price, volume, and moving averages.
- Fixed Parameters: Lookback periods are often static (e.g., 200-day MA).
Model Quantitative
Probabilistic, math-based trading. Strategies seek to find signal in noise using statistical methods, machine learning, and alternative data.
- Stochastic Nature: Deals in probabilities of future returns, not certainties.
- Data Mining: Finds non-linear relationships humans cannot see.
- Dynamic Adaptation: Models retrain and adapt to regime changes.
Under the Hood: Strategy Construction
How do we actually build these? Let's look at the code structure for both approaches.
1. The Systematic Trend Follower
This approach uses explicit logic. The most famous example is the Turtle Trading methodology. It works well in trending markets but suffers large drawdowns in chop.
Key Characteristics:
- Signal: Price Breakouts (e.g., 20-day high).
- Filter: Moving Average Regime (Trend verification).
- Risk: Fixed fractional position sizing (ATR based).
def systematic_strategy(df):
# Explicit Logic:
# IF price > 20_day_high AND trend is UP
df['20_day_high'] = df['close'].rolling(20).max()
df['50_ma'] = df['close'].rolling(50).mean()
signals = []
for i in range(len(df)):
if (df['close'][i] > df['20_day_high'][i-1] and
df['close'][i] > df['50_ma'][i]):
signals.append("BUY")
elif df['close'][i] < df['20_day_low'][i-1]:
signals.append("SELL")
else:
signals.append("HOLD")
return signals2. The Mean Reversion Model
This approach models the spread between two correlated assets (Pairs Trading). It assumes the spread series is stationary (Ornstein-Uhlenbeck process).
Key Characteristics:
- Signal: Z-Score of the spread residuals.
- Math: Cointegration tests (Engle-Granger).
- Risk: Statistical stop-losses based on standard deviation.
import statsmodels.api as sm
def model_strategy(asset_a, asset_b):
# Statistical Logic:
# Model relationship via OLS Regression
model = sm.OLS(asset_a, sm.add_constant(asset_b)).fit()
hedge_ratio = model.params[1]
# Calculate Spread
spread = asset_a - (hedge_ratio * asset_b)
# Calculate Z-Score (Signal Strength)
z_score = (spread - spread.mean()) / spread.std()
# Probabilistic Entry
if z_score > 2.0:
return "SHORT SPREAD"
if z_score < -2.0:
return "LONG SPREAD"
return "FLAT"The Great Divergence
The Rise of "Quantamental"
The lines are blurring. Modern firms are no longer strictly "Discretionary" or "Quant". The most successful funds today blend human intuition with machine precision.
Feature Engineering
Humans define the "factors" (e.g., Value, Momentum) based on economic theory.
Ensemble Methods
Machines weight these factors dynamically based on current market volatility.
