{"id":13449673,"url":"https://github.com/letianzj/quanttrader","last_synced_at":"2025-11-12T03:30:16.279Z","repository":{"id":40523170,"uuid":"283028042","full_name":"letianzj/quanttrader","owner":"letianzj","description":"Backtest and live trading in Python","archived":false,"fork":false,"pushed_at":"2024-06-20T13:57:28.000Z","size":6704,"stargazers_count":558,"open_issues_count":0,"forks_count":118,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-01-30T14:07:39.464Z","etag":null,"topics":["algo-trading","algorithmic-trading","algotrading","backtesting-trading-strategies","backtests","interval-strategy","quant-trader","quant-trading","quantitative-trading","stock","trading-algorithms","trading-platform","trading-strategies","trading-systems"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/letianzj.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-27T22:08:29.000Z","updated_at":"2025-01-27T21:35:28.000Z","dependencies_parsed_at":"2024-01-13T17:18:12.510Z","dependency_job_id":"32427723-d77f-4d84-9061-c273f6b20222","html_url":"https://github.com/letianzj/quanttrader","commit_stats":{"total_commits":113,"total_committers":4,"mean_commits":28.25,"dds":0.04424778761061943,"last_synced_commit":"e5c407f76c9d0beeccaa8735052a7e7717f0bed6"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letianzj%2Fquanttrader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letianzj%2Fquanttrader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letianzj%2Fquanttrader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letianzj%2Fquanttrader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/letianzj","download_url":"https://codeload.github.com/letianzj/quanttrader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239599078,"owners_count":19665911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algo-trading","algorithmic-trading","algotrading","backtesting-trading-strategies","backtests","interval-strategy","quant-trader","quant-trading","quantitative-trading","stock","trading-algorithms","trading-platform","trading-strategies","trading-systems"],"created_at":"2024-07-31T06:00:51.068Z","updated_at":"2025-11-12T03:30:16.244Z","avatar_url":"https://github.com/letianzj.png","language":"HTML","readme":"# quanttrader\n[![pypi](https://img.shields.io/pypi/v/nseazy.svg)](https://pypi.python.org/pypi/quanttrader)\n[![python](https://img.shields.io/pypi/pyversions/nseazy.svg)](https://pypi.python.org/pypi/quanttrader)\n[![License Apache 2.0](https://badgen.net/badge/license/apache2.0/blue)](https://opensource.org/licenses/MIT)\n\nWelcome to quanttrader, a pure python-based event-driven backtest and live trading package for quant traders.\n\nThe source code is completely open-sourced [here on GitHub](https://github.com/letianzj/quanttrader). The package is published [here on pypi](https://pypi.org/project/quanttrader/) and is ready to be pip installed. The document is hosted [here on readthedocs](https://quanttrader.readthedocs.io/).\n\nIn most cases, a backtest strategy can be directly used for live trade by simply switching to live brokerage. A control window is provided to monitor live trading sessions for each strategy separately and the portfolio as a whole.\n\n### Backtest\n\n[Backtest code structure](https://letianzj.github.io/quanttrading-backtest.html)\n\n[Backtests examples](https://github.com/letianzj/QuantResearch/tree/master/backtest)\n\n[Reinforcement trader](https://github.com/letianzj/QuantResearch/blob/master/ml/reinforcement_trader.ipynb)\n\n### Live trading\n\n[Live Trading demo video](https://youtu.be/CrsrTxqiXNY)\n\n[Live Trading code structure](https://letianzj.github.io/live-trading-ib-native-python.html)\n\n__Prerequisite__: download and install IB TWS or IB Gateway; enable API connection as described [here](https://interactivebrokers.github.io/tws-api/initial_setup.html).\n\n__Installation__\n\nStep 1\n\n```shell\npip install quanttrader\n```\n\nAlternatively, download or git the source code and include unzipped path in PYTHONPATH environment variable.\n\nstep 2\n\nDownload [live_engine.py](https://github.com/letianzj/quanttrader/blob/master/examples/live_engine.py), [config_live.yaml](https://github.com/letianzj/quanttrader/blob/master/examples/config_live.yaml), [order_per_interval_strategy.py](order_per_interval_strategy.py) by clicking Raw button, right clicking save as, and then change the file extension to .py or .yaml.\n\nstep 3\n```shell\ncd where_the_files_are_saved\npython live_engine.py\n```\n\n__Instruments Supported and Example__\n\n* __Stock__: AMZN STK SMART\n* __Foreign Exchange__: EURGBP CASH IDEALPRO\n* __Futures__: ESM9 FUT GLOBEX\n* __Options on Stock__: AAPL OPT 20201016 128.75 C SMART\n* __Options on Futures__: ES FOP 20200911 3450 C 50 GLOBEX\n* __Comdty__: XAUUSD CMDTY SMART\n\n__Order Type Supported__\n\nBasic order types. See [IB Doc](http://interactivebrokers.github.io/tws-api/basic_orders.html) for details.\n* Auction\n* Auction Limit\n* Market\n* Market If Touched\n* Market On Close\n* Market On Open\n* Market to Limit\n* Limit Order\n* Limit if Touched\n* Limit on Close\n* Limit on Open\n* Stop\n* Stop Limit\n* Trailing Stop\n* Trailing Stop Limit\n\n\n![gui](https://github.com/letianzj/quanttrader/blob/master/examples/gui.png)\n\n\n**DISCLAIMER**\nOpen source, free to use, free to contribute, use at own risk. No promise of future profits nor responsibility of future loses.\n","funding_links":[],"categories":["Backtesting and Live Trading","Backtest + live trading"],"sub_categories":["General - Event Driven Frameworks","General purpose"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletianzj%2Fquanttrader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fletianzj%2Fquanttrader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletianzj%2Fquanttrader/lists"}