/// <summary> /// Triggered when a list of Orders is received during a order download initiated as a result /// of calling the subscription's Start method /// </summary> void tradeSubscription_OrderBookDownload(object sender, OrderBookDownloadEventArgs e) { foreach (Order order in e.Orders) { UpdateAuditLog("OrderBookDownload", order); } }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> Event notification for order book download complete. </summary> //////////////////////////////////////////////////////////////////////////////////////////////////// void m_algoTradeSubscription_OrderBookDownload(object sender, OrderBookDownloadEventArgs e) { Console.WriteLine("Orderbook downloaded..."); // Start Algo Trading thread. Thread algoThread = new Thread(() => this.StartAlgo()); algoThread.Name = "Algo Trading Thread"; algoThread.Start(); }
/// <summary> /// Triggered when a list of Orders is received during a order download initiated as a result /// of calling the subscription's Start method /// </summary> void tradeSubscription_OrderBookDownload(object sender, OrderBookDownloadEventArgs e) { foreach (Order order in e.Orders) UpdateAuditLog("OrderBookDownload", order); }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> Event notification for order book download complete. </summary> //////////////////////////////////////////////////////////////////////////////////////////////////// void m_instrumentTradeSubscription_OrderBookDownload(object sender, OrderBookDownloadEventArgs e) { Console.WriteLine("Orderbook downloaded..."); m_isOrderBookDownloaded = true; }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> Event notification for order book download complete. </summary> //////////////////////////////////////////////////////////////////////////////////////////////////// void m_algoTradeSubscription_OrderBookDownload(object sender, OrderBookDownloadEventArgs e) { Console.WriteLine("Orderbook downloaded..."); //To retrieve the list of parameters valid for the Algo you can call //algo.AlgoParameters; //For an Iceberg Synthetic order here is the list of parameters you can set. /*************************************************************************** * Strategy: TT_Iceberg *************************************************************************** * ---------------------------------------------------------------------------------------------- * ORDER PROFILE PROPERTIES * Name Type Required Updateable * ---------------------------------------------------------------------------------------------- * OrderInstrumentID true false * OrderQty true true * OrderSide true false * OrderAccount true false * OrderType true false * LimitPrice true true * * * ---------------------------------------------------------------------------------------------------------------------- * USER PARAMETER PROPERTIES * Name Type Required Updateable Algo Specific Enum * ----------------------------------------------------------------------------------------------------------------------- * ChildTIF Int_t true false * ParentTIF Int_t true false tt_net_sdk.tt_iceberg.ParentTIF * DiscVal Qty_t true true * DiscValType Int_t true true tt_net_sdk.tt_iceberg.DiscValType * Variance Int_t false false * LimitTicksAway Int_t false true * LimitPriceType Int_t false false tt_net_sdk.tt_iceberg.LimitPriceType * TriggerType Int_t false false tt_net_sdk.tt_iceberg.TriggerType * TriggerPriceType Int_t false false tt_net_sdk.tt_iceberg.TriggerPriceType * IsTrlTrg Boolean_t false false * TriggerTicksAway Int_t false true * WithATickType Int_t false false tt_net_sdk.tt_iceberg.WithATickType * WithATick Qty_t false true * STime UTCTimestamp_t false true * ETime UTCTimestamp_t false true * ETimeAct Int_t false false tt_net_sdk.tt_iceberg.ETimeAct * AutoResubExpiredGTD Boolean_t false false * ----------------------------------------------------------------------------------------------------------------------- */ // Get the accounts m_accounts = m_api.Accounts; //Construct a dictionary of the parameters and the values to send out Dictionary <string, object> iceberg_userparams = new Dictionary <string, object> { { "DiscVal", 5 }, { "DiscValType", tt_net_sdk.tt_iceberg.DiscValType.Qty }, { "ChildTIF", tt_net_sdk.TimeInForce.Day }, { "ParentTIF", tt_net_sdk.tt_iceberg.ParentTIF.Day }, { "ETimeAct", tt_net_sdk.tt_iceberg.ETimeAct.Cancel }, { "STime", EpochTimeUtc(30) }, { "ETime", EpochTimeUtc(60) }, }; var lines = iceberg_userparams.Select(kvp => kvp.Key + ": " + kvp.Value.ToString()); Console.WriteLine(string.Join(Environment.NewLine, lines)); OrderProfile iceberg_op = m_algo.GetOrderProfile(m_instrument); iceberg_op.LimitPrice = m_price; if (m_accounts.Count > 0) { iceberg_op.Account = m_accounts.ElementAt(0); } iceberg_op.Side = OrderSide.Buy; iceberg_op.OrderType = OrderType.Limit; iceberg_op.OrderQuantity = Quantity.FromDecimal(m_instrument, 10); iceberg_op.TimeInForce = TimeInForce.Day; iceberg_op.UserParameters = iceberg_userparams; iceberg_op.UserTag = "IcebergAlgoUsertag"; iceberg_op.OrderTag = "IcebergAlgoOrderTag"; m_algoTradeSubscription.SendOrder(iceberg_op); }
void ts_OrderBookDownload(object sender, OrderBookDownloadEventArgs e) { //Console.WriteLine("OrderBookDownload"); }
void ts_OrderBookDownload(object sender, OrderBookDownloadEventArgs e) { //processOrder(TTOrderStatus.Added, e.Orders); }
private void OnOrderBookDownload(object sender, OrderBookDownloadEventArgs e) { lblStatus.Text = "Running"; }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> Event notification for order book download complete. </summary> //////////////////////////////////////////////////////////////////////////////////////////////////// void m_algoTradeSubscription_OrderBookDownload(object sender, OrderBookDownloadEventArgs e) { Console.WriteLine("Orderbook downloaded..."); }