-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathprofile_example.py
More file actions
28 lines (23 loc) · 869 Bytes
/
profile_example.py
File metadata and controls
28 lines (23 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import asyncio
import octobot_script as obs
async def start_profile():
config = {}
profile_id = "dip_analyser"
# Read and cache candle data to make subsequent backtesting runs faster.
data = await obs.get_data(
"BTC/USDT",
"1d",
start_timestamp=1505606400,
profile_id=profile_id,
social_services=[] # disable social data fetching
)
# 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())