backtesting-data


Namebacktesting-data JSON
Version 0.0.6 PyPI version JSON
download
home_pagehttps://github.com/ferromariano/backtesting-data
SummaryLibreria para obtener datos para usar en backtesting.py
upload_time2024-11-07 18:10:47
maintainerNone
docs_urlNone
authorMariano Damian Ferro Villanueva
requires_pythonNone
licenseNone
keywords python backtesting.py backtesting exchange
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Backtesting data

Accesde a datos historicos rapidamente :D para usar en backtesting.py

## Installation

    $ pip install backtesting backtesting-data

## Usage

```python
from backtesting import Backtest, Strategy
from backtesting.lib import crossover

from backtesting.test import SMA
from backtesting_data import historySymbol
import datetime


class SmaCross(Strategy):
    def init(self):
        price = self.data.Close
        self.ma1 = self.I(SMA, price, 10)
        self.ma2 = self.I(SMA, price, 20)

    def next(self):
        if crossover(self.ma1, self.ma2):
            self.buy()
        elif crossover(self.ma2, self.ma1):
            self.sell()


BTCUSDT = historyCoin('binanceusdm', 'BTCUSDT', '5m', 200, end_time=datetime.datetime(2024, 10, 25, 20, 30))

bt = Backtest(BTCUSDT, SmaCross, commission=.002,
              exclusive_orders=True)
stats = bt.run()
bt.plot()
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ferromariano/backtesting-data",
    "name": "backtesting-data",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python, backtesting.py, backtesting, exchange",
    "author": "Mariano Damian Ferro Villanueva",
    "author_email": "<ferro.mariano@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/96/06/e6cacf0e65d18246d499b02d7a2ecd546e4b8127ed197ca5e479e6947079/backtesting_data-0.0.6.tar.gz",
    "platform": null,
    "description": "# Backtesting data\n\nAccesde a datos historicos rapidamente :D para usar en backtesting.py\n\n## Installation\n\n    $ pip install backtesting backtesting-data\n\n## Usage\n\n```python\nfrom backtesting import Backtest, Strategy\nfrom backtesting.lib import crossover\n\nfrom backtesting.test import SMA\nfrom backtesting_data import historySymbol\nimport datetime\n\n\nclass SmaCross(Strategy):\n    def init(self):\n        price = self.data.Close\n        self.ma1 = self.I(SMA, price, 10)\n        self.ma2 = self.I(SMA, price, 20)\n\n    def next(self):\n        if crossover(self.ma1, self.ma2):\n            self.buy()\n        elif crossover(self.ma2, self.ma1):\n            self.sell()\n\n\nBTCUSDT = historyCoin('binanceusdm', 'BTCUSDT', '5m', 200, end_time=datetime.datetime(2024, 10, 25, 20, 30))\n\nbt = Backtest(BTCUSDT, SmaCross, commission=.002,\n              exclusive_orders=True)\nstats = bt.run()\nbt.plot()\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Libreria para obtener datos para usar en backtesting.py",
    "version": "0.0.6",
    "project_urls": {
        "Homepage": "https://github.com/ferromariano/backtesting-data"
    },
    "split_keywords": [
        "python",
        " backtesting.py",
        " backtesting",
        " exchange"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5f739187dd2971ad56edb95f312a4fb311f09cfc1ce60aaf39fe3804bee89950",
                "md5": "ed1d89c342d3fe17b769d642871038f4",
                "sha256": "30469bf22c3272848d017dc65674890406ea0c5baf8074bfdd1d48faaa255cbc"
            },
            "downloads": -1,
            "filename": "backtesting_data-0.0.6-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ed1d89c342d3fe17b769d642871038f4",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 24680,
            "upload_time": "2024-11-07T18:10:40",
            "upload_time_iso_8601": "2024-11-07T18:10:40.120358Z",
            "url": "https://files.pythonhosted.org/packages/5f/73/9187dd2971ad56edb95f312a4fb311f09cfc1ce60aaf39fe3804bee89950/backtesting_data-0.0.6-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5f5119b557d2b1727b7d21f5176cdfdcf9cd38d27b980448071cb577e366f062",
                "md5": "9f3fef7a066cfc02f1c8262ff0faa786",
                "sha256": "40d6c722116c3e236c86c1d39da4d7def70c29aae8bc215b4be77655899ddf0a"
            },
            "downloads": -1,
            "filename": "backtesting_data-0.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9f3fef7a066cfc02f1c8262ff0faa786",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 24677,
            "upload_time": "2024-11-07T18:10:44",
            "upload_time_iso_8601": "2024-11-07T18:10:44.141019Z",
            "url": "https://files.pythonhosted.org/packages/5f/51/19b557d2b1727b7d21f5176cdfdcf9cd38d27b980448071cb577e366f062/backtesting_data-0.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9606e6cacf0e65d18246d499b02d7a2ecd546e4b8127ed197ca5e479e6947079",
                "md5": "49912af7aefaed7b9138e2d26a4c5c71",
                "sha256": "bab7d2e2ed3dd3ea2af52cefb179d66f26849e16b78b07da4811c03c66067862"
            },
            "downloads": -1,
            "filename": "backtesting_data-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "49912af7aefaed7b9138e2d26a4c5c71",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 22214,
            "upload_time": "2024-11-07T18:10:47",
            "upload_time_iso_8601": "2024-11-07T18:10:47.377242Z",
            "url": "https://files.pythonhosted.org/packages/96/06/e6cacf0e65d18246d499b02d7a2ecd546e4b8127ed197ca5e479e6947079/backtesting_data-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-07 18:10:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ferromariano",
    "github_project": "backtesting-data",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "backtesting-data"
}
        
Elapsed time: 7.06560s