public void CloneTest()
        {
            RawMarketData origin = new RawMarketData(KospiFutureUtil.Ins().KFI.Code, Detail.ProductType.KospiFuture);
            origin.BidCount1 = 10;

            RawMarketData target = origin.Clone() as RawMarketData;
            origin.BidCount1 = 20;

            Assert.AreNotEqual(origin.BidCount1, target.BidCount1);
            Assert.AreNotEqual(origin, target);
        }
Exemple #2
0
        public POrder(
            TradingDirection longShort, 
            String code, 
            long reqCount, 
            double reqPrice, 
            Account account,
            RawMarketData rmdClone,
            MarketType market,
            Boolean bWeakLongBlock)
        {
            this.LongShort = longShort;
            this.Code = code;
            this.ReqCount = reqCount;
            this.ReqPrice = reqPrice;
            this.TargetAccount = account;
            this.RMDClone = rmdClone.Clone() as RawMarketData; // 밖에서도 열심히 했겠지만 최종적으로 Clone을 저장하도록 한다.
            this.Market = market;
            this.IsWeakLongBlock = bWeakLongBlock;

            this.InitReqPrice = reqPrice;

            this.ContractedCount = 0;
            this.CanceledCount = 0;
            this.OrderNumber = -1;
            this.AvgContractPrice = 0;

            this.IsAllocatedYetRequestOrFree = true;

            this.CreatedTime = DateTime.Now;
            this.NoErrorOrderIn = false;
            this.Comment = "";

            this.ShortCutTargetOfContractCallBack = null;

            this.EarlyUpdatedLongBlockCount = 0;

            _bGotLastPacket = false;

            // dependency가 있음(SetMarketType, SetcodeNoTail, SetLongBlock)
            Boolean bSuccess1 = SetMarketType();
            Boolean bSuccess2 = SetCodeNoTail(bSuccess1);

            ConvertOverPriceToInRMDPriceIfNotZero();

            SetLongBlock(bSuccess2);

            POrderManager.Ins().Add(this);

            ValidateInput();
        }