Login Page - Create Account

Market Depth Data File Structures Used

The market depth data file header file is as follows.

struct s_Header
{
    //--- Static Members ---------------------------------------------

    // This is the minimum number of bytes that must be read in order
    // to verify the file as a depth file and read in the rest of the
    // header.
    static const int MINIMAL_HEADER_SIZE = 16;

    static const uint32_t UNIQUE_HEADER_ID = 0x44444353;  // "SCDD"

    //--- Members ----------------------------------------------------

    uint32_t FileTypeUniqueHeaderID;  // "SCDD"
    uint32_t HeaderSize;
    uint32_t RecordSize;
    uint32_t Version;

    char Reserve[48];

    //--- Methods ----------------------------------------------------

    s_Header()
    : FileTypeUniqueHeaderID(UNIQUE_HEADER_ID)
    , HeaderSize(sizeof(s_Header))
    , RecordSize(sizeof(s_Record))
    , Version(1)
    {
        memset(Reserve, 0, sizeof(Reserve));
    }

};
    

The market depth data file record structure is as follows

struct s_Record
{

    //--- Types ------------------------------------------------------

    enum CommandEnum : t_Byte
    { NO_COMMAND = 0
    , COMMAND_CLEAR_BOOK = 1
    , COMMAND_ADD_BID_LEVEL = 2
    , COMMAND_ADD_ASK_LEVEL = 3
    , COMMAND_MODIFY_BID_LEVEL = 4
    , COMMAND_MODIFY_ASK_LEVEL = 5
    , COMMAND_DELETE_BID_LEVEL = 6
    , COMMAND_DELETE_ASK_LEVEL = 7
    };

    //--- Members ----------------------------------------------------

    double DateTime;

    CommandEnum Command;
    t_Byte Reserved1;  // Not used, but needed for byte padding.
    uint16_t Reserved2;  // reserved for NumberOfOrders

    float Price;
    uint32_t Quantity;
    uint32_t Reserved3;  // Not used, but exists due to byte padding.

    //--- Methods ----------------------------------------------------

    s_Record()
    : DateTime(0.0)
    , Command(NO_COMMAND)
    , Reserved1(0)
    , Reserved2(0)
    , Price(0.0f)
    , Quantity(0)
    , Reserved3(0)
    {

    }

};
    

*Last modified Wednesday, 01st May, 2019.