Learn algorithmic trading with Python
Built for traders new to Python. Start from zero - variables, NumPy, Pandas - and finish with backtested, optimised strategies and a live trading bot. Every example is real, runnable code, powered by the OpenAlgo Python SDK.
Foundations
Set up, talk to the market, and learn just enough Python, NumPy and Pandas.
Getting Started with OpenAlgo
Connect the OpenAlgo Python SDK, check funds, and understand analyze vs live mode.
Python Essentials for Traders
The Python you actually need - variables, lists, dicts, loops and functions, in a trading context.
Symbols, Exchanges & Lot Sizes
Master the OpenAlgo symbol format across NSE equity, NFO F&O and MCX commodities.
Quotes, Depth & LTP
Pull live snapshots - single quotes, batched multiquotes and full order-book depth.
Historical Data & Timeframes
Fetch OHLCV history at any interval and reshape it for analysis.
NumPy for Traders
NumPy fundamentals for traders - creating arrays, indexing, vectorised math and the everyday functions, on simple price data.
Pandas for Traders
DataFrames, rolling windows, resampling and group-bys - the workhorse of market analysis.
Visualisation & Apps
Turn data into charts and interactive dashboards.
Charting with Matplotlib
Static charts: price lines, return distributions, subplots and indicator overlays.
Interactive Charts with Plotly
Zoomable candlestick charts with volume and multi-pane indicators.
Live Dashboards with Streamlit
Build clickable web apps - a quote board, a chart viewer and a mini scanner.
Technical Indicators
Eighty-plus indicators from the openalgo.ta library, by category.
Trend & Moving Averages
From SMA and EMA to Supertrend, Ichimoku and Parabolic SAR.
Momentum Indicators
Measure speed and strength: RSI, MACD, Stochastic, CCI and more.
Volatility Indicators
ATR, Bollinger Bands, Keltner and Donchian channels for range and risk.
Volume Indicators
Read participation with OBV, VWAP, MFI, CMF and relative volume.
Oscillators
Bounded momentum tools: ROC, TRIX, Awesome Oscillator, StochRSI, Vortex and friends.
Statistical, Hybrid & Utility Functions
Regression, correlation, ADX, pivots - plus the signal helpers you'll use everywhere.
Signals & Scanning
Convert indicators into clean signals and screen the whole market.
Strategy Playbook
Real strategy styles - each one fetched, signalled and explained.
Cash & Equity Strategies
Delivery-style trend following and momentum ranking on equities.
Intraday Strategies
Opening-range breakout, VWAP reversion and intraday EMA systems.
Pair Trading & Statistical Arbitrage
Trade the spread: ratio, z-score, correlation and beta-neutral pairs.
Momentum & Volatility Trading
Cross-sectional momentum plus ATR / Bollinger volatility-driven entries and sizing.
Seasonal & Calendar Strategies
Day-of-week, month and expiry-week effects measured straight from history.
Options Strategies
From the option chain to buying, spreads, straddles and hedging - all by symbol.
Execution
Place and manage real orders through the SDK (in analyze mode).
Backtesting & Optimisation
Prove an edge before risking capital - with VectorBT.
Backtesting from Scratch & with VectorBT
Build a vectorised backtest by hand, then reproduce it with VectorBT and realistic costs.
Performance Metrics & Reporting
Sharpe, Sortino, CAGR, drawdown and win-rate - plus a full QuantStats report.
Parameter Optimisation
Sweep parameter grids, draw heatmaps and pick robust settings - not just the best.
Walk-Forward Testing & Robustness
Split in- and out-of-sample, roll the window forward, and avoid fooling yourself.
Machine Learning
Teach a model to read the market, then ship a complete bot.
Going Live
Stream live ticks over WebSockets and manage real positions in real time.
Real-Time Data with WebSockets
Stream live ticks over a WebSocket and manage a position in real time - computing stop-loss, target and trailing stop as each price arrives.
Risk & Position Sizing
Turn a signal into the right quantity - sizing by fixed-fractional risk, the stop distance, ATR and portfolio heat, with a reusable lot-aware sizer.
For education only - not investment advice. Practise in analyze mode. 32 chapters built on the OpenAlgo Python SDK.