private void TEBCancelOrder(QuantConnect.Orders.Order order, int origClOrdID) { Content co = ContentFactory.Create(); co.ClientStatus = ContentClientStatus.PendingCancel; co.ClOrdID = NextClientID().ToString(); co.OrigClOrdID = origClOrdID.ToString(); //co.OrderID = Order.OrderID; co.TransactTime = DateTime.Now; co.Symbol = order.Symbol; //co.SymbolSfx = Order.SymbolSfx; co.OrdType = convertHelper.ConvertToOrdType(order.Type); co.TimeInForce = convertHelper.ConvertToTimeInForce(order.Duration); co.Price = order.Price; co.OrderQty = order.Quantity; co.Side = convertHelper.ConvertToSide(order.Quantity); //co.ExpireDate = Order.ExpireDate; //co.Afe = Order.Afe; //co.Kafe = Order.Kafe; //co.IsSellShort = Order.IsSellShort; co.SecurityType = CashDefinition.SECURITY_CASH; //co.InstructionSource = Order.InstructionSource; //co.MarketSource = Order.MarketSource; //co.PartyID = Order.PartyID; co.SenderSubID = _senderSubId; }
/// <summary> /// Creates a new page model using the given page type id. /// </summary> /// <param name="api">The current api</param> /// <param name="typeId">The unique page type id</param> /// <returns>The new model</returns> public static T Create(IApi api, string typeId = null) { if (string.IsNullOrWhiteSpace(typeId)) { typeId = typeof(T).Name; } using (var factory = new ContentFactory(api.PageTypes.GetAll())) { return(factory.Create <T>(typeId)); } }
private void createContent() { if (_entryVolume.Content != null) { throw new InvalidOperationException(); } if (ContentData == null) { return; } Content content = _factory.Create(_entryVolume.Data); content.Base.SetParent(_hook, false); content.Base.localScale = Vector3.one; _entryVolume.Content = content; }
private Content CreateContent(QuantConnect.Orders.Order order, int clOrdId) { Content content = ContentFactory.Create(); content.ServerStatus = ContentServerStatus.Waiting; content.ClientStatus = ContentClientStatus.PendingNew; content.TransactTime = DateTime.Now; content.ClOrdID = clOrdId.ToString(); content.MarketID = clOrdId.ToString(); content.Side = convertHelper.ConvertToSide(order.Quantity); //content.IsSellShort = builder.IsSellShort; content.OrdType = convertHelper.ConvertToOrdType(order.Type); content.Account = _account; content.OrderCapacity = CashDefinition.ACCOUNT_TYPE_CUSTOMER; content.SenderSubID = _senderSubId; content.Symbol = order.Symbol; //content.SymbolSfxMarket = builder.Market.Value.Trim(); content.OrderQty = Math.Abs(order.Quantity); if (order is LimitOrder) { decimal limitPrice = (decimal)((LimitOrder)order).LimitPrice; content.Price = limitPrice; } else { content.Price = order.Price; } content.TransactTime = order.Time; content.OrderQty = Math.Abs(order.Quantity); content.TimeInForce = convertHelper.ConvertToTimeInForce(order.Type); content.SecurityType = CashDefinition.SECURITY_CASH; return(content); }
/// <summary> /// Creates a new block model using the given block type id. /// </summary> /// <param name="typeId">The unique block type id</param> /// <returns>The new model</returns> public static T Create(string typeId) { using (var factory = new ContentFactory(App.BlockTypes)) { return(factory.Create <T>(typeId)); } }