{"id":19921952,"url":"https://github.com/drakkar-software/octobot-script","last_synced_at":"2025-04-10T00:17:50.255Z","repository":{"id":64970839,"uuid":"571229420","full_name":"Drakkar-Software/OctoBot-Script","owner":"Drakkar-Software","description":"Quant framework by OctoBot","archived":false,"fork":false,"pushed_at":"2025-03-10T08:44:36.000Z","size":625,"stargazers_count":22,"open_issues_count":1,"forks_count":21,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T00:17:46.748Z","etag":null,"topics":["ai","backtesting","cryptocurrency","deep-learning","exchange","machine-learning","ml","octobot","python","quant","reinforcement-learning","technical-analysis"],"latest_commit_sha":null,"homepage":"https://www.octobot.cloud/guides/octobot-script?utm_source=github\u0026utm_medium=dk\u0026utm_campaign=regular_open_source_content\u0026utm_content=octobot_script_project_description_link","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/Drakkar-Software.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,"publiccode":null,"codemeta":null}},"created_at":"2022-11-27T15:25:21.000Z","updated_at":"2025-03-10T08:44:39.000Z","dependencies_parsed_at":"2023-09-27T17:15:06.288Z","dependency_job_id":"673b5cd2-170c-449f-bc1b-7c34d42800e4","html_url":"https://github.com/Drakkar-Software/OctoBot-Script","commit_stats":{"total_commits":126,"total_committers":3,"mean_commits":42.0,"dds":"0.31746031746031744","last_synced_commit":"5d251a8a602a23157efdb31958afe3e1aa27049e"},"previous_names":["drakkar-software/octobot-script","drakkar-software/octobot-pro"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drakkar-Software%2FOctoBot-Script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drakkar-Software%2FOctoBot-Script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drakkar-Software%2FOctoBot-Script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drakkar-Software%2FOctoBot-Script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Drakkar-Software","download_url":"https://codeload.github.com/Drakkar-Software/OctoBot-Script/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131318,"owners_count":21052820,"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":["ai","backtesting","cryptocurrency","deep-learning","exchange","machine-learning","ml","octobot","python","quant","reinforcement-learning","technical-analysis"],"created_at":"2024-11-12T22:08:57.037Z","updated_at":"2025-04-10T00:17:50.237Z","avatar_url":"https://github.com/Drakkar-Software.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OctoBot-Script [0.0.23](https://github.com/Drakkar-Software/OctoBot-Script/tree/master/CHANGELOG.md)\n[![PyPI](https://img.shields.io/pypi/v/OctoBot-Script.svg?logo=pypi)](https://pypi.python.org/pypi/octobot-script/)\n[![Downloads](https://static.pepy.tech/badge/OctoBot-Script/month)](https://pepy.tech/project/octobot-script)\n[![Dockerhub](https://img.shields.io/docker/pulls/drakkarsoftware/OctoBot-Script.svg?logo=docker)](https://hub.docker.com/r/drakkarsoftware/octobot-script)\n[![Github-Action-CI](https://github.com/Drakkar-Software/OctoBot-Script/actions/workflows/main.yml/badge.svg)](https://github.com/Drakkar-Software/OctoBot-Script/actions/workflows/main.yml)\n\n## OctoBot-Script Community\n[![Telegram Chat](https://img.shields.io/badge/telegram-chat-green.svg?logo=telegram\u0026label=Telegram)](https://t.me/+366CLLZ2NC0xMjFk)\n[![Discord](https://img.shields.io/discord/530629985661222912.svg?logo=discord\u0026label=Discord)](https://discord.com/invite/vHkcb8W)\n[![Twitter](https://img.shields.io/twitter/follow/DrakkarsOctobot.svg?label=twitter\u0026style=social)](https://twitter.com/DrakkarsOctoBot)\n\n\n## OctoBot Script is the Quant framework by OctoBot\n\n\u003e OctoBot Script is in alpha version\n\nDocumentation available at [octobot.cloud/en/guides/octobot-script](https://www.octobot.cloud/en/guides/octobot-script?utm_source=octobot\u0026utm_medium=dk\u0026utm_campaign=regular_open_source_content\u0026utm_content=octobot_script_readme)\n\n\n## Install OctoBot Script from pip\n\n\u003e OctoBot Script requires **Python 3.10**\n\n``` {.sourceCode .bash}\npython3 -m pip install OctoBot wheel appdirs==1.4.4\npython3 -m pip install octobot-script\n```\n\n## Example of a backtesting script\n\n### Script\n``` python\nimport asyncio\nimport tulipy    # Can be any TA library.\nimport octobot_script as obs\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 obs.Close(ctx, max_history=True)\n            times = await obs.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 \u003c ctx.tentacle.trading_config[\"rsi_value_buy_threshold\"]\n            }\n            await obs.plot_indicator(ctx, \"RSI\", times[delta:], rsi_v, run_data[\"entries\"])\n        if obs.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 obs.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 obs.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 obs.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-Script 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-Script/assets/images/report_1.jpg)\n\n### Join the community\nWe recently created a telegram channel dedicated to OctoBot Script.\n\n[![Telegram News](https://img.shields.io/static/v1?label=Telegram%20chat\u0026message=Join\u0026logo=telegram\u0026\u0026color=007bff\u0026style=for-the-badge)](https://t.me/+366CLLZ2NC0xMjFk)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrakkar-software%2Foctobot-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrakkar-software%2Foctobot-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrakkar-software%2Foctobot-script/lists"}