示例#1
0
 private void PriceGetter_timeChange(IPriceGetter priceGetter)
 {
     if (timeChange != null)
     {
         this.timeChange(priceGetter);
     }
 }
示例#2
0
文件: Account.cs 项目: wanwei/sc2
 public Account(string accountId, double money, IDataForward_Code historyDataForward_Code)
 {
     this.accountId               = accountId;
     this.accountTrade            = new AccountTrade(money);
     this.priceGetter             = new PriceGetter_HistoryDataForward_Code(historyDataForward_Code);
     this.priceGetter.timeChange += PriceGetter_timeChange;
 }
示例#3
0
        public PriceGetter_HistoryDataForward_Code(IDataForward_Code historyDataForward_Code)
        {
            if (historyDataForward_Code.ForwardPeriod.IsTickForward)
            {
                this.priceGetter = new PriceGetter_HistoryDataForward_Code_Tick(historyDataForward_Code);
            }
            else
            {
                this.priceGetter = new PriceGetter_HistoryDataForward_Code_KLine(historyDataForward_Code);
            }

            this.priceGetter.timeChange += PriceGetter_timeChange;
        }
示例#4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="priceGetter"></param>
 public void ChangeTime(double time, IPriceGetter priceGetter)
 {
     lock (lockObj)
     {
         List <OrderInfo> orders = accountOrder.TodayOrderInfos;
         for (int i = 0; i < orders.Count; i++)
         {
             OrderInfo order = orders[i];
             string    code  = order.Instrumentid;
             int       mount = accountOrder.CalcOrder(order, priceGetter.GetBuyPrice(code), priceGetter.GetBuyMount(code));
             if (mount > 0)
             {
                 accountPosition.SendPosition(order, mount);
             }
         }
     }
 }
示例#5
0
文件: Account.cs 项目: wanwei/sc2
 private void PriceGetter_timeChange(IPriceGetter priceGetter)
 {
     this.accountTrade.ChangeTime(1, priceGetter);
 }