예제 #1
0
		internal SeriesSymbolData(InstrumentDataRequest dataRequest, InstrumentSettings settings = null) {
			this.Indexer = new SeriesIndexer();
			__cDataRequest = dataRequest;
			__cSettings = ((settings == null) ? new InstrumentSettings(ref __cDataRequest) : settings.Create(ref __cDataRequest));
			__cUpdateTime = DateTime.UtcNow.AddHours(__cSettings.TimeZone);
			
			SessionObject cSession = __cSettings.GetSessionFromToday();
			__iRealtimeCount = (int) ((cSession.GetCloseTimeForDaylight() - cSession.GetStartTimeForDaylight()).TotalSeconds / dataRequest.Resolution.TotalSeconds + 1);

			Indexer.HistoryIndex = 0;
			Indexer.RealtimeIndex = -1;

			__cOpens = new Series<double>(__iRealtimeCount);
			__cOpens.onRequest += Series_onRequest;

			__cHighs = new Series<double>(__iRealtimeCount);
			__cHighs.onRequest += Series_onRequest;

			__cLows = new Series<double>(__iRealtimeCount);
			__cLows.onRequest += Series_onRequest;

			__cCloses = new Series<double>(__iRealtimeCount);
			__cCloses.onRequest += Series_onRequest;

			__cTimes = new Series<DateTime>(__iRealtimeCount);
			__cTimes.onRequest += Series_onRequest;

			__cVolumes = new Series<double>(__iRealtimeCount);
			__cVolumes.onRequest += Series_onRequest;

			__cDataRequest.Range.Count = 0;  //將資料筆數設定為0(因為一開始沒有請求任何資訊)
		}