Skip to content

Commit 23b2f5d

Browse files
TexasCodingclaude
andcommitted
v3.5.6: Critical Event System and Bracket Order Fixes
## Multi-Instrument Event System Fixes - Implemented event forwarding from instrument EventBuses to suite EventBus - Added event methods (on, once, off, wait_for) to InstrumentContext - Fixed event propagation for multi-instrument support - Resolved mnq_context.wait_for(EventType.NEW_BAR) functionality ## Bracket Order Enhancements - Changed from price validation failure to automatic alignment - Orders with misaligned prices now auto-correct to tick size - Improved user experience with transparent price handling ## Example Scripts Updates - Fixed all 4 advanced trading examples - Corrected OrderBook API method usage - Fixed real-time data streaming bar access - Updated TypedDict field access patterns ## Test Suite Improvements - Fixed 30 failing tests to match correct behavior - Updated event system tests for forwarding verification - Modified price alignment tests for auto-correction - Added event_bus parameter to InstrumentContext tests ## Documentation - Updated README.md with v3.5.6 features - Added comprehensive CHANGELOG entry - Updated example documentation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent ba6ae6a commit 23b2f5d

File tree

11 files changed

+949
-497
lines changed

11 files changed

+949
-497
lines changed

.secrets.baseline

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
"filename": "CHANGELOG.md",
134134
"hashed_secret": "89a6cfe2a229151e8055abee107d45ed087bbb4f",
135135
"is_verified": false,
136-
"line_number": 2149
136+
"line_number": 2183
137137
}
138138
],
139139
"README.md": [
@@ -325,5 +325,5 @@
325325
}
326326
]
327327
},
328-
"generated_at": "2025-09-01T01:31:44Z"
328+
"generated_at": "2025-09-02T01:57:55Z"
329329
}

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
- Migration guides will be provided for all breaking changes
1515
- Semantic versioning (MAJOR.MINOR.PATCH) is strictly followed
1616

17+
## [3.5.6] - 2025-02-02
18+
19+
### 🐛 Fixed
20+
21+
**Multi-Instrument Event System**:
22+
- **Event Forwarding**: Implemented event forwarding from instrument-specific EventBuses to suite-level EventBus
23+
- **InstrumentContext Methods**: Added `on()`, `once()`, `off()`, and `wait_for()` methods that delegate to event_bus
24+
- **Event Propagation**: Fixed broken event system that prevented `mnq_context.wait_for(EventType.NEW_BAR)` from working
25+
- **Multi-Instrument Support**: Events now properly flow from individual instruments to the suite level
26+
27+
**Bracket Order Improvements**:
28+
- **Automatic Price Alignment**: Changed validation from failing to auto-aligning prices to tick size
29+
- **Smart Adjustment**: Orders with misaligned prices are now automatically corrected instead of rejected
30+
- **Better UX**: Improved user experience by handling price alignment transparently
31+
32+
**Example Scripts**:
33+
- **Advanced Trading Examples**: Fixed all 4 advanced trading examples with proper async/await patterns
34+
- **Real-time Streaming**: Fixed bar data access in real-time streaming example
35+
- **OrderBook Methods**: Corrected API usage with proper method names and parameters
36+
- **TypedDict Access**: Fixed bracket notation for TypedDict field access
37+
38+
### ✅ Testing
39+
40+
- **Test Suite Updates**: Fixed 30 failing tests to match new correct behavior
41+
- **Event System Tests**: Updated tests to verify event forwarding functionality
42+
- **Price Alignment Tests**: Tests now verify automatic alignment instead of rejection
43+
- **InstrumentContext Tests**: Added event_bus parameter to all test constructors
44+
45+
### 🔧 Changed
46+
47+
- **OrderManager**: Removed duplicate price alignment calls in `place_order()` method
48+
- **TradingSuite**: Added `_setup_event_forwarding()` method for event bus connectivity
49+
- **InstrumentContext**: Now requires `event_bus` parameter in constructor
50+
1751
## [3.5.5] - 2025-01-21
1852

1953
### ✅ Testing

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ A **high-performance async Python SDK** for the [ProjectX Trading Platform](http
2828

2929
This Python SDK acts as a bridge between your trading strategies and the ProjectX platform, handling all the complex API interactions, data processing, and real-time connectivity.
3030

31-
## 🚀 v3.5.5 - Sessions Module Testing & Documentation
31+
## 🚀 v3.5.6 - Event System & Bracket Order Enhancements
3232

33-
**Latest Version**: v3.5.5 - Comprehensive testing and documentation improvements for the ETH vs RTH Trading Sessions feature, ensuring production-ready session filtering and analysis.
33+
**Latest Version**: v3.5.6 - Critical fixes for multi-instrument event handling and automatic price alignment for bracket orders, ensuring robust real-time trading operations.
3434

35-
**Key Benefits**:
36-
- 🎯 **Multi-Asset Strategies**: Trade ES vs NQ pairs, commodity spreads, sector rotation
37-
- 📊 **Portfolio Management**: Unified risk management across multiple instruments
38-
- 🔄 **Parallel Processing**: Efficient concurrent data processing and order management
39-
- 🛡️ **Backward Compatible**: Existing single-instrument code continues to work
40-
-**Performance Optimized**: Parallel context creation and resource sharing
35+
**Key Improvements**:
36+
- 🔄 **Event Forwarding**: Fixed multi-instrument event propagation with proper bus forwarding
37+
- 🎯 **Smart Price Alignment**: Bracket orders now auto-align to tick sizes instead of failing
38+
- 📊 **Enhanced Examples**: All advanced trading examples updated and tested
39+
- 🛡️ **Improved Reliability**: 30+ test fixes ensuring production stability
40+
-**Real-time Fixes**: Corrected bar data access in streaming examples
4141

42-
See [CHANGELOG.md](CHANGELOG.md) for complete v3.5.5 features including sessions module improvements and comprehensive example scripts.
42+
See [CHANGELOG.md](CHANGELOG.md) for complete v3.5.6 fixes and previous version features.
4343

4444
### 📦 Production Stability Guarantee
4545

0 commit comments

Comments
 (0)