Python
correlation risk - portfolio diversification check
·872 words
running 3 strategies across different asset classes.
but are they actually diversified? checking portfolio correlation to find out.
current strategy allocation # mean reversion:
momentum breakout strategy - how it works
·817 words
momentum strategy has 5 wins, 0 losses.
time to explain how it works.
core concept # capture trending moves after consolidation breaks.
refactored data pipeline to async - 3x faster market data processing
·907 words
been running synchronous data fetching since january.
works but slow during market open.
refactored to async this week.
3x speed improvement.
the problem with sync code # # Old synchronous approach def fetch_market_data(symbols): results = [] for symbol in symbols: data = fetch_from_api(symbol) # Blocks here results.append(data) return results # With 10 symbols, takes 10 * 180ms = 1,800ms total each API call blocks until complete.
added redis caching - cut market data latency by 60%
·910 words
been noticing market data latency creeping up.
average fetch time: 180ms from polygon API.
slowing down entry execution.
the problem # every time algo needs current price:
rebuilt backtesting pipeline - 10x faster parameter optimization
·881 words
spent last 3 days rebuilding backtest optimization pipeline.
went from 6 hours to 35 minutes for full parameter sweep.
the problem # old approach: sequential parameter testing.
building volatility regime detection
·797 words
need to stop trading when volatility spikes. building detection system.
the problem # this week VIX spiked 18% in 2 days. my strategies got stopped out twice.
using python async for real-time market data
·1056 words
rewrote my market data pipeline to use async. 3x faster, way cleaner code.
the problem # old synchronous code:
checking my backtests for overfitting
·1019 words
worried my strategies are overfit to historical data. spent today testing for it. been reading NexusFi backtesting threads about this exact problem.
the problem # my backtests look great:
how i organize my trading code on github
·988 words
got asked on r/algotrading how i organize my trading repos. here’s my setup after 4 months of refactoring.
repo structure # i have 4 main repos: