simulation and backtesting of Momentum strategy and Moving Average Crossover strategy for time series data of AAPL
main.py: Main script to run the simulation.data_loader.py: Function to load market_data.csv datastrategies.py: Strategy classes - Momentum strategy and Moving Average Crossover strategymodels.py: Contains data models for orders and market data.engine.py: Portfolio and execution logic.reporting.py: Performance metrics and reporting functions.performance.ipynb: Jupyter notebook for analysis and visualization.
- Load market data: market_data = load_market_data_from_csv('./data/market_data.csv')
- Run the main script:
python main.py
- Use the Jupyter notebook:
Open
performance.ipynbin VS Code or JupyterLab and run the cells.
Joe Wang