You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
You can't help but know that the original library has been using delta encoding from the very beginning. And that doesn't stop it from working.
The code is a demonstration of the high-compression capabilities of CBitBuffer. It is not intended to be a replica of the original library.
Sure, there're differences here and there.
Please consider adding this functionality.
TICKS_STREAM.mq5 (in attachments)
Variable-Length Encoding (TicksShortLite.mqh) - https://www.mql5.com/en/code/61728
Pros:
High compression ratio (VLQ)
Allows reading ticks sequentially (tick-by-tick) from compressed memory or file without full decompression
Supporting time range queries.
Ideal for streaming analysis (e.g., backtesting tick-by-tick)
Cons:
No random access or append ticks.
Fixed-Length Encoding (fxsaber's TicksShort.mqh) - https://www.mql5.com/ru/code/61126
Pros:
Jump directly to any tick index (fast seek).
Append easily.
Decompress only one record.
Cons:
No VLQ compression efficiency.
Slightly larger compressed files.
To implement faster range queries (from time, to_time) in TIICKS_STREAM, the encoding scheme has to be changed so that instead of encoding into a single block:
Allows reading ticks sequentially (tick-by-tick) from compressed memory or file without full decompression
You can do the same thing by recording tick by tick.
Is a zigzag necessary for a time delta?
// VLQWrite(buf, pos, ZigZagEncode(t - prev_time)); // ZigZag + VLQ encode each delta VLQWrite(buf, pos, t - prev_time);You can do the same thing by recording tick by tick.
Is a zigzag necessary for a time delta?
Is a zigzag necessary for a time delta?
Not strictly necessary, but acts as a guard against bad programming:
Zigzag can be removed for time delta to gain extra performance. However, the gain is negligible.