Example #1
0
        public DbPrivateExecution(BfProductCode productCode, BfaPrivateExecution exec)
        {
            ProductCode = productCode;
            ExecutionId = exec.ExecutionId;
            Side        = exec.Side;
            Price       = exec.Price;
            Size        = exec.Size;
            if (exec.Side == BfTradeSide.Sell)
            {
                Amount = (exec.Price * exec.Size).Truncate(productCode.GetPriceDecimals());
            }
            else
            {
                Amount = (exec.Price * exec.Size).Ceiling(productCode.GetPriceDecimals());
            }

            ChildOrderId           = exec.ChildOrderId;
            ChildOrderAcceptanceId = exec.ChildOrderAcceptanceId;

            Commission   = exec.Commission;
            ExecutedTime = exec.ExecutedTime;
        }
Example #2
0
        public DbPrivateExecution(BfProductCode productCode, BfChildOrderEvent coe)
        {
            ProductCode = productCode;
            ExecutionId = coe.ExecutionId;
            Side        = coe.Side;
            Price       = coe.Price;
            Size        = coe.Size;
            if (coe.Side == BfTradeSide.Sell)
            {
                Amount = (coe.Price * coe.Size).Truncate(productCode.GetPriceDecimals());
            }
            else
            {
                Amount = (coe.Price * coe.Size).Ceiling(productCode.GetPriceDecimals());
            }

            ChildOrderId           = coe.ChildOrderId;
            ChildOrderAcceptanceId = coe.ChildOrderAcceptanceId;

            Commission        = coe.Commission;
            ExecutedTime      = coe.EventDate;
            SwapForDifference = coe.SwapForDifference;
        }