private bool ShouldOrdersAutoFill(Transaction tran) { DealingPolicyPayload dealingPolicyDetail = tran.DealingPolicyPayload(); foreach (Order eachOrder in tran.Orders) { if (eachOrder.Phase != OrderPhase.Placed || eachOrder.Lot > dealingPolicyDetail.AutoDQMaxLot) { Logger.WarnFormat("check CanOrderAutoFill failed, order.phase = {0}, order.lot = {1}, autoDQMaxLot = {2}, tranId = {3}", eachOrder.Phase, eachOrder.Lot, dealingPolicyDetail.AutoDQMaxLot, tran.Id); return(false); } } return(true); }
internal virtual bool CanAutoAcceptPlace() { DealingPolicyPayload dealingPolicyDetail = this.DealingPolicyPayload(); bool result = (this.OrderType == OrderType.SpotTrade || this.OrderType == OrderType.Market || this.OrderType == OrderType.Risk || this.OrderType == OrderType.MultipleClose || this.OrderType == OrderType.MarketOnClose || this.OrderType == OrderType.MarketOnOpen || this.Type == TransactionType.Assign || this.Type == TransactionType.MultipleClose || this.SubType == TransactionSubType.Mapping || this.GetLotForAutoJudgment() <= dealingPolicyDetail.AutoAcceptMaxLot); if (!result) { Logger.WarnFormat("CanAutoAcceptPlace = false, orderType = {0}, subType = {1}, GetLotForAutoJudgment = {2}, AutoAcceptMaxLot = {3}", this.OrderType, this.SubType, this.GetLotForAutoJudgment(), dealingPolicyDetail.AutoAcceptMaxLot); } return(result); }