Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undocumented struct fields Symbol.sunday etc. #4

Open
dexter4life opened this issue Apr 12, 2020 · 4 comments
Open

Undocumented struct fields Symbol.sunday etc. #4

dexter4life opened this issue Apr 12, 2020 · 4 comments
Assignees
Labels

Comments

@dexter4life
Copy link

dexter4life commented Apr 12, 2020

the first 8 bytes represent the first trade time and last trade time.

reference: Symbol.sunday

@rosasurfer
Copy link
Owner

rosasurfer commented Apr 12, 2020

Thank you for you comment. Until now I didn't take the time to investigate these parts but I realized that all the trade session times are encoded there (thus the field names). A day can hold a list of trade sessions, as can be seen under MarketWatch -> Symbols -> Properties. Will update this part soon.

@rosasurfer rosasurfer changed the title starting from here BYTE sunday [208]; in the symbols.raw structure Undocumented struct fields Symbol.sunday etc. Apr 12, 2020
@rosasurfer rosasurfer self-assigned this Apr 12, 2020
@dexter4life
Copy link
Author

okay, and just to assist you further, the first session of that Sunday category is 100byte for quotes and 100 bytes for trades respectively. And then after is the weekdays, so Monday is takes 104bytes and then trades for Monday takes 104 bytes too. Then at the end is Saturday, which ends also as 100bytes and trades for Saturday is 100bytes also. this gave me the complete settings as seen on the screenshot
image

@dexter4life
Copy link
Author

dexter4life commented Apr 12, 2020

So for weekdays Sunday and Saturday is done this way

#pragma pack(push, 1)
struct Sunday {
	UINT64 time1;

	UINT64 time2;
	UINT64 time3;
	UINT64 time4;
	UINT64 time5;
	
	UINT64 time6;
	UINT64 time7;
	UINT64 time8;
	UINT64 time9;
	
	UINT64 time10;
	UINT64 time11;
	UINT64 time12;
	UINT32 time13;
};
#pragma pack(pop)

@dexter4life
Copy link
Author

#pragma pack(push, 1)
struct SYMBOL_SELECTED {                            // -- offset ---- size --- description -----------------------------------
    char     symbol[MAX_SYMBOL_LENGTH + 1];         //         0        12     symbol (szchar)
    uint     digits;                                //        12         4     digits

    uint     arrayKey;                              //        16         4     = SYMBOL.arrayKey (@see "symbols.raw")
    DWORD    unknown_1;                             //        20         4     always 0x0001

    uint     group;                                 //        24         4     the symbol's SYMBOL_GROUP index in "symgroups.raw"
    DWORD    unknown_2;                             //        28         4

    double   pointSize;                             //        32         8     point size
    uint     spread;                                //        40         4     spread: 0=floating (variable)
    DWORD    unknown_3;                             //        44         4

    uint     tickType;                              //        48         4     tick type: 0=Uptick, 1=Downtick, 2=n/a
    WORD     unknown_4;                             //        52         2     always 0x0100
    WORD     unknown_5;                             //        54         2     many times NULL

    uint    time;                                   //        56         4     time
    DWORD    unknown_6;                             //        60         4
    double   bid;                                   //        64         8     bid
    double   ask;                                   //        72         8     ask
    double   sessionHigh;                           //        80         8     session high
    double   sessionLow;                            //        88         8     session low

    BYTE     unknown_7[16];                         //        96        16     many times NULL
    double   bid_2;                                 //       112         8     bid (repetition)
    double   ask_2;                                 //       120         8     ask (repetition)
};                                                 // -----------------------------------------------------------------------
#pragma pack(pop)    

Here on the code above, the entry unknown_4 in not always 1. Is a flag bit, use by mt4 to indicate that this symbol should be updated everytime there's a new tick data. Hence is one when saved to file since it will be updated anyways. But when set to zero, it will not receive any update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants