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.
- 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
- Prepare a CSV with at least these columns:
TimePriceSignal
- (Optional) Include any feature columns you want plotted (for example
SMA_10,EAMA,HAMA_Slope, etc.). - Update the CSV path in
backtester.pyunder theif __name__ == "__main__":block. - Install dependencies:
pip install numpy pandas plotly- Run:
python backtester.pyGenerated outputs:
backtest_results.txtbacktest_report.htmlprocessed.csv