Skip to content

Conversation

inheritag
Copy link
Contributor

@inheritag inheritag commented Sep 26, 2025

From issue: #261

Confirmed visually via the example script:

Correcting the latency
Correcting the event order
current_timestamp: 1758845430295000000 , best_bid: nan , best_ask: nan
current_timestamp: 1758845430545000000 , best_bid: nan , best_ask: nan
current_timestamp: 1758845430795000000 , best_bid: nan , best_ask: nan
current_timestamp: 1758845431045000000 , best_bid: nan , best_ask: nan
current_timestamp: 1758845431295000000 , best_bid: nan , best_ask: nan
current_timestamp: 1758845431545000000 , best_bid: nan , best_ask: nan
current_timestamp: 1758845431795000000 , best_bid: nan , best_ask: nan
current_timestamp: 1758845432045000000 , best_bid: nan , best_ask: nan
current_timestamp: 1758845432295000000 , best_bid: nan , best_ask: nan
current_timestamp: 1758845432545000000 , best_bid: 109147.8 , best_ask: 109147.9
current_timestamp: 1758845432795000000 , best_bid: 109147.8 , best_ask: 109147.9
current_timestamp: 1758845433045000000 , best_bid: 109147.8 , best_ask: 109147.9
current_timestamp: 1758845433295000000 , best_bid: 109147.8 , best_ask: 109147.9
current_timestamp: 1758845433545000000 , best_bid: 109147.8 , best_ask: 109147.9
current_timestamp: 1758845433795000000 , best_bid: 109147.8 , best_ask: 109147.9
current_timestamp: 1758845434045000000 , best_bid: 109147.8 , best_ask: 109147.9
...

@inheritag
Copy link
Contributor Author

Codacy Static Code Analysis issue with complexity of convert function, but honestly I just followed the pattern of the other convertors in the codebase.

@inheritag inheritag marked this pull request as ready for review September 26, 2025 02:45
@inheritag inheritag mentioned this pull request Sep 26, 2025
@nkaz001
Copy link
Owner

nkaz001 commented Sep 26, 2025

Thank you for your contribution! When multiple depth levels exist in one file, they must be fused for proper handling, or only a single depth level should be processed. Please refer to https://github.com/nkaz001/hftbacktest/blob/master/py-hftbacktest/hftbacktest/data/utils/tardis.py#L477

@inheritag
Copy link
Contributor Author

Thank you for your contribution! When multiple depth levels exist in one file, they must be fused for proper handling, or only a single depth level should be processed. Please refer to https://github.com/nkaz001/hftbacktest/blob/master/py-hftbacktest/hftbacktest/data/utils/tardis.py#L477

Ah makes sense, thanks. Will do

@inheritag
Copy link
Contributor Author

Thank you for your contribution! When multiple depth levels exist in one file, they must be fused for proper handling, or only a single depth level should be processed. Please refer to https://github.com/nkaz001/hftbacktest/blob/master/py-hftbacktest/hftbacktest/data/utils/tardis.py#L477

Thanks done in 7e57100

Two functions:

def convert_fused(
    input_filename: str,
    output_filename: Optional[str] = None,
    base_latency: float = 0,
    buffer_size: int = 100_000_000,
    tick_size: float = 0.01,
    lot_size: float = 0.001,
) -> NDArray: # using FuseMarketDepth for multi level fusion conversion. 


def convert_depth(
    input_filename: str,
    output_filename: Optional[str] = None,
    base_latency: float = 0,
    buffer_size: int = 100_000_000,
    single_depth_level: BybitDepthLevel = BybitDepthLevel.LEVEL_50,
) -> NDArray: # using single depth level for conversion. 

Let me know if this is what you had in mind, thanks.

@nkaz001 nkaz001 merged commit a795fbe into nkaz001:master Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants