Example #1
0
 public DataReader(string dataCenterUri)
 {
     this.dataStore           = DataStoreFactory.CreateDataStore(dataCenterUri);
     this.codeReader          = new CodeReader(dataStore.CreateInstrumentStore());
     this.tradingDayReader    = new CacheUtils_TradingDay(dataStore.CreateTradingDayStore().Load());
     this.tradingSessionStore = dataStore.CreateTradingSessionStore();
     this.tradingTimeStore    = dataStore.CreateTradingTimeStore();
     this.tickDataReader      = new TickDataReader(dataStore, this);
     this.klineDataReader     = new KLineDataReader(dataStore, this);
     this.timeLineDataReader  = new TimeLineDataReader(this);
     this.mainContractReader  = new MainContractReader(dataStore);
 }
Example #2
0
        private void TestTradingSessionSaveLoad(string uri)
        {
            string               code      = "M05";
            IDataStore           dataStore = DataStoreFactory.CreateDataStore(uri);
            ITradingSessionStore store     = dataStore.CreateTradingSessionStore();

            try
            {
                List <TradingSession> codes = MockDataLoader.GetTradingSessions(code);
                store.Save(code, codes);
                List <TradingSession> codes2 = store.Load(code);
                AssertUtils.AssertEqual_List_ToString(codes, codes2);
            }
            finally
            {
                store.Delete(code);
            }
        }
Example #3
0
 public TradingSessionReader(string code, ITradingSessionStore tradingSessionStore)
 {
     this.code = code;
     this.tradingSessionStore = tradingSessionStore;
     this.cache = new CacheUtils_TradingSession(code, tradingSessionStore.Load(code));
 }
 public Step_UpdateTradingSession_Instrument(string code, IPlugin_HistoryData historyData, IDataStore dataStore)
 {
     this.code                = code;
     this.historyData         = historyData;
     this.tradingSessionStore = dataStore.CreateTradingSessionStore();
 }