Backtesting program
python backtest.py -s golden_cross > logs/golden_cross.log
python backtest.py -s buy_hold > logs/buy_hold.log
python backtest.py -s buy_dip > logs/buy_dip.log
python backtest.py -s ichimoku > logs/ichimoku.log
python backtest.py -s bbands > logs/bbands.log
python backtest.py -s mean_reversion > logs/mean_reversion.log
# Gap Up/Down check below
# Full command
python backtest.py --strategy gap --symbol ^NSEI --report --analysis
NSE Gap Up Down Strategy
python backtest.py -s gap --symbol ^NSEI --cheat-on-open -i 1m
optional arguments:
-h, --help show this help message and exit
--fromyear FROMYEAR, -f FROMYEAR
Starting date in YYYY format
--toyear TOYEAR, -t TOYEAR
Starting date in YYYY format
--analysis, -a Print nice analysis summary
--writercsv, -wcsv Tell the writer to produce a csv stream
--report, -r Produce a yaml report
--cash CASH Starting Cash
--comm COMM Commission for operation
--plot, -p Plot the read data
--transactions, -tx All transactions
-sym SYMBOLS [SYMBOLS ...], --symbols SYMBOLS [SYMBOLS ...]
<Required> Set flag
-s STRATEGY, --strategy STRATEGY
which strategy to run
Everything goes into data_yahoo
dir.
# a single symbol, defaults
# Saves daily and monthly by default
python api-yahoo.py -s AAPL -i 1d
# multiple symbols
python api-yahoo.py -s AAPL TSLA
# Change the interval to 1m
# Many a times only last 7-8 days data is available. So need to run cron jobs regularly
python api-yahoo.py -s AAPL ^NSEI -i 1m
- https://github.com/purdyben/quantitative-trading-backtesting-environment
- https://github.com/edlgg/backtesters
- https://github.com/algothinktank/backtester/blob/master/Back_tester.py
- https://github.com/Arnios/Mister-Market
- https://github.com/edlgg/backtesters
- https://github.com/GitHub-Valie/python-algorithms
- https://github.com/eugenewyj/trader_eugene/blob/main/quick_start_guide.py
- https://github.com/cole-seph-fi/backtesting
- https://github.com/jatin107/PredictOptionPrices
- https://github.com/SeriousSeal/megalodong/tree/main/Backtrader
- https://github.com/DutchCryptoDad?tab=repositories
bt - Flexible Backtesting for Python — bt 0.2.9 documentation: Taking quant to the next level after backtrader