progress
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlite3
|
||||
from typing import Dict, List, cast
|
||||
from typing import Any, Dict, List, Tuple, cast
|
||||
import pandas as pd
|
||||
|
||||
from cvttpy_trading.trading.instrument import ExchangeInstrument
|
||||
|
||||
def load_sqlite_to_dataframe(db_path:str, query:str) -> pd.DataFrame:
|
||||
df: pd.DataFrame = pd.DataFrame()
|
||||
@@ -45,19 +46,17 @@ def convert_time_to_UTC(value: str, timezone: str, extra_minutes: int = 0) -> st
|
||||
|
||||
def load_market_data(
|
||||
datafile: str,
|
||||
instruments: List[Dict[str, str]],
|
||||
instruments: List[ExchangeInstrument],
|
||||
db_table_name: str,
|
||||
trading_hours: Dict = {},
|
||||
extra_minutes: int = 0,
|
||||
) -> pd.DataFrame:
|
||||
|
||||
insts = [
|
||||
'"' + instrument["instrument_id_pfx"] + instrument["symbol"] + '"'
|
||||
for instrument in instruments
|
||||
]
|
||||
instrument_ids = list(set(insts))
|
||||
|
||||
inst_ids = ['"' + exch_inst.instrument_id() + '"' for exch_inst in instruments]
|
||||
instrument_ids = list(set(inst_ids))
|
||||
exchange_ids = list(
|
||||
set(['"' + instrument["exchange_id"] + '"' for instrument in instruments])
|
||||
set(['"' + instrument.exchange_id() + '"' for instrument in instruments])
|
||||
)
|
||||
|
||||
query = "select"
|
||||
|
||||
Reference in New Issue
Block a user