//====================================================================== // From element of parent order // public DbChildOrder(BfParentOrderRequest req, BfParentOrderResponse resp, int childOrderIndex) { ProductCode = req.Parameters[childOrderIndex].ProductCode; Side = req.Parameters[childOrderIndex].Side; OrderType = req.Parameters[childOrderIndex].ConditionType; OrderSize = req.Parameters[childOrderIndex].Size; MinuteToExpire = req.MinuteToExpire; TimeInForce = req.TimeInForce; if (OrderType is BfOrderType.Limit or BfOrderType.StopLimit) { OrderPrice = req.Parameters[childOrderIndex].Price; } if (OrderType is BfOrderType.Stop or BfOrderType.StopLimit) { TriggerPrice = req.Parameters[childOrderIndex].TriggerPrice; } if (OrderType == BfOrderType.Trail) { Offset = req.Parameters[childOrderIndex].Offset; } ParentOrderAcceptanceId = resp.ParentOrderAcceptanceId; ChildOrderIndex = childOrderIndex; }
public override void OnParentOrderAccepted(BfParentOrderResponse response) { AcceptedTime = _market.ServerTime; OrderingStatus = RequestingState.Accepted; base.OnParentOrderAccepted(response); NotifyStateChanged(BfxOrderTransactionEventKind.OrderAccepted, AcceptedTime); }
public virtual void OnParentOrderAccepted(BfParentOrderResponse response) { _response = response; AcceptanceId = response.ParentOrderAcceptanceId; ParentOrderState = BfOrderState.Active; NotifyOrderChanged(); }
// Parent orders public void Insert(BfProductCode productCode, BfParentOrderRequest req, BfParentOrderResponse resp) { ParentOrders.Add(new DbParentOrder(productCode, req, resp)); for (int childOrderIndex = 0; childOrderIndex < req.Parameters.Count; childOrderIndex++) { ChildOrders.Add(new DbChildOrder(req, resp, childOrderIndex)); } }
public DbParentOrder(BfProductCode productCode, BfParentOrderRequest req, BfParentOrderResponse resp) { ProductCode = productCode; OrderType = req.OrderMethod; TimeInForce = req.TimeInForce; if (TimeInForce == BfTimeInForce.NotSpecified) { TimeInForce = BfTimeInForce.GTC; } AcceptanceId = resp.ParentOrderAcceptanceId; }
public void Update(BfParentOrderResponse response) { AcceptanceId = response.ParentOrderAcceptanceId; }
void IBfOrderSource.OpenParentOrder(BfParentOrderRequest req, BfParentOrderResponse resp) { }