Login Page - Create Account

DTC Protocol Discussion Forum


Date/Time: Fri, 29 Nov 2024 12:48:43 +0000



[Locked] - SubmitNewSingleOrder on binary encoding's IsParentOrder byte is 201 but I expected 197

View Count: 1795

[2022-01-12 00:52:56]
1+1=10 - Posts: 270
Hi SC Engineering,

For the SubmitNewSingleOrder binary message I expected IsParentOrder's byte to be 197 but found it was actually 201. I don't think it makes much difference to my trading but I wanted to make sure there's not an documented field. See why I expected 197 below:


    uint16_t Size; //0:
    uint16_t Type; //2:

    char Symbol[SYMBOL_LENGTH]; //4: + 64
    char Exchange[EXCHANGE_LENGTH]; //68: + 16

    char TradeAccount[TRADE_ACCOUNT_LENGTH]; //84: + 32
    char ClientOrderID[ORDER_ID_LENGTH]; //116: + 32

    OrderTypeEnum OrderType; //148: i32

    BuySellEnum BuySell; //152: i32

    double Price1; //160:
    double Price2; //168:
    double Quantity; //176:

    TimeInForceEnum TimeInForce; //184: i32

    t_DateTime GoodTillDateTime; //188: i64

    uint8_t IsAutomatedOrder; //196:

    uint8_t IsParentOrder; //197:

    char FreeFormText[ORDER_FREE_FORM_TEXT_LENGTH];


but it is actually:

    t_DateTime GoodTillDateTime; //188: i64

    uint8_t IsAutomatedOrder; //196 or 200 ??:

    uint8_t IsParentOrder; //201:

    char FreeFormText[ORDER_FREE_FORM_TEXT_LENGTH];
[2022-01-22 23:40:16]
DTC Engineering - Posts: 320
This relates to structure member alignment which for this structure is:

#pragma pack(push, 8)



Refer to:
https://docs.microsoft.com/en-us/cpp/build/reference/zp-struct-member-alignment?view=msvc-170
Date Time Of Last Edit: 2022-01-23 00:02:26
[2022-01-22 23:58:18]
1+1=10 - Posts: 270
Thanks for the response! I should have actually deleted this message as afterwards I learned you can’t get live CME data through DTC.

Anyway, I must have been confused about how uint8_t get aligned on #pragma pack(push, 8). I’ll read through the C++ docs and figure it out.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account