Пример #1
0
 public DailyQuoteStorage()
 {
     try
     {
         quoteStorage = TradeSharp.Contract.Util.Proxy.QuoteStorage.Instance.proxy;
     }
     catch (Exception ex)
     {
         Logger.Error("Связь с сервером (IQuoteStorageBinding) не установлена", ex);
         throw;
     }
     quoteHistoryOnServer = new ServerQuoteHistory(quoteStorage);
     try
     {
         if (!Directory.Exists(quoteFolder))
         {
             Directory.CreateDirectory(quoteFolder);
         }
     }
     catch (Exception ex)
     {
         Logger.Error("Ошибка создания каталога " + quoteFolder, ex);
         throw;
     }
 }
Пример #2
0
 public QuoteProcessor(
     IQuoteDataProvider quoteDataProvider,
     IQuoteParser quoteParser,
     IQuoteStorage quoteStorage)
 {
     _quoteDataProvider = quoteDataProvider;
     _quoteParser       = quoteParser;
     _quoteStorage      = quoteStorage;
 }
Пример #3
0
 static ChartForm()
 {
     try
     {
         quoteStorage = QuoteStorage.Instance.proxy;
     }
     catch (Exception)
     {
         Logger.Error("Связь с сервером (IQuoteStorageBinding) не установлена");
     }
 }
Пример #4
0
 static ChartForm()
 {
     try
     {
         quoteStorage = QuoteStorage.Instance.proxy;
     }
     catch (Exception)
     {
         Logger.Error("Связь с сервером (IQuoteStorageBinding) не установлена");
     }
 }
Пример #5
0
        private TickerStorage()
        {
            quotesFolder = ExecutablePath.ExecPath + "\\quotes";
            try
            {
                quoteStorage = Contract.Util.Proxy.QuoteStorage.Instance.proxy;
            }
            catch
            {
                Logger.Error("Связь с сервером (IQuoteStorageBinding) не установлена");
                return;
            }

            serverQuoteHistory = new ServerQuoteHistory(quoteStorage);
        }
        public MakeCandlesFromBidAskForm()
        {
            InitializeComponent();
            try
            {
                quoteStorage = Contract.Util.Proxy.QuoteStorage.Instance.proxy;
            }
            catch
            {
                Logger.Error("Связь с сервером (IQuoteStorageBinding) не установлена");
                return;
            }

            histOnServer = quoteStorage.GetTickersHistoryStarts();
        }
        public MakeCandlesFromBidAskForm()
        {
            InitializeComponent();
            try
            {
                quoteStorage = Contract.Util.Proxy.QuoteStorage.Instance.proxy;
            }
            catch
            {
                Logger.Error("Связь с сервером (IQuoteStorageBinding) не установлена");
                return;
            }

            histOnServer = quoteStorage.GetTickersHistoryStarts();
        }
Пример #8
0
 private QuoteStorage(IQuoteStorage proxyOrStub = null)
 {
     if (proxyOrStub != null)
     {
         proxy = proxyOrStub;
         return;
     }
     try
     {
         proxy = new QuoteStorageProxy(BindingName);
     }
     catch (Exception ex)
     {
         Logger.Error("QuoteStorage ctor", ex);
     }
 }
Пример #9
0
		/// <summary>
		///   建構子
		/// </summary>
		/// <param name="source">SeriesSymbolData 商品資料類別</param>
		/// <param name="request">資料請求結構</param>
		internal SeriesSymbolDataRand(SeriesSymbolData source, InstrumentDataRequest request) {
			__cSource = source;
			__cSource.onRequestCompleted += SeriesSymbolData_onRequestCompleted;  //附掛請求歷史資料完成的事件通知

			__cIndexer = source.Indexer;
			__iBaseAdjustTotal = __cIndexer.AdjustTotalCount;
			source.Clone(out __cTimes, out __cOpens, out __cHighs, out __cLows, out __cCloses, out __cVolumes);

			__iHistoryIndex = __cCloses.Count - (request.Range.Count + source.RealtimeCount);
			this.Current = 1;  //預設值索引從 1 開始(內部會自動計算對應至 SeriesSymbolData 序列資料的正確索引位置)

			string sDataSource = source.DataRequest.DataFeed;
			AbstractQuoteService cService = QuoteManager.Manager.GetQuoteService(sDataSource);
			if (cService != null) {
				__cQuoteStorage = cService.Storage;
			}
		}
        private void AutoUploadHistoryTickersFormLoad(object sender, EventArgs e)
        {
            try
            {
                quoteStorage = QuoteStorage.Instance.proxy;
            }
            catch (Exception)
            {
                Logger.Error("Связь с сервером (IQuoteStorageBinding) не установлена");
                tbProgress.Text = "Невозможно установить связь с сервером котировок";
                return;
            }

            tbProgress.Clear();
            // в бэкграунде стартовать поток чтения
            worker.RunWorkerAsync();
        }
