Ejemplo n.º 1
0
 private void PriceGetter_timeChange(IPriceGetter priceGetter)
 {
     if (timeChange != null)
     {
         this.timeChange(priceGetter);
     }
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
             }
         }
     }
 }
Ejemplo n.º 5
0
 private void PriceGetter_timeChange(IPriceGetter priceGetter)
 {
     this.accountTrade.ChangeTime(1, priceGetter);
 }