Login Page - Create Account

Support Board


Date/Time: Mon, 21 Apr 2025 13:29:49 +0000



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

[2025-03-06 11:17:57]
User431178 - Posts: 651

result comes back as 4294958298

Docs say...

Returns: A return value > 0 indicates the order was successfully submitted. If the value is > 0, then this value indicates the quantity of the submitted order. If the return value is negative, < 0, the order submission was ignored.

The code submitted 1000 not 4294958298!

And no order is being placed?

And it should have fallen into this code block but it doesn't?

if(static_cast<int>(sc.BuyOrder(order)) > 0)

Weird stuff going on!



int result = static_cast<int>(sc.BuyOrder(order));

message.Format("error code: %u message: %s", result, sc.GetTradingErrorTextMessage(result));
sc.AddMessageToLog(message, 0);


error code: 4294958298 message: Order entry skipped because full recalculation

%u (unsigned int) is wrong in this case, should be %i or %d for signed int.
-8998 signed is same bit pattern as 4294958298 unsigned.




Thanks for pointing that out. The basic study code was able to place an order with a successful text tag.
But when the exact same code places an order from a class, the order has an empty text tag?

You have two test cases, one successful, one not, therefore they cannot be exactly the same, that is illogical.
Either there is an difference in the implementation of your class, or there is some subtle difference in what you are doing and/or what the called code is doing.

I am going to guess that the working test case was sending an order for the same symbol/account as the chart, whereas the non-working case was sending an order for a different symbol/account.
Why that yields a different outcome I don't know, as it doesn't seem to be explicitly documented, however it probably explains your problem (maybe you should ask SC engineering about it).