-
-
Notifications
You must be signed in to change notification settings - Fork 12
Release v3.0.2 - Bug fixes and improvements #31
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
Conversation
- Fixed new_bar_callback to correctly extract data from Event objects - Added defensive checks for event.data attribute access - Prevents 'Event object is not subscriptable' error
- Fixed system status display to use correct validation fields (is_running, ticks_processed) - Updated memory stats to use correct keys (total_bars_stored, quotes_processed, trades_processed) - Improved current prices display with better formatting and live price indicator - Fixed memory stats breakdown to directly access data manager timeframes - Removed unused imports and variables - Real-time data now correctly shows tick/quote/trade processing counts
Fixed critical issues with orderbook data processing and examples: ## Core Fixes - Fixed DataFrame update issue in realtime.py where new DataFrames weren't properly reassigned - Fixed contract ID matching by using instrument.id instead of symbol in TradingSuite - Added volume tracking to memory stats in trade processing - Added parameter acknowledgment for API compatibility ## Analytics Enhancements - Enhanced get_orderbook_depth to return total bid/ask volumes - Completely rewrote get_statistics method with comprehensive metrics: - Added proper volume calculations for bid/ask sides - Added trade statistics (buy/sell trades, avg trade size) - Added VWAP calculation from tracked numerator/denominator - Added session high/low tracking from trade history - Fixed mid price calculation fallback - Added market_depth_score calculation ## Example Fixes - Fixed examples to only use methods that actually exist - Corrected parameter names (time_window_minutes vs window_minutes) - Removed calls to non-existent methods: - get_order_flow_imbalance (replaced with get_cumulative_delta) - estimate_market_impact (replaced with get_orderbook_depth) - Fixed detect_order_clusters parameters - Added new comprehensive example (06_advanced_orderbook.py) ## Results All orderbook methods now work correctly with proper data: - Market imbalance and depth analysis - Volume profile with Point of Control - Iceberg and cluster detection - Trade flow and cumulative delta - Support/resistance levels - Comprehensive statistics with VWAP 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
… and position cleanup - Add graceful error handling for order cancellations that may fail due to fills - Implement automatic position cleanup to close any positions opened by filled orders - Fix Position model field references (use correct field names: size, type, contractId, averagePrice) - Add informative messages explaining why orders might not be cancellable - Ensure no positions are left open when the script completes
- Fixed asyncio.wait() error by creating tasks instead of passing coroutines - Fixed instrument lookup - suite.instrument is already an Instrument object - Fixed Order field names (type not orderType) and Position field names (size not netQuantity) - Fixed cancel_order return type handling (returns bool not object) - Added comprehensive cleanup function to cancel open orders and close positions - Cleanup runs in finally block to ensure execution even on errors The example now properly demonstrates order lifecycle tracking and ensures no test orders or positions are left open after completion.
- Updated README.md with v3.0.2 features and bug fixes - Added comprehensive v3.0.2 section to CHANGELOG.md - Updated CLAUDE.md to reflect current version - Updated SECURITY.md supported versions (3.0.x is now supported) - Updated all example files to reference SDK v3.0.2 - Version bump in pyproject.toml, __init__.py, and docs/conf.py Key changes documented: - Order lifecycle tracking fixes - Order template instrument lookup fixes - Comprehensive cleanup functionality - Asyncio concurrency improvements
|
Claude finished @TexasCoding's task —— View job PR Code Review: Release v3.0.2 - Bug fixes and improvementsSummaryI've conducted a comprehensive review of the 25 changed files in this PR. This is a solid maintenance release with important bug fixes and improvements to the project's stability and usability. ✅ Strengths1. Code Quality & Best Practices
2. Architecture & Design
3. Documentation & Versioning
🔍 Areas for Attention1. Performance Considerations
2. Error Handling
3. Type Safety
🚨 Potential Issues Found1. Minor Memory Concerns
2. Edge Cases
📋 Security Assessment✅ No security issues identified
🧪 Test Coverage Assessment
Recommendation: Consider adding unit tests specifically for the new cleanup functionality to ensure it works correctly in isolation. 🎯 Specific Code ReviewsFile:
File:
File:
🚀 Recommendations
🏆 Overall AssessmentRating: Excellent (9/10) This is a high-quality maintenance release that addresses real issues with proper solutions. The code follows best practices, has good error handling, and maintains backward compatibility. The bug fixes are targeted and effective, and the new cleanup functionality will significantly improve the developer experience when running examples repeatedly. ✅ Ready for merge - This PR represents solid engineering work with appropriate fixes and improvements. |
Summary
This PR includes bug fixes and improvements for the v3.0.2 release, focusing on order lifecycle tracking, cleanup functionality, and documentation updates.
Changes
🐛 Bug Fixes
Order Lifecycle Tracking (examples/15_order_lifecycle_tracking.py)
typenotorderType)sizenotnetQuantity)Order Templates (src/project_x_py/order_templates.py)
✨ New Features
Comprehensive Cleanup Functionality
cleanup_demo_orders_and_positions()function to order lifecycle example📚 Documentation Updates
Testing
Checklist