Login Page - Create Account

Support Board


Date/Time: Mon, 21 Apr 2025 16:54:03 +0000



Post From: How to attached a custom name to an order using s_SCNewOrder::TextTag?

[2025-03-05 17:08:11]
LTSys - Posts: 68
Are you sending attached orders? If you are, the Trade Management may be overwriting it.

Here is my order code...


  s_SCNewOrder order;
  
  order.OrderType = SCT_ORDERTYPE_MARKET;
  order.TimeInForce = SCT_TIF_GOOD_TILL_CANCELED;
  order.TradeAccount = "Sim1";
  order.Symbol = "EURUSD";
  order.OrderQuantity = 1000;  

  order.Stop1Price = ask - (100 * tick);
  order.Target1Price = ask + (100 * tick)  
  
  order.TextTag.Format("Buy Order %u", count);

  sc.BuyOrder(order);

I did what you suggested and made the code like this..


  sc.TradeWindowConfigFileName = SCString("");

  s_SCNewOrder order;
  
  order.OrderType = SCT_ORDERTYPE_MARKET;
  order.TimeInForce = SCT_TIF_GOOD_TILL_CANCELED;
  order.TradeAccount = "Sim1";
  order.Symbol = "EURUSD";
  order.OrderQuantity = 1000;  

  //order.AttachedOrderConfiguration = 0; // error C2039: 'AttachedOrderConfiguration': is not a member of 's_SCNewOrder'
  
  order.TextTag.Format("Buy Order %u", count);

  sc.BuyOrder(order);

But still no text tag with the value set... I'm looking in the Trade Orders Window to see if its set and the code also loops through all orders and prints the text tag but they are all empty string values.
Date Time Of Last Edit: 2025-03-05 19:47:52