Initial commit of OHLC wrapper

This commit is contained in:
moshferatu 2024-10-19 07:13:12 -07:00
parent 60971082c2
commit 743f316b3a

9
ohlc/ohlc.py Normal file
View File

@ -0,0 +1,9 @@
from datetime import datetime
from iqfeed import get_daily_data, get_historical_data, minutes as to_minutes
def ohlc(symbol: str, minutes: int = None, start_date: datetime = None, end_date: datetime = None):
if minutes is None:
return get_daily_data(symbol, start_date, end_date or datetime.today())
else:
return get_historical_data(symbol, interval = to_minutes(minutes), start_date = start_date, end_date = end_date or datetime.today())