Пример #11
0
 private void RenewFactory()
 {
     try
     {
         if (factory != null)
         {
             factory.Abort();
         }
         factory = new ChannelFactory <IQuoteStorage>(endpointName);
         channel = factory.CreateChannel();
     }
     catch (Exception ex)
     {
         Logger.Error("QuoteStorageProxy: невозможно создать прокси", ex);
         channel = null;
     }
 }
Пример #12
0
 public DailyQuoteStorage()
 {
     try
     {
         quoteStorage = TradeSharp.Contract.Util.Proxy.QuoteStorage.Instance.proxy;
     }
     catch (Exception ex)
     {
         Logger.Error("Связь с сервером (IQuoteStorageBinding) не установлена", ex);
         throw;
     }
     quoteHistoryOnServer = new ServerQuoteHistory(quoteStorage);
     try
     {
         if (!Directory.Exists(quoteFolder))
             Directory.CreateDirectory(quoteFolder);
     }
     catch (Exception ex)
     {
         Logger.Error("Ошибка создания каталога " + quoteFolder, ex);
         throw;
     }
 }
Пример #13
0
        private void frmTrustViewer_Shown(object sender, System.EventArgs e)
        {
            AbstractQuoteService cService = QuoteManager.Manager.GetQuoteService(__sDataSource);

            if (cService != null)
            {
                __cStorage = cService.Storage;

                IQuote cQuote = cService.Storage.GetQuote(__sSymbolId);
                if (cQuote != null)
                {
                    __cTimer           = new System.Timers.Timer(100);
                    __cTimer.AutoReset = false;
                    __cTimer.Elapsed  += Timer_onElapsed;

                    cService.onQuote += QuoteService_onQuote;

                    TrustUpdate();
                    RefreshGrid();
                }
            }

            this.Focus();
        }
Пример #14
0
 public ServerQuoteHistory(IQuoteStorage quoteStorage)
 {
     this.quoteStorage = quoteStorage;
 }
Пример #15
0
 public static void Initialize(IQuoteStorage proxyOrStub)
 {
     instance = new QuoteStorage(proxyOrStub);
 }
Пример #16
0
 public static void InitializeFake(IQuoteStorage chan)
 {
     fakeChannel = chan;
 }
Пример #17
0
 public ServerQuoteHistory(IQuoteStorage quoteStorage)
 {
     this.quoteStorage = quoteStorage;
 }
Пример #18
0
 private void RenewFactory()
 {
     try
     {
         if (factory != null) factory.Abort();
         factory = new ChannelFactory<IQuoteStorage>(endpointName);
         channel = factory.CreateChannel();
     }
     catch (Exception ex)
     {
         Logger.Error("QuoteStorageProxy: невозможно создать прокси", ex);
         channel = null;
     }
 }
Пример #19
0
		/// <summary>
		///   建構子
		/// </summary>
		/// <param name="source">SeriesSymbolData 類別</param>
		/// <param name="maxBarsReferance">最大 Bars count 參考值(如果不需要很多歷史資訊計算則可以設定小一點, 設定數量不可以超過歷史資料載入總數量)</param>
		public Instrument(SeriesSymbolData source, int maxBarsReferance) {
			__cSource = source;
			__cFullSymbolData = new SeriesSymbolDataRand(source, maxBarsReferance);

			this.CurrentBar = 1;  //預設值
			string sDataSource = __cSource.DataRequest.DataFeed;
			
			AbstractQuoteService cService = QuoteManager.Manager.GetQuoteService(sDataSource);
			if (cService != null) {
				__cQuoteStorage = cService.Storage;
			}
		}
Пример #20
0
 public static void InitializeFake(IQuoteStorage chan)
 {
     fakeChannel = chan;
 }