Example #1
0
    def get_bar_data_available(self) -> List[Dict]:
        """"""
        data = database_manager.get_bar_data_statistics()

        for d in data:
            oldest_bar = database_manager.get_oldest_bar_data(
                d["symbol"], Exchange(d["exchange"]), Interval(d["interval"]))
            d["start"] = oldest_bar.datetime

            newest_bar = database_manager.get_newest_bar_data(
                d["symbol"], Exchange(d["exchange"]), Interval(d["interval"]))
            d["end"] = newest_bar.datetime

        return data
Example #2
0
    def __init_tradeDay(self,start:datetime,end:datetime):

        code = TRAY_DAY_SIMBOL

        db_bar_start = database_manager.get_oldest_bar_data(code,Exchange.SSE,Interval.DAILY)
        db_bar_end = database_manager.get_newest_bar_data(code,Exchange.SSE,Interval.DAILY)

        print(f"StrategyBridage: __init_tradeDay(), start={start},end={end}")

        if((not db_bar_start is None ) and (not db_bar_end is None)):
            if(start >= db_bar_start.datetime and end <= db_bar_end.datetime):
                return

        print(f"StrategyBridage: __init_tradeDay(), update tradeDay!!!!")
        database_manager.delete_bar_data(code,Exchange.SSE,Interval.DAILY)

        start = start - timedelta(days=15)
        end = end + timedelta(days=15)
        save_tradeday_from_jqdata(start,end)