OctoBot-Pro


NameOctoBot-Pro JSON
Version 0.0.11 PyPI version JSON
download
home_pagehttps://github.com/Drakkar-Software/OctoBot-Pro
SummaryBacktesting framework of the OctoBot Ecosystem
upload_time2023-09-23 19:41:39
maintainer
docs_urlNone
authorDrakkar-Software
requires_python>=3.8
licenseGPL-3.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Octobot-Pro [0.0.11](https://github.com/Drakkar-Software/OctoBot-Pro/tree/master/CHANGELOG.md)
[![PyPI](https://img.shields.io/pypi/v/octobot-pro.svg?logo=pypi)](https://pypi.python.org/pypi/octobot-pro/)
[![Downloads](https://static.pepy.tech/badge/octobot-pro/month)](https://pepy.tech/project/octobot-pro)
[![Github-Action-CI](https://github.com/Drakkar-Software/OctoBot-Pro/workflows/OctoBot-Pro-CI/badge.svg)](https://github.com/Drakkar-Software/OctoBot-Pro/actions)

## Octobot-Pro Community
[![Telegram Chat](https://img.shields.io/badge/telegram-chat-green.svg?logo=telegram&label=Telegram)](https://octobot.click/readme-telegram-octobot-pro)
[![Discord](https://img.shields.io/discord/530629985661222912.svg?logo=discord&label=Discord)](https://octobot.click/gh-discord-octobot-pro)
[![Twitter](https://img.shields.io/twitter/follow/DrakkarsOctobot.svg?label=twitter&style=social)](https://octobot.click/gh-twitter-octobot-pro)


## OctoBot Pro is the backtesting framework using the OctoBot Ecosystem

> OctoBot Pro is in early alpha version

Documentation available at [https://pro.octobot.info/](https://octobot.click/Xzae1a6)


## Install OctoBot Pro from pip

> OctoBot pro requires **Python 3.10**

``` {.sourceCode .bash}
python3 -m pip install OctoBot wheel
python3 -m pip install octobot-pro
```

## Example of a backtesting script

### Script
``` python
import asyncio
import tulipy    # Can be any TA library.
import octobot_pro as op


async def rsi_test():
    async def strategy(ctx):
        # Will be called at each candle.
        if run_data["entries"] is None:
            # Compute entries only once per backtest.
            closes = await op.Close(ctx, max_history=True)
            times = await op.Time(ctx, max_history=True, use_close_time=True)
            rsi_v = tulipy.rsi(closes, period=ctx.tentacle.trading_config["period"])
            delta = len(closes) - len(rsi_v)
            # Populate entries with timestamps of candles where RSI is
            # bellow the "rsi_value_buy_threshold" configuration.
            run_data["entries"] = {
                times[index + delta]
                for index, rsi_val in enumerate(rsi_v)
                if rsi_val < ctx.tentacle.trading_config["rsi_value_buy_threshold"]
            }
            await op.plot_indicator(ctx, "RSI", times[delta:], rsi_v, run_data["entries"])
        if op.current_live_time(ctx) in run_data["entries"]:
            # Uses pre-computed entries times to enter positions when relevant.
            # Also, instantly set take profits and stop losses.
            # Position exists could also be set separately.
            await op.market(ctx, "buy", amount="10%", stop_loss_offset="-15%", take_profit_offset="25%")

    # Configuration that will be passed to each run.
    # It will be accessible under "ctx.tentacle.trading_config".
    config = {
        "period": 10,
        "rsi_value_buy_threshold": 28,
    }

    # Read and cache candle data to make subsequent backtesting runs faster.
    data = await op.get_data("BTC/USDT", "1d", start_timestamp=1505606400)
    run_data = {
        "entries": None,
    }
    # Run a backtest using the above data, strategy and configuration.
    res = await op.run(data, strategy, config)
    print(res.describe())
    # Generate and open report including indicators plots 
    await res.plot(show=True)
    # Stop data to release local databases.
    await data.stop()


# Call the execution of the script inside "asyncio.run" as
# OctoBot-Pro runs using the python asyncio framework.
asyncio.run(rsi_test())
```

### Generated report
![report-p1](https://raw.githubusercontent.com/Drakkar-Software/OctoBot-Pro/assets/images/report_1.jpg)

### Join the community
We recently created a telegram channel dedicated to OctoBot Pro.

[![Telegram News](https://img.shields.io/static/v1?label=Telegram%20chat&message=Join&logo=telegram&&color=007bff&style=for-the-badge)](https://octobot.click/readme-telegram-octobot-pro)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Drakkar-Software/OctoBot-Pro",
    "name": "OctoBot-Pro",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "Drakkar-Software",
    "author_email": "contact@drakkar.software",
    "download_url": "https://files.pythonhosted.org/packages/53/b2/ee2b8f75f5b32fd6927b28e7bbbd0edd850285f011f0b92f46551580922d/OctoBot-Pro-0.0.11.tar.gz",
    "platform": null,
    "description": "# Octobot-Pro [0.0.11](https://github.com/Drakkar-Software/OctoBot-Pro/tree/master/CHANGELOG.md)\n[![PyPI](https://img.shields.io/pypi/v/octobot-pro.svg?logo=pypi)](https://pypi.python.org/pypi/octobot-pro/)\n[![Downloads](https://static.pepy.tech/badge/octobot-pro/month)](https://pepy.tech/project/octobot-pro)\n[![Github-Action-CI](https://github.com/Drakkar-Software/OctoBot-Pro/workflows/OctoBot-Pro-CI/badge.svg)](https://github.com/Drakkar-Software/OctoBot-Pro/actions)\n\n## Octobot-Pro Community\n[![Telegram Chat](https://img.shields.io/badge/telegram-chat-green.svg?logo=telegram&label=Telegram)](https://octobot.click/readme-telegram-octobot-pro)\n[![Discord](https://img.shields.io/discord/530629985661222912.svg?logo=discord&label=Discord)](https://octobot.click/gh-discord-octobot-pro)\n[![Twitter](https://img.shields.io/twitter/follow/DrakkarsOctobot.svg?label=twitter&style=social)](https://octobot.click/gh-twitter-octobot-pro)\n\n\n## OctoBot Pro is the backtesting framework using the OctoBot Ecosystem\n\n> OctoBot Pro is in early alpha version\n\nDocumentation available at [https://pro.octobot.info/](https://octobot.click/Xzae1a6)\n\n\n## Install OctoBot Pro from pip\n\n> OctoBot pro requires **Python 3.10**\n\n``` {.sourceCode .bash}\npython3 -m pip install OctoBot wheel\npython3 -m pip install octobot-pro\n```\n\n## Example of a backtesting script\n\n### Script\n``` python\nimport asyncio\nimport tulipy    # Can be any TA library.\nimport octobot_pro as op\n\n\nasync def rsi_test():\n    async def strategy(ctx):\n        # Will be called at each candle.\n        if run_data[\"entries\"] is None:\n            # Compute entries only once per backtest.\n            closes = await op.Close(ctx, max_history=True)\n            times = await op.Time(ctx, max_history=True, use_close_time=True)\n            rsi_v = tulipy.rsi(closes, period=ctx.tentacle.trading_config[\"period\"])\n            delta = len(closes) - len(rsi_v)\n            # Populate entries with timestamps of candles where RSI is\n            # bellow the \"rsi_value_buy_threshold\" configuration.\n            run_data[\"entries\"] = {\n                times[index + delta]\n                for index, rsi_val in enumerate(rsi_v)\n                if rsi_val < ctx.tentacle.trading_config[\"rsi_value_buy_threshold\"]\n            }\n            await op.plot_indicator(ctx, \"RSI\", times[delta:], rsi_v, run_data[\"entries\"])\n        if op.current_live_time(ctx) in run_data[\"entries\"]:\n            # Uses pre-computed entries times to enter positions when relevant.\n            # Also, instantly set take profits and stop losses.\n            # Position exists could also be set separately.\n            await op.market(ctx, \"buy\", amount=\"10%\", stop_loss_offset=\"-15%\", take_profit_offset=\"25%\")\n\n    # Configuration that will be passed to each run.\n    # It will be accessible under \"ctx.tentacle.trading_config\".\n    config = {\n        \"period\": 10,\n        \"rsi_value_buy_threshold\": 28,\n    }\n\n    # Read and cache candle data to make subsequent backtesting runs faster.\n    data = await op.get_data(\"BTC/USDT\", \"1d\", start_timestamp=1505606400)\n    run_data = {\n        \"entries\": None,\n    }\n    # Run a backtest using the above data, strategy and configuration.\n    res = await op.run(data, strategy, config)\n    print(res.describe())\n    # Generate and open report including indicators plots \n    await res.plot(show=True)\n    # Stop data to release local databases.\n    await data.stop()\n\n\n# Call the execution of the script inside \"asyncio.run\" as\n# OctoBot-Pro runs using the python asyncio framework.\nasyncio.run(rsi_test())\n```\n\n### Generated report\n![report-p1](https://raw.githubusercontent.com/Drakkar-Software/OctoBot-Pro/assets/images/report_1.jpg)\n\n### Join the community\nWe recently created a telegram channel dedicated to OctoBot Pro.\n\n[![Telegram News](https://img.shields.io/static/v1?label=Telegram%20chat&message=Join&logo=telegram&&color=007bff&style=for-the-badge)](https://octobot.click/readme-telegram-octobot-pro)\n",
    "bugtrack_url": null,
    "license": "GPL-3.0",
    "summary": "Backtesting framework of the OctoBot Ecosystem",
    "version": "0.0.11",
    "project_urls": {
        "Homepage": "https://github.com/Drakkar-Software/OctoBot-Pro"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "53b2ee2b8f75f5b32fd6927b28e7bbbd0edd850285f011f0b92f46551580922d",
                "md5": "32b0447c46b7291ba41fb28528dcc161",
                "sha256": "0dfabeb8971b66dabdb421dce24039472eb78c22a8560cf5fd1105a3bc2f9973"
            },
            "downloads": -1,
            "filename": "OctoBot-Pro-0.0.11.tar.gz",
            "has_sig": false,
            "md5_digest": "32b0447c46b7291ba41fb28528dcc161",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 33241,
            "upload_time": "2023-09-23T19:41:39",
            "upload_time_iso_8601": "2023-09-23T19:41:39.012961Z",
            "url": "https://files.pythonhosted.org/packages/53/b2/ee2b8f75f5b32fd6927b28e7bbbd0edd850285f011f0b92f46551580922d/OctoBot-Pro-0.0.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-23 19:41:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Drakkar-Software",
    "github_project": "OctoBot-Pro",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "octobot-pro"
}
        
Elapsed time: 0.12806s