From 14c6187686399f68d5ba74d1292d42fc0e9f0b04 Mon Sep 17 00:00:00 2001 From: Herklos Date: Fri, 27 Feb 2026 15:47:45 +0100 Subject: [PATCH] Add main.py Signed-off-by: Herklos --- requirements.txt | 2 +- start.py | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 start.py diff --git a/requirements.txt b/requirements.txt index 4169f3b..603e9cc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ OctoBot[full]==2.0.16 -OctoBot-Script==0.0.29 +OctoBot-Script==0.1.0 diff --git a/start.py b/start.py new file mode 100644 index 0000000..075bc7d --- /dev/null +++ b/start.py @@ -0,0 +1,29 @@ +import asyncio +import octobot_script as obs +import octobot_services.constants as services_constants + + +async def start_profile(): + config = {} + profile_id = "ai_trading" + + # Read and cache candle data to make subsequent backtesting runs faster. + data = await obs.get_data( + "BTC/USDT", + "1d", + start_timestamp=1767222000, # 01/01/2026 + social_sources=[services_constants.ALTERNATIVE_ME_TOPIC_FEAR_AND_GREED], + profile_id=profile_id, + ) + # Run a backtest using the above data, strategy and configuration. + res = await obs.run(data, config, profile_id=profile_id) + print(res.describe()) + # Generate and open report including indicators plots + await obs.generate_and_show_report(res) + # Stop data to release local databases. + await data.stop() + + +# Call the execution of the script inside "asyncio.run" as +# OctoBot-Script runs using the python asyncio framework. +asyncio.run(start_profile())