Skip to main content
home

Example project · Python · Algorithmic · Research

Strategy Backtester

A vectorised back-test of a 20/50 EMA crossover rule across several years of data for a sub-portfolio of Nifty 50 stocks, with a full performance report.

In the course curriculum

Project facts

Difficulty
Intermediate
Technology
Python, Pandas
Category
Python, Algorithmic, Research
Status
In the course curriculum

Project summary

A vectorised back-test of a 20/50 EMA crossover rule across several years of data for a sub-portfolio of Nifty 50 stocks, with a full performance report.

Problem
An idea is only a hypothesis until it is tested against historical data.
Approach
Encode a moving-average crossover rule, simulate it over historical data and record every assumption.

Skills developed

  • Back-testing
  • Pandas
  • Strategy design

Technology

  • Python
  • Pandas

Prerequisites

  • Pandas DataFrames and indexing
  • Moving averages (Modules 2–3 of the Python course)
  • Historical daily data for several stocks

Deliverable

A documented back-test with equity curve, drawdown chart and trade list.

Project workflow

  1. Stage 1: Write the rules

    State the 20/50 EMA crossover entry and exit rules unambiguously.

  2. Stage 2: Vectorise the signals

    Compute the averages and the position series without look-ahead bias.

  3. Stage 3: Simulate with costs

    Apply the positions to returns and deduct assumed costs and slippage.

  4. Stage 4: Evaluate

    Produce the equity curve, drawdown chart and trade list, and compare with buy-and-hold.

  5. Stage 5: Record assumptions

    Document every assumption and what the test cannot show.

AlphaSync practice

AlphaSync is a simulated practice environment for education. Simulated and paper-trading environments do not reproduce all the characteristics of live markets, such as execution, liquidity, costs and emotional pressure. Simulated results do not represent actual trading and do not predict future results. Screens show illustrative data.

Related articles

Build this project in a course

Projects are completed inside Academy courses, with instructor feedback. Enquire about the course that includes this project.