Exemple #1
0
 /// <summary>
 /// 创建资金计算器。
 /// </summary>
 private void CreateFundCalculator()
 {
     try
     {
         FundCalculator fundCalculator = new FundCalculator();
         m_fundCalculator = fundCalculator;
         string text = String.Format("{0} Create {1} OK.", this, fundCalculator);
         m_eventLogger.WriteInformation(text);
     }
     catch (Exception ex)
     {
         string text = "Create FundCalculator object failed, " + ex.Message;
         throw new ApplicationException(text, ex);
     }
 }
        private void QueryAndUpdate(object state)
        {
            FundCalculator calculator = USeManager.Instance.FundCalculator;

            try
            {
                USeFundDetail fundDetail = calculator.FundDetail;
                decimal       aribtrageOrderUseMargin = USeManager.Instance.AutoTraderManager.CalculatUseMargin();

                UpDateAccountInfo(fundDetail, aribtrageOrderUseMargin);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
            m_updateTimer.Change(500, Timeout.Infinite);
        }