Initial commit of OHLC wrapper
This commit is contained in:
parent
60971082c2
commit
743f316b3a
9
ohlc/ohlc.py
Normal file
9
ohlc/ohlc.py
Normal 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())
|
Loading…
Reference in New Issue
Block a user