CoolFace
Apppublic

kaan1233/bistelligence-api

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes
test_bt_script.py20 linesDownload Raw Back to root
1import asyncio2from data_fetcher import fetch_stock_data3from backtester import run_backtest4 5# Fetch data for THYAO.IS6data = fetch_stock_data(["THYAO.IS"], period="2y")7 8gen = run_backtest(data, ["THYAO.IS"], 400, 50)9for item in gen:10    if item["type"] == "result":11        print("RESULT:")12        print(item["data"]["status"])13        if item["data"]["status"] == "error":14            print(item["data"]["message"])15        else:16            print("Summary:", item["data"].get("summary"))17            print("Trades:", len(item["data"].get("recent_trades", [])))18    else:19        print(item)20