diff --git a/ohlc/ohlc.py b/ohlc/ohlc.py new file mode 100644 index 0000000..2246c32 --- /dev/null +++ b/ohlc/ohlc.py @@ -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()) \ No newline at end of file