Skip to content
In academic affiliation with Carnegie Mellon University
Institute of Algorithmic Tradingand Applied Computational Finance

Practitioner course in programming

Python for Algorithmic Trading

How research code becomes a trading system: an event-driven engine, a broker connection, order and position state, risk checks, logging, and a strategy that runs on a schedule without you watching it.

Python for algorithmic trading is mostly not about clever signals. A strategy that looks good in a notebook still has to receive data, place orders, survive a dropped connection, and agree with the broker about what it owns. This course is about that part.

What is the difference between a backtest and a trading system?

A backtest reads history and assumes every order fills. A trading system reads data that arrives late or not at all, sends orders that may be partly filled or rejected, and must recover after a crash without doubling a position. The course builds one engine that runs in both modes, so the strategy you test is the strategy you run.

Why is the assessment two weeks of paper trading?

Because the faults that matter only appear over time: a weekend data gap, an exchange holiday, a rate limit, a fill that arrives after a restart. Two weeks of logs show whether your system notices and contains them. The report on what went wrong is marked as heavily as the code.

Who is this course for?

Traders and analysts with working Python who want to automate a strategy, and developers moving into trading. It counts toward the Certificate in Algorithmic Trading and the Professional Diploma in Algorithmic Trading.

What you will be able to do

  • Structure trading code as data, signal, portfolio, risk and execution components.
  • Write an event-driven backtest that uses the same strategy code as live trading.
  • Connect to a broker API in paper mode and manage orders, fills and positions.
  • Add pre-trade risk checks, logging and alerts to a running strategy.
  • Schedule and monitor a strategy so that a failure is noticed and contained.

Syllabus, module by module

  1. From notebook to system

    Why research notebooks fail in production, and the component layout used for the rest of the course.

  2. Events and the main loop

    Bars, ticks and timers as events; a queue-driven engine that runs the same in test and live.

  3. Market data handling

    Streaming and polled data, bar construction, gaps and stale data detection.

  4. Orders and state

    Order types, partial fills, cancels, rejections and keeping positions consistent with the broker.

  5. Broker APIs

    REST and streaming interfaces, authentication, rate limits and reconnection, in paper mode.

  6. Risk checks

    Position limits, order size limits, loss limits and a kill switch that works.

  7. Logging, alerting and scheduling

    Structured logs, alerts on failure, cron and service managers, and restart behaviour.

  8. Testing trading code

    Unit tests for signals, replay tests on recorded data, and reconciliation against broker statements.

  9. Project lab

    Supervised work on the assessed paper-trading system.

How the certificate is earned

An assessed project: you build a small event-driven system that runs one strategy in paper trading for at least two weeks, and submit the code, its logs and a short report on what went wrong and how you handled it. On a pass you receive the Course certificate in Python for Algorithmic Trading, issued by the Institute with a verification code. Read how certification works.

Before you start

Working Python with pandas, and the basic vocabulary of orders and strategies.

This course counts toward

Questions applicants ask

Can I build a trading bot in Python?

Yes, and this course builds one in paper mode. Most of the work is not the signal but the handling of orders, failures and state, which is what the course concentrates on.

Which broker does the course use?

Exercises use a broker that offers a free paper-trading API. The design is broker-neutral, and the course shows where a different broker would plug in.

Does the course trade real money?

No. All work runs in paper trading. Moving to real money is your decision, and the course covers the checks to make first.

$790 32 hours