Skip to content

Milad-Aman/Backtest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SMA Backtesting

A Python-based backtesting framework that uses SMA crossovers with an arbitrary number of SMA indicators of the user's choice

Strategy

  • Only go long if all faster SMA indicators (with shorter lookback windows) are strictly higher in value than all slower SMAs (with larger lookback windows)
  • Only go short if all faster SMAs are strictly lower than all slower SMAs
  • Otherwise take a hold position

Summary of what this repository achieves

  • Real market data downloaded from Yahoo Finance of the ticker and timeframe of the user's choice
  • Building SMA indicators with the SMA windows of the user's choice
  • Trading strategy logic
  • Evaluation using performance metrics like profit factor, Sharpe ratio, etc.
  • Plotting of strategy returns against benchmark returns

Exemplar Results

Results

Quickstart

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python main.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages