smart-money-concepts icon indicating copy to clipboard operation
smart-money-concepts copied to clipboard

Numba Impementation for Order Block Calculation

Open CosmicTrader opened this issue 1 month ago • 0 comments

Numba converts python code to machine code using JIT compiler and it is compatible with Numpy Arrays.

I have converted Order Block method to be compatible with numba, so users can get benifit of faster runtime especially for larger datasets.

First time usage is not significant may be 2x as it complies the function to machine code on initial use but subsequent runs can give speed boost in the order of 100x as well than original OB method.

Speedups are significant, for eg. the test data for EURUSD was calculated in 8.63 seconds on my laptop having i5-5700HQ processor (i5-7th Gen). It can still be optimised to run across all processors as well as GPU.

Please keep the calculate_ob_with_numba function as seperate function from class otherwise it does not work as intended.

I have also created seperate folders for test data according to instruments and defined two variables so user can easily test their data and insert new data easily.

If any changes are needed please reach out to me. I am not a seasoned contributor, so please suggest if I am making any mistake.

Thank you and regards, CosmicTrader (Harsh Kantariya, India, Freelance developer)

CosmicTrader avatar May 18 '24 08:05 CosmicTrader