Financial Trading in Python
Build technical trading strategies in Python, backtest them with bt on real stock data, and judge the results with drawdowns and risk-adjusted ratios.
Financial Trading in Python is about writing trading ideas as code that can be tested against past market data. You look at why people trade and how technical trading differs from value investing. Then you compute moving averages, RSI and Bollinger Bands, use them as signals for trend-following and mean-reversion strategies, and backtest those strategies on real stock data. Each result is judged with risk-adjusted measures.
What You Will Achieve
- Chart and resample price data in Python to see how an asset has traded over time
- Calculate measures such as the ADX and RSI and read what they imply about trend strength and momentum
- Turn indicator signals into a trend-following or mean-reversion strategy and backtest it with the bt package
- Judge whether a backtested strategy pays for its risk by reading its drawdowns and risk-adjusted ratios
Program Overview
Trading Basics and Market Data in Python
Why people trade, how technical trading compares with value investing, and first steps exploring trading data and running a simple backtest.
- Technical trading and value investing
- Candlestick charts, resampling and return histograms
- Simple moving averages
- A first strategy backtested with bt
Technical Indicators for Trend, Strength, Momentum and Volatility
The main indicator groups, calculated, plotted and interpreted in Python as the raw material for trading signals.
- Simple and exponential moving averages
- ADX for trend strength
- RSI for momentum
- Bollinger Bands for volatility
Trading Strategies and Performance Evaluation
Signals become strategies tested on real stock data, then the backtest statistics are reviewed on a risk-adjusted basis.
- SMA, EMA crossover and RSI signals
- Trend-following and mean-reversion backtests
- Strategy optimization and benchmarking
- Returns, drawdowns and the Calmar, Sharpe and Sortino ratios
Certificate Awarded (Paid)
Job Outlook
Coding and backtesting trading strategies is part of trading and investment work done in Python, where stock, foreign exchange and cryptocurrency data are analyzed with technical indicators.
Good for: Python users who want to code technical trading ideas, such as moving average crossovers and RSI signals, and backtest them on historical market data.
Keep in mind: It centers on technical trading built and tested with the bt package, so every strategy is judged on historical backtests run in code.
Bottom line: A tightly sequenced path through indicators, signals, backtests and risk-adjusted ratios, with every strategy coded and tested in bt.
Frequently Asked Questions
Which Python package runs the backtests?
The backtests use the bt package, introduced in the first chapter along with its process for defining a strategy, running it and reviewing the result. Later chapters use it again for trend-following and mean-reversion strategies, optimization and benchmarking.
Which markets does the trading data come from?
The exercises draw on real-world financial data from stocks, foreign exchange markets and cryptocurrencies. The strategy chapter builds and backtests its trend-following and mean-reversion strategies on real stock data.
Which charts do the exercises produce?
The opening chapter covers time series line charts, candlestick charts and return histograms. Later lessons plot moving averages, the ADX, the RSI and Bollinger Bands, and backtest returns are plotted as histograms so several strategies can be compared.
User Reviews
Write your review
You must be logged in to post a review.
Reviews can only be posted by registered learners. Log in or create a free account, then you will return here to post.


There are no reviews yet.