PROTECTED SOURCE SCRIPT

Hedge Fund Trading System

178
Core Components
1. Factor Model
The heart of HFTS is a four-factor scoring system:

Value Factor: Measures price deviation from fair value (historical mean). Positive scores indicate undervaluation; negative scores indicate overvaluation.
Momentum Factor: Risk-adjusted momentum measuring recent returns relative to volatility. Identifies trending strength.
Carry Factor: Approximates institutional carry trades using price structure analysis (configurable methods).
Macro Regime: Long-term trend regime detection (BULL/BEAR/NEUTRAL) using slope-normalized moving averages.

Each factor is normalized and combined into a Combined Factor Score ranging from -1 (extremely bearish) to +1 (extremely bullish).
2. Trend Filter (EMA Cloud)
Triple EMA system (21/55/200) providing:

Short-term trend direction (Fast vs Slow EMA)
Macro trend context (200 EMA)
Visual cloud for trend state

3. Adaptive Volatility Bands
Dynamic bands that expand/contract based on current volatility regime:

HIGH volatility: Bands expand (wider stops needed)
LOW volatility: Bands contract (tighter entries possible)
NORMAL: Standard deviation

4. Volume Profile & VWAP

Volume Profile: Shows price levels with highest trading activity
POC (Point of Control): Highest volume price level
Value Area (VAH/VAL): 70% of volume concentrated zone
VWAP + Deviation Bands: Institutional execution benchmark

5. Risk Management Panel
Real-time position sizing and risk metrics:

Calculated position size based on account risk %
Stop distance (ATR-based)
Drawdown tracking with kill switch
Directional bias status


Z-Score Trading Strategy
The Z-Score is your mean reversion radar. It measures how many standard deviations price is from its 20-period mean.
Z-Score Levels:
Z-ScoreConditionMeaning> +2.5Extreme Overbought🔶 Diamond marker appears - potential short setup> +2.0OverboughtPrice extended above mean-2.0 to +2.0Normal RangeNo extreme conditions< -2.0OversoldPrice extended below mean< -2.5Extreme Oversold🔷 Diamond marker appears - potential long setup
How to Trade Z-Score Signals:
Mean Reversion Longs (Z < -2.0):

Wait for Z-Score to drop below -2.0 (oversold)
Look for diamond marker at extreme (-2.5)
Confirm Macro Regime is NOT "BEAR"
Enter when Z-Score starts turning UP (reversal confirmation)
Target: VWAP or Vol Band Basis (mean)
Stop: Below recent swing low or Vol Band Lower

Mean Reversion Shorts (Z > +2.0):

Wait for Z-Score to rise above +2.0 (overbought)
Look for diamond marker at extreme (+2.5)
Confirm Macro Regime is NOT "BULL"
Enter when Z-Score starts turning DOWN
Target: VWAP or Vol Band Basis
Stop: Above recent swing high or Vol Band Upper

Z-Score + Factor Confluence:
The best mean reversion trades occur when:

Z-Score hits extreme AND
Value Factor confirms (undervalued for longs, overvalued for shorts) AND
Price is at/beyond Volatility Band AND
Volume spike confirms institutional participation


Signal Types
Trend Signals (Green/Red Triangles)
Long Setup:

Trend UP (Fast EMA > Slow EMA)
Pullback to support (between Vol Band Lower and Basis)
Price crosses back above Fast EMA
Factor Score > 0
Above VWAP (if confirmation enabled)

Short Setup:

Trend DOWN (Fast EMA < Slow EMA)
Rally to resistance (between Vol Band Upper and Basis)
Price crosses below Fast EMA
Factor Score < 0
Below VWAP (if confirmation enabled)

Mean Reversion Signals
Automatically generated when Z-Score conditions + regime filters align.

Recommended Settings by Asset
AssetTick ValueTick SizeNotesNQ (Nasdaq Futures)5.000.25High volatility, widen bandsES (S&P Futures)12.500.25Standard settings work wellStocks0.010.01Default settingsCrypto0.010.01Consider higher ATR multiplier

Pro Tips

Factor Alignment: Only take signals when Combined Factor Score matches your trade direction
Volatility Regime: Reduce size in HIGH volatility; increase in LOW volatility
VWAP as Magnet: Price tends to revert to VWAP - use for targets
POC Support/Resistance: Volume Profile POC acts as strong S/R
Drawdown Kill Switch: If Risk State shows "STOPPED" - step away and reassess
Z-Score Extremes: The best mean reversion trades come from -2.5/+2.5 levels, not -2.0/+2.0


Alerts Available

Long/Short Signal triggers
Extreme Overbought/Oversold conditions
VWAP crosses
Drawdown limit breach

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.