├── .gitignore ├── LICENSE ├── README.md ├── data ├── AAPL.csv ├── AGG.csv ├── AMZN.csv ├── GOOG.csv ├── MSFT.csv └── SPY.csv ├── examples ├── __init__.py ├── buy_and_hold_backtest.py ├── monthly_liquidate_rebalance_backtest.py ├── moving_average_cross_backtest.py └── test_examples.py ├── load_statistics.ipynb ├── out └── EMPTY ├── qstrader ├── __init__.py ├── compat.py ├── compliance │ ├── __init__.py │ ├── base.py │ └── example.py ├── event.py ├── exception.py ├── execution_handler │ ├── __init__.py │ ├── base.py │ └── ib_simulated.py ├── order │ ├── __init__.py │ └── suggested.py ├── portfolio.py ├── portfolio_handler.py ├── position.py ├── position_sizer │ ├── __init__.py │ ├── base.py │ ├── fixed.py │ ├── naive.py │ └── rebalance.py ├── price_handler │ ├── __init__.py │ ├── base.py │ ├── generic.py │ ├── historic_csv_tick.py │ ├── ig.py │ ├── iq_feed_intraday_csv_bar.py │ ├── iterator │ │ ├── __init__.py │ │ ├── base.py │ │ └── pandas │ │ │ ├── __init__.py │ │ │ ├── bar.py │ │ │ └── tick.py │ └── yahoo_daily_csv_bar.py ├── price_parser.py ├── profiling.py ├── risk_manager │ ├── __init__.py │ ├── base.py │ └── example.py ├── scripts │ ├── __init__.py │ ├── generate_simulated_prices.py │ └── test_scripts.py ├── sentiment_handler │ ├── __init__.py │ ├── base.py │ └── sentdex_sentiment_handler.py ├── settings.py ├── statistics │ ├── __init__.py │ ├── base.py │ ├── performance.py │ ├── simple.py │ └── tearsheet.py ├── strategy │ ├── __init__.py │ └── base.py ├── trading_session.py └── version.py ├── requirements.txt ├── setup.py └── tests ├── test_portfolio.py ├── test_portfolio_handler.py ├── test_position.py ├── test_price_handler.py ├── test_priceparser.py ├── test_rebalance_position_sizer.py └── test_statistics.py /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/.gitignore -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/README.md -------------------------------------------------------------------------------- /data/AAPL.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/data/AAPL.csv -------------------------------------------------------------------------------- /data/AGG.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/data/AGG.csv -------------------------------------------------------------------------------- /data/AMZN.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/data/AMZN.csv -------------------------------------------------------------------------------- /data/GOOG.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/data/GOOG.csv -------------------------------------------------------------------------------- /data/MSFT.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/data/MSFT.csv -------------------------------------------------------------------------------- /data/SPY.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/data/SPY.csv -------------------------------------------------------------------------------- /examples/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/buy_and_hold_backtest.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/examples/buy_and_hold_backtest.py -------------------------------------------------------------------------------- /examples/monthly_liquidate_rebalance_backtest.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/examples/monthly_liquidate_rebalance_backtest.py -------------------------------------------------------------------------------- /examples/moving_average_cross_backtest.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/examples/moving_average_cross_backtest.py -------------------------------------------------------------------------------- /examples/test_examples.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/examples/test_examples.py -------------------------------------------------------------------------------- /load_statistics.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/load_statistics.ipynb -------------------------------------------------------------------------------- /out/EMPTY: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qstrader/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qstrader/compat.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/compat.py -------------------------------------------------------------------------------- /qstrader/compliance/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qstrader/compliance/base.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/compliance/base.py -------------------------------------------------------------------------------- /qstrader/compliance/example.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/compliance/example.py -------------------------------------------------------------------------------- /qstrader/event.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/event.py -------------------------------------------------------------------------------- /qstrader/exception.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/exception.py -------------------------------------------------------------------------------- /qstrader/execution_handler/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qstrader/execution_handler/base.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/execution_handler/base.py -------------------------------------------------------------------------------- /qstrader/execution_handler/ib_simulated.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/execution_handler/ib_simulated.py -------------------------------------------------------------------------------- /qstrader/order/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qstrader/order/suggested.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/order/suggested.py -------------------------------------------------------------------------------- /qstrader/portfolio.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/portfolio.py -------------------------------------------------------------------------------- /qstrader/portfolio_handler.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/portfolio_handler.py -------------------------------------------------------------------------------- /qstrader/position.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/position.py -------------------------------------------------------------------------------- /qstrader/position_sizer/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qstrader/position_sizer/base.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/position_sizer/base.py -------------------------------------------------------------------------------- /qstrader/position_sizer/fixed.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/position_sizer/fixed.py -------------------------------------------------------------------------------- /qstrader/position_sizer/naive.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/position_sizer/naive.py -------------------------------------------------------------------------------- /qstrader/position_sizer/rebalance.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/position_sizer/rebalance.py -------------------------------------------------------------------------------- /qstrader/price_handler/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/price_handler/__init__.py -------------------------------------------------------------------------------- /qstrader/price_handler/base.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/price_handler/base.py -------------------------------------------------------------------------------- /qstrader/price_handler/generic.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/price_handler/generic.py -------------------------------------------------------------------------------- /qstrader/price_handler/historic_csv_tick.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/price_handler/historic_csv_tick.py -------------------------------------------------------------------------------- /qstrader/price_handler/ig.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/price_handler/ig.py -------------------------------------------------------------------------------- /qstrader/price_handler/iq_feed_intraday_csv_bar.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/price_handler/iq_feed_intraday_csv_bar.py -------------------------------------------------------------------------------- /qstrader/price_handler/iterator/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qstrader/price_handler/iterator/base.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/price_handler/iterator/base.py -------------------------------------------------------------------------------- /qstrader/price_handler/iterator/pandas/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/price_handler/iterator/pandas/__init__.py -------------------------------------------------------------------------------- /qstrader/price_handler/iterator/pandas/bar.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/price_handler/iterator/pandas/bar.py -------------------------------------------------------------------------------- /qstrader/price_handler/iterator/pandas/tick.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/price_handler/iterator/pandas/tick.py -------------------------------------------------------------------------------- /qstrader/price_handler/yahoo_daily_csv_bar.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/price_handler/yahoo_daily_csv_bar.py -------------------------------------------------------------------------------- /qstrader/price_parser.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/price_parser.py -------------------------------------------------------------------------------- /qstrader/profiling.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/profiling.py -------------------------------------------------------------------------------- /qstrader/risk_manager/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qstrader/risk_manager/base.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/risk_manager/base.py -------------------------------------------------------------------------------- /qstrader/risk_manager/example.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/risk_manager/example.py -------------------------------------------------------------------------------- /qstrader/scripts/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qstrader/scripts/generate_simulated_prices.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/scripts/generate_simulated_prices.py -------------------------------------------------------------------------------- /qstrader/scripts/test_scripts.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/scripts/test_scripts.py -------------------------------------------------------------------------------- /qstrader/sentiment_handler/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qstrader/sentiment_handler/base.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/sentiment_handler/base.py -------------------------------------------------------------------------------- /qstrader/sentiment_handler/sentdex_sentiment_handler.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/sentiment_handler/sentdex_sentiment_handler.py -------------------------------------------------------------------------------- /qstrader/settings.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/settings.py -------------------------------------------------------------------------------- /qstrader/statistics/__init__.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | from .base import load 3 | -------------------------------------------------------------------------------- /qstrader/statistics/base.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/statistics/base.py -------------------------------------------------------------------------------- /qstrader/statistics/performance.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/statistics/performance.py -------------------------------------------------------------------------------- /qstrader/statistics/simple.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/statistics/simple.py -------------------------------------------------------------------------------- /qstrader/statistics/tearsheet.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/statistics/tearsheet.py -------------------------------------------------------------------------------- /qstrader/strategy/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qstrader/strategy/base.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/strategy/base.py -------------------------------------------------------------------------------- /qstrader/trading_session.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/trading_session.py -------------------------------------------------------------------------------- /qstrader/version.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/qstrader/version.py -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/requirements.txt -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/setup.py -------------------------------------------------------------------------------- /tests/test_portfolio.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/tests/test_portfolio.py -------------------------------------------------------------------------------- /tests/test_portfolio_handler.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/tests/test_portfolio_handler.py -------------------------------------------------------------------------------- /tests/test_position.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/tests/test_position.py -------------------------------------------------------------------------------- /tests/test_price_handler.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/tests/test_price_handler.py -------------------------------------------------------------------------------- /tests/test_priceparser.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/tests/test_priceparser.py -------------------------------------------------------------------------------- /tests/test_rebalance_position_sizer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/tests/test_rebalance_position_sizer.py -------------------------------------------------------------------------------- /tests/test_statistics.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantstart/qstrader/HEAD/tests/test_statistics.py --------------------------------------------------------------------------------