refactor(client): use models for TickerOHLCV and include ticker in OHLCV

This commit is contained in:
Giulio De Pasquale 2025-10-18 09:27:19 +01:00
parent 35de3b208c
commit 4fb70813e6

View File

@ -1,6 +1,6 @@
from datetime import datetime, timedelta from datetime import datetime, timedelta
from .taapi import TaapiClient from .taapi import TaapiClient
from .data import TickerOHLCV from .models import TickerOHLCV
import yfinance as yf import yfinance as yf
import pandas as pd import pandas as pd
@ -61,6 +61,7 @@ class Client:
avg = (high + low) / 2.0 avg = (high + low) / 2.0
return TickerOHLCV( return TickerOHLCV(
ticker=ticker,
date=date, date=date,
open=round(open_price, 2), open=round(open_price, 2),
high=round(high, 2), high=round(high, 2),