Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Vectorised Backtester

This backtester was developed during Inter IIT Tech Meet 14.0 to get quick performance estimates for algorithmic strategies.

Unlike the provided tick-by-tick accurate backtester (which turned out to be slow for our statistic-heavy strategy), this implementation focuses on faster evaluation using vectorised computations and day-wise processing.

Backtesting was originally implemented around evaluating strategy-specific behavior and summary metrics. We also added a Plotly-based visual report that plots strategy performance along with primary and secondary features from the provided feature set.

What It Does

  • Runs a fast, estimation-focused intraday backtest.
  • Computes core outputs like PnL, NAV, drawdown, trade counts, returns, and risk metrics.
  • Exports a text summary (backtest_results.txt).
  • Generates an interactive Plotly HTML report (backtest_report.html) with:
    • Price vs portfolio curve
    • Price vs positions/signals
    • Primary and secondary feature overlays
    • Interval-wise bar analysis

How To Use

  1. Prepare a CSV with at least these columns:
    • Time
    • Price
    • Signal
  2. (Optional) Include any feature columns you want plotted (for example SMA_10, EAMA, HAMA_Slope, etc.).
  3. Update the CSV path in backtester.py under the if __name__ == "__main__": block.
  4. Install dependencies:
pip install numpy pandas plotly
  1. Run:
python backtester.py

Generated outputs:

  • backtest_results.txt
  • backtest_report.html
  • processed.csv

About

A python vectorised backtester on generated signals file for an asset

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages