{ "info": { "author": "UM", "author_email": "uberdeveloper001@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Financial and Insurance Industry", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Utilities" ], "description": "# Introduction\n\n**fastbt** is a simple and dirty way to do backtests based on end of day data, especially for day trading.\nThe main purpose is to provide a simple framework to weed out bad strategies so that you could test and improve your better strategies further.\n\nIt is based on the assumption that you enter into a position based on some pre-defined rules for a defined period and exit either at the end of the period or when stop loss is triggered. See the [rationale](https://github.com/uberdeveloper/fastbt/blob/master/docs/rationale.md) for this approach and the built-in assumptions. _fastbt is rule-based and not event-based._\n\nIf your strategy gets you good results, then check them with a full featured backtesting framework such as [zipline](http://www.zipline.io/) or [backtrader](https://www.backtrader.com/) to verify your results.\nIf your strategy fails, then it would most probably fail in other environments.\n\nThis is **alpha**\n\nMost of the modules are stand alone and you could use them as a single file. See embedding for more details\n\n# Features\n\n- Create your strategies in Microsoft Excel\n- Backtest as functions so you can parallelize\n- Try different simulations\n- Run from your own datasource or a database connection.\n- Run backtest based on rules\n- Add any column you want to your datasource as formulas\n\n# Installation\n\nfastbt requires python **>=3.6** and can be installed via pip\n\n```\npip install fastbt\n```\n\n# Quickstart\n\nFastbt assumes your data have the following columns (rename them in case of other names)\n\n- timestamp\n- symbol\n- open\n- high\n- low\n- close\n- volume\n\n```python\nfrom fastbt.rapid import *\nbacktest(data=data)\n```\n\nwould return a dataframe with all the trades.\n\nAnd if you want to see some metrics\n\n```python\nmetrics(backtest(data=data))\n```\n\nYou now ran a backtest without a strategy! By default, the strategy buys the top 5 stocks with the lowest price at open price on each period and sells them at the close price at the end of the period.\n\nYou can either specify the strategy by way of rules (the recommended way) or create your strategy as a function in python and pass it as a parameter\n\n```python\nbacktest(data=data, strategy=strategy)\n```\n\nIf you want to connect to a database, then\n\n```python\nfrom sqlalchemy import create_engine\nengine = create_engine('sqlite:///data.db')\nbacktest(connection=engine, tablename='data')\n```\n\nAnd to SELL instead of BUY\n\n```python\nbacktest(data=data, order='S')\n```\n\nLet's implement a simple strategy.\n\n> **BUY** the top 5 stocks with highest last week returns\n\nAssuming we have a **weeklyret** column,\n\n```python\nbacktest(data=data, order='B', sort_by='weeklyret', sort_mode=False)\n```\n\nWe used sort_mode=False to sort them in descending order.\n\n If you want to test this strategy on a weekly basis, just pass a dataframe with weekly frequency.\n\nSee the Introduction notebook in the examples directory for an in depth introduction.\n\n## Embedding\n\nSince fastbt is a thin wrapper around existing packages, the following files can be used as standalone without installing the fastbt package\n\n- datasource\n- utils\n- loaders\n\nCopy these files and just use them in your own modules.\n\n=========\nHistory\n=========\n\nv0.3.0 (2019-03-15)\n--------------------\n* More helper functions added to utils\n* Tradebook class enhanced\n* A Meta class added for event based simulation\n\nv0.2.0 (2018-12-26)\n--------------------\n* Backtest from different formats added\n* Rolling function added\n\n\nv0.1.0. (2018-10-13)\n----------------------\n\n* First release on PyPI\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/uberdeveloper/fastbt", "keywords": "fastbt,backtesting,algo trading", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "fastbt", "package_url": "https://pypi.org/project/fastbt/", "platform": "", "project_url": "https://pypi.org/project/fastbt/", "project_urls": { "Homepage": "https://github.com/uberdeveloper/fastbt" }, "release_url": "https://pypi.org/project/fastbt/0.3.0/", "requires_dist": [ "pandas (>=0.23.0)", "sqlalchemy (>=1.1.18)" ], "requires_python": "", "summary": "A simple framework for fast and dirty backtesting", "version": "0.3.0" }, "last_serial": 4944544, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "6a011823e7a0f6ab8ccacee2ef720e1f", "sha256": "d2074eabb13c642143160b9af8e0a8129f6d7b5385d0ef9a5fcd6bfab2ae58cf" }, "downloads": -1, "filename": "fastbt-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6a011823e7a0f6ab8ccacee2ef720e1f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 167917, "upload_time": "2018-10-15T15:36:49", "url": "https://files.pythonhosted.org/packages/92/c5/7ccc7fd9860c29f2ac2562de411d502994dfa0589c8c1484dae484bbf94c/fastbt-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fd311e9f6af579bf0bd20da858ee402b", "sha256": "b13c251cd376688ddf6ce9f92179d044eb92a5f197ff484e44586cc52a1732d9" }, "downloads": -1, "filename": "fastbt-0.1.0.tar.gz", "has_sig": false, "md5_digest": "fd311e9f6af579bf0bd20da858ee402b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1104595, "upload_time": "2018-10-15T15:36:55", "url": "https://files.pythonhosted.org/packages/72/45/1e9294642d020f568923771f6d9c6fd3222553e654a872ba7fc3154cd61c/fastbt-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "31b2ab8ac3358df4d0716a2ea48d6a8e", "sha256": "816a353fa34f9365a283f13a967b2c98e75f8ca92399044f477c35ce850bb0c0" }, "downloads": -1, "filename": "fastbt-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "31b2ab8ac3358df4d0716a2ea48d6a8e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 170963, "upload_time": "2018-12-26T17:12:07", "url": "https://files.pythonhosted.org/packages/11/ae/373b5ccab0a59d1d6c130bcf72e3c5ae44b1c2b9ba711fffc5134d706197/fastbt-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c84ac053049fa7e9bef00ce86165d62a", "sha256": "970c85af72f079a60270fb67f813cc62b95b76fc6f5163cc286f7a2ea4a03478" }, "downloads": -1, "filename": "fastbt-0.2.0.tar.gz", "has_sig": false, "md5_digest": "c84ac053049fa7e9bef00ce86165d62a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1811625, "upload_time": "2018-12-26T17:12:12", "url": "https://files.pythonhosted.org/packages/e3/31/cb4911e9ea09785bb5c919e50600cd24f96f0799cc066abece2bb60a92bd/fastbt-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "c874375e0887edf6a068dd9569d28ae4", "sha256": "6bc6d2eea807c460f8818ae21eb94167281897d1a66e1fc12b783bcb644e4d46" }, "downloads": -1, "filename": "fastbt-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c874375e0887edf6a068dd9569d28ae4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 177543, "upload_time": "2019-03-15T14:40:01", "url": "https://files.pythonhosted.org/packages/92/46/5dee3276d326b6e528b2f01955a3d2fd7051dc3c61409d5809ca38de431a/fastbt-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7fb2130ee80bd3b823a0f633ece6debf", "sha256": "e784713455fb4d5b9aee2e6d83ff38ee59f3aa7aab6b558025ba4edfaa4e9e76" }, "downloads": -1, "filename": "fastbt-0.3.0.tar.gz", "has_sig": false, "md5_digest": "7fb2130ee80bd3b823a0f633ece6debf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1842910, "upload_time": "2019-03-15T14:40:10", "url": "https://files.pythonhosted.org/packages/37/b7/bbc4f224fd0f2b8f55737f44fa9240f4e2a56efe227fb6359ee2c6463564/fastbt-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c874375e0887edf6a068dd9569d28ae4", "sha256": "6bc6d2eea807c460f8818ae21eb94167281897d1a66e1fc12b783bcb644e4d46" }, "downloads": -1, "filename": "fastbt-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c874375e0887edf6a068dd9569d28ae4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 177543, "upload_time": "2019-03-15T14:40:01", "url": "https://files.pythonhosted.org/packages/92/46/5dee3276d326b6e528b2f01955a3d2fd7051dc3c61409d5809ca38de431a/fastbt-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7fb2130ee80bd3b823a0f633ece6debf", "sha256": "e784713455fb4d5b9aee2e6d83ff38ee59f3aa7aab6b558025ba4edfaa4e9e76" }, "downloads": -1, "filename": "fastbt-0.3.0.tar.gz", "has_sig": false, "md5_digest": "7fb2130ee80bd3b823a0f633ece6debf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1842910, "upload_time": "2019-03-15T14:40:10", "url": "https://files.pythonhosted.org/packages/37/b7/bbc4f224fd0f2b8f55737f44fa9240f4e2a56efe227fb6359ee2c6463564/fastbt-0.3.0.tar.gz" } ] }