Exemplo n.º 1
0
        private void SetItemPrice(CancelRedoItem item, SecurityItem secuItem, PriceType priceType)
        {
            var marketData = QuoteCenter2.Instance.GetMarketData(secuItem);

            item.EntrustPrice   = QuotePriceHelper.GetPrice(priceType, marketData);
            item.LastPrice      = marketData.CurrentPrice;
            item.LimitDownPrice = marketData.LowLimitPrice;
            item.LimitUpPrice   = marketData.HighLimitPrice;
        }
Exemplo n.º 2
0
        private CancelRedoItem Convert(EntrustSecurity p, Model.Database.TradeCommand tradeCommand)
        {
            CancelRedoItem cancelRedoItem = new CancelRedoItem
            {
                Selection        = true,
                CommandId        = tradeCommand.CommandId,
                EDirection       = p.EntrustDirection,
                EntrustPrice     = p.EntrustPrice,
                SecuCode         = p.SecuCode,
                SecuType         = p.SecuType,
                EntrustNo        = p.EntrustNo,
                ECommandPrice    = p.PriceType,
                ReportPrice      = p.EntrustPrice,
                EOriginPriceType = p.EntrustPriceType,
                LeftAmount       = p.EntrustAmount - p.TotalDealAmount,
                ReportAmount     = p.EntrustAmount,
                DealAmount       = p.TotalDealAmount,
                EntrustDate      = p.EntrustDate,
                SubmitId         = p.SubmitId,
                EntrustBatchNo   = p.BatchNo,
                PortfolioName    = tradeCommand.PortfolioName,
                FundName         = tradeCommand.AccountName,
            };

            cancelRedoItem.EntrustAmount = cancelRedoItem.LeftAmount;
            if (cancelRedoItem.SecuType == Model.SecurityInfo.SecurityType.Stock && cancelRedoItem.EDirection == EntrustDirection.BuySpot)
            {
                if (cancelRedoItem.LeftAmount % 100 > 0)
                {
                    cancelRedoItem.EntrustAmount = AmountRoundUtil.Round(cancelRedoItem.LeftAmount);
                }
            }

            var secuInfo = SecurityInfoManager.Instance.Get(p.SecuCode, p.SecuType);

            if (secuInfo != null)
            {
                cancelRedoItem.SecuName     = secuInfo.SecuName;
                cancelRedoItem.ExchangeCode = secuInfo.ExchangeCode;
            }
            else
            {
                cancelRedoItem.ExchangeCode = SecurityItemHelper.GetExchangeCode(p.SecuCode, p.SecuType);
            }

            return(cancelRedoItem);
        }
Exemplo n.º 3
0
 private void SetEntrustPriceType(CancelRedoItem cancelRedoItem, EntrustPriceType shPriceType, EntrustPriceType szPriceType)
 {
     //只有选择市价时设置市价委托方式
     if (cancelRedoItem.SecuType == SecurityType.Stock && cancelRedoItem.EPriceSetting == PriceType.Market)
     {
         if (Exchange.SHSE.Equals(cancelRedoItem.ExchangeCode))
         {
             cancelRedoItem.EEntrustPriceType = shPriceType;
         }
         else if (Exchange.SZSE.Equals(cancelRedoItem.ExchangeCode))
         {
             cancelRedoItem.EEntrustPriceType = szPriceType;
         }
         else
         {
             //do nothing
         }
     }
     else
     {
         cancelRedoItem.EEntrustPriceType = EntrustPriceType.FixedPrice;
     }
 }