{"id":13599729,"url":"https://github.com/kieran-mackle/AutoTrader","last_synced_at":"2025-04-10T17:32:05.608Z","repository":{"id":37286963,"uuid":"384892017","full_name":"kieran-mackle/AutoTrader","owner":"kieran-mackle","description":"A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading. ","archived":false,"fork":false,"pushed_at":"2024-03-23T03:38:07.000Z","size":16057,"stargazers_count":1089,"open_issues_count":35,"forks_count":248,"subscribers_count":46,"default_branch":"main","last_synced_at":"2025-03-10T19:08:21.615Z","etag":null,"topics":["algo-trading","algorithmic-trading","autotrader","crypto","finance","forex","investing","oanda","python","quantitative-finance","quantitative-trading","stocks","technical-analysis","trading","trading-algorithms","trading-bot","trading-platform","trading-strategies"],"latest_commit_sha":null,"homepage":"https://kieran-mackle.github.io/AutoTrader/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kieran-mackle.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}},"created_at":"2021-07-11T08:03:39.000Z","updated_at":"2025-03-10T00:26:30.000Z","dependencies_parsed_at":"2022-07-14T06:40:33.240Z","dependency_job_id":"5af2314a-6b4a-4a8b-87c0-f4307b819e13","html_url":"https://github.com/kieran-mackle/AutoTrader","commit_stats":{"total_commits":2103,"total_committers":4,"mean_commits":525.75,"dds":"0.13029006181645264","last_synced_commit":"9d4e3902e0be0d8bbc09a705df9f4b5e18e42038"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kieran-mackle%2FAutoTrader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kieran-mackle%2FAutoTrader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kieran-mackle%2FAutoTrader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kieran-mackle%2FAutoTrader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kieran-mackle","download_url":"https://codeload.github.com/kieran-mackle/AutoTrader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248261994,"owners_count":21074229,"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","autotrader","crypto","finance","forex","investing","oanda","python","quantitative-finance","quantitative-trading","stocks","technical-analysis","trading","trading-algorithms","trading-bot","trading-platform","trading-strategies"],"created_at":"2024-08-01T17:01:10.161Z","updated_at":"2025-04-10T17:32:04.664Z","avatar_url":"https://github.com/kieran-mackle.png","language":"Python","funding_links":[],"categories":["Python","Quantitative Trading \u0026 Backtesting"],"sub_categories":["Trading \u0026 Backtesting","交易与回测"],"readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://kieran-mackle.github.io/AutoTrader/\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/60687606/132320916-23445f43-dfdc-4949-9881-e18f622605d2.png\" alt=\"AutoTrader Logo\" width=\"15%\" \u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eAutoTrader\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pypi.org/project/autotrader\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/autotrader.svg?color=blue\u0026style=plastic\" alt=\"Latest version\" width=95 height=20\u003e\n  \u003c/a\u003e\n  \n  \u003ca href=\"https://pepy.tech/project/autotrader\"\u003e\n    \u003cimg src=\"https://pepy.tech/badge/autotrader\" alt=\"Total downloads\" \u003e\n  \u003c/a\u003e\n  \n  \u003ca href=\"https://pepy.tech/project/autotrader\"\u003e\n    \u003cimg src=\"https://pepy.tech/badge/autotrader/month\" alt=\"Monthly downloads\" \u003e\n  \u003c/a\u003e\n\n  \u003ca href='https://autotrader.readthedocs.io/en/latest/?badge=latest'\u003e\n    \u003cimg src='https://readthedocs.org/projects/autotrader/badge/?version=latest' alt='Documentation Status' /\u003e\n  \u003c/a\u003e\n  \n  \u003ca href=\"https://github.com/psf/black\"\u003e\n    \u003cimg alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"\u003e\n  \u003c/a\u003e\n  \n\u003c/p\u003e\n\n\nAutoTrader is Python-based platform intended to help in the development, optimisation and deployment of automated trading systems. \nA basic level of experience with Python is recommended for using AutoTrader, but the [docs](https://autotrader.readthedocs.io/en/latest/) \naim to make using it as easy as possible with detailed tutorials and documentation.\n\n## Latest News\n- [CryptoBots](https://github.com/kieran-mackle/cryptobots) has been released along with version `1.0.0`, offering ready-to-trade crypto strategies from the command line\n- Version 0.7 has been released, adding integrations with [CCXT](https://github.com/ccxt/ccxt) crypto exchanges. Many more powerful upgrades too.\n- AutoTrader has been featured in GitClone's recent article, [*Top Crypto Trader Open-Source Projects on Github*](https://gitclone.dev/top-crypto-trader-open-source-projects-on-github/).\n\n## Features\n- A feature-rich trading simulator, supporting [backtesting](https://autotrader.readthedocs.io/en/latest/features/backtesting.html) and \npapertrading. The 'virtual broker' allows you to test your strategies in a risk-free, simulated environment before going live. Capable \nof simulating multiple order types, stop-losses and take-profits, cross-exchange arbitrage and portfolio strategies, AutoTrader has \nmore than enough to build a profitable trading system.\n- [Integrated data feeds](https://kieran-mackle.github.io/AutoTrader/tutorials/price-data), making OHLC data retrieval as easy as possible.\n- [Automated interactive visualisation](https://autotrader.readthedocs.io/en/latest/features/visualisation.html) using [Bokeh](https://bokeh.org/)\n- [Library of custom indicators](https://autotrader.readthedocs.io/en/latest/indicators.html).\n- [Live trading](https://autotrader.readthedocs.io/en/latest/features/live-trading.html) supported for multiple venues.\n- [Detailed documenation and tutorials](https://autotrader.readthedocs.io/en/latest/index.html)\n- [Repository](https://github.com/kieran-mackle/autotrader-demo) of example strategies\n\n\u003cp align=\"right\"\u003e[\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e]\u003c/p\u003e\n\n\n## Supported Brokers and Exchanges\n\n| Broker | Asset classes | Integration status |\n| -------- | ------------- | ------------------ |\n| [Oanda](https://www.oanda.com/)    | Forex CFDs    | Complete |\n| [Interactive Brokers](https://www.interactivebrokers.com/en/home.php) | Many | In progress |\n| [CCXT](https://github.com/ccxt/ccxt) | Cryptocurrencies | In progress |\n\n\u003cp align=\"right\"\u003e[\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e]\u003c/p\u003e\n\n## Installation\nAutoTrader can be installed using pip:\n```\npip install autotrader\n```\n### Updating\nAutoTrader can be updated by appending the `--upgrade` flag to the install command:\n```\npip install autotrader --upgrade\n```\n\n\u003cp align=\"right\"\u003e[\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e]\u003c/p\u003e\n\n## Documentation\nAutoTrader is very well documented in-code and on [Read the Docs](https://autotrader.readthedocs.io/en/latest/). There is also a [detailed walthrough](https://autotrader.readthedocs.io/en/latest/tutorials/walkthrough.html), covering everything from strategy concept to livetrading.\n\n### Example Strategies\nExample strategies can be found in the [demo repository](https://github.com/kieran-mackle/autotrader-demo).\n\n\u003cp align=\"right\"\u003e[\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e]\u003c/p\u003e\n\n## Backtest Demo\nThe chart below is produced by a backtest of the MACD trend strategy documented in the \n[tutorials](https://autotrader.readthedocs.io/en/latest/tutorials/building-strategy.html) (and available in the \n[demo repository](https://github.com/kieran-mackle/autotrader-demo)). Entry signals are defined by MACD crossovers, with exit targets defined\nby a 1.5 risk-to-reward ratio. Stop-losses are automatically placed using the custom\n[swing detection](https://autotrader.readthedocs.io/en/latest/indicators.html#swing-detection) indicator, and position sizes are dynamically calculated based \non risk percentages defined in the strategy configuration.\n\nRunning this strategy with AutoTrader in backtest mode will produce the following interactive chart. \n\n[![MACD-backtest-demo](https://user-images.githubusercontent.com/60687606/128127659-bf81fdd2-c246-4cd1-b86d-ef624cac50a7.png)](https://autotrader.readthedocs.io/en/latest/tutorials/backtesting.html#interactive-chart)\n\nNote that stop loss and take profit levels are shown for each trade taken. This allows you to see how effective your exit strategy is - are you being stopped out too \nearly by placing your stop losses too tight? Are you missing out on otherwise profitable trades becuase your take profits are too far away? AutoTrader helps you \nvisualise your strategy and answer these questions.\n\n\u003cp align=\"right\"\u003e[\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e]\u003c/p\u003e\n\n\n## Contributing\nTo contribute to `autotrader`, please read the instructions below,\nand stick to the styling of the code.\n\n### Setting up for Development\n\n1. Create a new Python virtual environment to isolate the package. You \ncan do so using [`venv`](https://docs.python.org/3/library/venv.html) or\n[anaconda](https://www.anaconda.com/).\n\n2. Install the code in editable mode using the command below (run from\ninside the `autotrader` root directory). Also install all dependencies \nusing the `[all]` command, which includes the developer dependencies.\n\n```\npip install -e .[all]\n```\n\n3. Install the [pre-commit](https://pre-commit.com/) hooks.\n\n```\npre-commit install\n```\n\n4. Start developing! After following the steps above, you are ready\nto start developing the code. Make sure to follow the guidelines \nbelow.\n\n\n### Developing AutoTrader\n\n- Fork the repository and clone to your local machine for development.\n\n- Run [black](https://black.readthedocs.io/en/stable/index.html) on any\ncode you modify. This formats it according to \n[PEP8](https://peps.python.org/pep-0008/) standards.\n\n- Document as you go: use \n[numpy style](https://numpydoc.readthedocs.io/en/latest/format.html) \ndocstrings, and add to the docs where relevant.\n\n- Write unit tests for the code you add, and include them in `tests/`. \nThis project uses [pytest](https://docs.pytest.org/en/7.2.x/).\n\n- Commit code regularly to avoid large commits with many changes. \n\n- Write meaningful commit messages, following the \n[Conventional Commits standard](https://www.conventionalcommits.org/en/v1.0.0/).\nThe python package [commitizen](https://commitizen-tools.github.io/commitizen/)\nis a great tool to help with this, and is already configured for this\nrepo. Simply stage changed code, then use the `cz c` command to make a \ncommit.\n\n- Open a [Pull Request](https://github.com/kieran-mackle/autoTrader/pulls) \nwhen your code is complete and ready to be merged.\n\n\n### Building the Docs\n\nTo build the documentation, run the commands below. \n\n```\ncd docs/\nmake html\nxdg-open build/html/index.html\n```\n\nIf you are actively developing the docs, consider using\n[sphinx-autobuild](https://pypi.org/project/sphinx-autobuild/).\nThis will continuosly update the docs for you to see any changes\nlive, rather than re-building repeatadly. From the `docs/` \ndirectory, run the following command:\n\n```\nsphinx-autobuild source/ build/html --open-browser\n```\n\n\u003cp align=\"right\"\u003e[\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e]\u003c/p\u003e\n\n\n## Legal \n### License\nAutoTrader is licensed under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html).\n\n### Disclaimer\nNever risk money you cannot afford to lose. Always test your strategies on a paper trading account before taking it live.\n\n\u003cp align=\"right\"\u003e[\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e]\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkieran-mackle%2FAutoTrader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkieran-mackle%2FAutoTrader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkieran-mackle%2FAutoTrader/lists"}