Fix Cython compilation error in LimitOrder age methods #376
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a Cython compilation error in the LimitOrder class that was preventing successful compilation of the project.
Problem
The Cython compiler was failing with the error: Cannot convert 'double' to Python object unless type is correctly specified
This occurred in the c_age() and c_age_til() methods of the LimitOrder class, where the return type was declared as long long but the actual calculation returned a double value due to the division by 1e6.
Solution
Files Changed
Testing
The fix resolves the Cython compilation error while maintaining backward compatibility. The public interface continues to return integers as expected, but the internal calculations now properly handle the floating-point arithmetic.
Request for Review
Please review this fix for the Cython compilation issue. The changes are minimal and focused on correcting the type declarations to match the actual return types from the calculations.