{"id":13435919,"url":"https://github.com/ematvey/pybacktest","last_synced_at":"2025-03-18T12:30:35.102Z","repository":{"id":5226441,"uuid":"6402800","full_name":"ematvey/pybacktest","owner":"ematvey","description":"Vectorized backtesting framework in Python / pandas, designed to make your backtesting easier — compact, simple and fast","archived":false,"fork":false,"pushed_at":"2021-11-11T18:52:59.000Z","size":1050,"stargazers_count":811,"open_issues_count":17,"forks_count":242,"subscribers_count":71,"default_branch":"master","last_synced_at":"2025-02-28T19:26:09.709Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"growlf/djangocms-stacks","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ematvey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-26T11:30:22.000Z","updated_at":"2025-02-26T12:52:01.000Z","dependencies_parsed_at":"2022-07-12T15:02:59.472Z","dependency_job_id":null,"html_url":"https://github.com/ematvey/pybacktest","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ematvey%2Fpybacktest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ematvey%2Fpybacktest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ematvey%2Fpybacktest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ematvey%2Fpybacktest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ematvey","download_url":"https://codeload.github.com/ematvey/pybacktest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244222074,"owners_count":20418440,"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":[],"created_at":"2024-07-31T03:00:40.782Z","updated_at":"2025-03-18T12:30:35.096Z","avatar_url":"https://github.com/ematvey.png","language":"Python","funding_links":[],"categories":["Uncategorized","Python"],"sub_categories":["Uncategorized","Trading \u0026 Backtesting","交易与回测"],"readme":"# pybacktest\nSimple yet powerful backtesting framework in python/pandas.\n\nCurrently I don't plan to continue working on this project.\n\n### About\nIt allows user to specify trading strategies using full power of pandas, at the same time hiding all boring things like manually calculating trades, equity, performance statistics and creating visualizations. Resulting strategy code is usable both in research and production setting.\n\nStrategies could be defined as simple this:\n```python\nms = pandas.rolling_mean(ohlc.C, 50)\nml = pandas.rolling_mean(ohlc.C, 100)\nbuy = cover = (ms \u003e ml) \u0026 (ms.shift() \u003c ml.shift())\nsell = short = (ms \u003c ml) \u0026 (ms.shift() \u003e ml.shift())\n```\n\nAnd then tested like this:\n`pybacktest.Backtest(locals())`\n\nWe use it in our research and production operations.\n\n## Installation\n```\npip install git+https://github.com/ematvey/pybacktest.git\n```\nIf you don't install it in virtualenv, you might need to prepend last line with sudo.\n\n## Tutorial\nTutorials are provided as ipython notebooks in folder *examples*. You run it from cloned repo or [watch via nbviewer](http://nbviewer.ipython.org/urls/raw.github.com/ematvey/pybacktest/master/examples/tutorial.ipynb).\n\n## Status\nSingle-security backtester is ready. Multi-security testing could be implemented by running single-sec backtests and then combining equity. Later we will add easier way.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fematvey%2Fpybacktest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fematvey%2Fpybacktest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fematvey%2Fpybacktest/lists"}