Skip to content

Commit c104b1c

Browse files
committed
docs: update documentation for v3.4.0 release with ETH vs RTH feature
- Updated version to v3.4.0 in all relevant files - Added comprehensive CHANGELOG entries with experimental warnings - Created new docs/guide/sessions.md with complete usage guide - Updated README with session filtering examples and warnings - Enhanced docs/api/trading-suite.md with session configuration - Added experimental feature warnings throughout documentation - Reorganized examples into ETH_RTH_Examples directory - Emphasized that feature is not thoroughly tested with live data Related to PR #59
1 parent 7399119 commit c104b1c

File tree

12 files changed

+1393
-21
lines changed

12 files changed

+1393
-21
lines changed

.secrets.baseline

Lines changed: 3 additions & 3 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": 1745
136+
"line_number": 1812
137137
}
138138
],
139139
"README.md": [
@@ -142,7 +142,7 @@
142142
"filename": "README.md",
143143
"hashed_secret": "89a6cfe2a229151e8055abee107d45ed087bbb4f",
144144
"is_verified": false,
145-
"line_number": 257
145+
"line_number": 300
146146
}
147147
],
148148
"docs/authentication.rst": [
@@ -334,5 +334,5 @@
334334
}
335335
]
336336
},
337-
"generated_at": "2025-08-28T05:23:40Z"
337+
"generated_at": "2025-08-28T11:01:46Z"
338338
}

CHANGELOG.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,73 @@ 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.4.0] - 2025-08-28
18+
19+
### 🚀 New Feature: ETH vs RTH Trading Sessions (Experimental)
20+
21+
**IMPORTANT**: This is an experimental feature that has not been thoroughly tested with live market data. Use with caution in production environments.
22+
23+
This release introduces comprehensive trading session filtering, allowing you to separate Electronic Trading Hours (ETH) from Regular Trading Hours (RTH) for more precise market analysis and strategy execution.
24+
25+
### ✨ Added
26+
27+
**Trading Sessions Module** (`src/project_x_py/sessions/`):
28+
- **SessionConfig**: Configure session type (ETH/RTH/BOTH) with product-specific schedules
29+
- **SessionFilterMixin**: High-performance data filtering with caching and lazy evaluation
30+
- **Session-Aware Indicators**: Calculate technical indicators on session-specific data
31+
- **Session Statistics**: Separate performance metrics for ETH vs RTH periods
32+
- **Maintenance Break Exclusion**: Automatically filters out daily maintenance periods (5-6 PM ET)
33+
34+
**TradingSuite Integration**:
35+
- New `session_config` parameter for automatic session filtering
36+
- Seamless integration with existing components (OrderManager, PositionManager, DataManager)
37+
- Backward compatible - defaults to BOTH sessions when not specified
38+
39+
**Example Usage**:
40+
```python
41+
# RTH-only trading (9:30 AM - 4:00 PM ET)
42+
rth_suite = await TradingSuite.create(
43+
"MNQ",
44+
timeframes=["1min", "5min"],
45+
session_config=SessionConfig(session_type=SessionType.RTH)
46+
)
47+
48+
# ETH-only analysis (excludes RTH and maintenance breaks)
49+
eth_suite = await TradingSuite.create(
50+
"ES",
51+
session_config=SessionConfig(session_type=SessionType.ETH)
52+
)
53+
```
54+
55+
### 📚 Documentation & Examples
56+
57+
- New comprehensive example: `examples/sessions/16_eth_vs_rth_sessions_demo.py`
58+
- Demonstrates all session filtering capabilities
59+
- Shows performance comparisons between ETH and RTH
60+
- Includes session-aware technical indicators
61+
- Provides backtesting examples with session filters
62+
63+
### ⚠️ Known Limitations (Experimental)
64+
65+
- Session boundaries may need adjustment based on contract specifications
66+
- Overnight session handling requires further testing
67+
- Performance impact with large datasets not fully optimized
68+
- Some futures products may have non-standard session times
69+
70+
### 🔧 Technical Details
71+
72+
- Implemented with Polars DataFrame filtering for performance
73+
- Caching of session boundaries reduces computation overhead
74+
- Lazy evaluation prevents unnecessary filtering operations
75+
- Fully async implementation maintains SDK consistency
76+
77+
### 📝 Related
78+
79+
- PR #59: ETH vs RTH Trading Sessions Feature
80+
- Issue tracking further improvements and testing needed
81+
82+
---
83+
1784
## [3.3.6] - 2025-08-28
1885

1986
### 🎯 Major Quality Assurance Release

README.md

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

2222
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.
2323

24-
## 🚀 v3.3.6 - Comprehensive Testing & Quality Assurance
24+
## 🚀 v3.4.0 - ETH vs RTH Trading Sessions (Experimental)
2525

26-
**Latest Version**: v3.3.6 - Comprehensive testing initiative with 1,300+ tests, complete code quality compliance (0 type errors, 0 linting issues), and 175+ bugs fixed through strict TDD methodology. All critical components now have extensive test coverage. See [CHANGELOG.md](CHANGELOG.md) for full release history.
26+
**Latest Version**: v3.4.0 - Introduces ETH (Electronic Trading Hours) vs RTH (Regular Trading Hours) session filtering for futures trading. This feature enables traders to analyze and trade based on specific market sessions, with up to 366% more data available in ETH sessions.
27+
28+
⚠️ **Experimental Feature Warning**: The ETH vs RTH sessions feature is new and has not been thoroughly tested with live market data. Use with caution in production environments. See [CHANGELOG.md](CHANGELOG.md) for full release history.
2729

2830
### 📦 Production Stability Guarantee
2931

@@ -148,6 +150,47 @@ if __name__ == \"__main__\":
148150
asyncio.run(main())
149151
```
150152

153+
### Session Filtering (NEW in v3.4.0 - Experimental)
154+
155+
Filter market data and indicators by trading session (RTH vs ETH):
156+
157+
```python
158+
import asyncio
159+
from project_x_py import TradingSuite, SessionConfig, SessionType
160+
161+
async def session_example():
162+
# RTH-only trading (9:30 AM - 4:00 PM ET)
163+
rth_suite = await TradingSuite.create(
164+
"MNQ",
165+
timeframes=["1min", "5min"],
166+
session_config=SessionConfig(session_type=SessionType.RTH)
167+
)
168+
169+
# ETH trading (24-hour excluding maintenance breaks)
170+
eth_suite = await TradingSuite.create(
171+
"MNQ",
172+
timeframes=["1min", "5min"],
173+
session_config=SessionConfig(session_type=SessionType.ETH)
174+
)
175+
176+
# Compare data availability
177+
rth_data = await rth_suite.get_session_data("1min")
178+
eth_data = await eth_suite.get_session_data("1min")
179+
180+
print(f"RTH bars: {len(rth_data):,}") # ~390 bars per day
181+
print(f"ETH bars: {len(eth_data):,}") # ~1,410 bars per day (366% more)
182+
183+
await rth_suite.disconnect()
184+
await eth_suite.disconnect()
185+
186+
if __name__ == "__main__":
187+
asyncio.run(session_example())
188+
```
189+
190+
⚠️ **Note**: Session filtering is experimental. Test thoroughly in paper trading before production use.
191+
192+
📚 **Full Example**: See `examples/sessions/16_eth_vs_rth_sessions_demo.py` for comprehensive demonstration of all session features.
193+
151194
### Trading Suite (NEW in v3.0+)
152195

153196
The easiest way to get started with a complete trading setup:
@@ -277,6 +320,7 @@ TradingSuite supports optional features that can be enabled during initializatio
277320
|---------|-------------|-------------|
278321
| **OrderBook** | `"orderbook"` | Level 2 market depth, bid/ask analysis, iceberg detection |
279322
| **Risk Manager** | `"risk_manager"` | Position sizing, risk validation, managed trades |
323+
| **Session Filtering** | Built-in (v3.4.0) | RTH/ETH session filtering (experimental) |
280324
| **Trade Journal** | `"trade_journal"` | Trade logging and performance tracking (future) |
281325
| **Performance Analytics** | `"performance_analytics"` | Advanced metrics and analysis (future) |
282326
| **Auto Reconnect** | `"auto_reconnect"` | Automatic WebSocket reconnection (future) |

docs/api/trading-suite.md

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,51 @@ async def advanced_setup():
4949
await suite.disconnect()
5050
```
5151

52+
### Session Configuration (v3.4.0+)
53+
54+
!!! warning "Experimental Feature"
55+
Session filtering is experimental and not thoroughly tested with live data. Use with caution in production.
56+
57+
```python
58+
from project_x_py.sessions import SessionConfig, SessionType
59+
60+
async def session_setup():
61+
# RTH-only trading (9:30 AM - 4:00 PM ET)
62+
rth_suite = await TradingSuite.create(
63+
instrument="MNQ",
64+
timeframes=["1min", "5min"],
65+
session_config=SessionConfig(session_type=SessionType.RTH)
66+
)
67+
68+
# ETH-only analysis (overnight sessions)
69+
eth_suite = await TradingSuite.create(
70+
instrument="ES",
71+
session_config=SessionConfig(session_type=SessionType.ETH)
72+
)
73+
74+
# Custom session times
75+
from datetime import time
76+
import pytz
77+
78+
custom_config = SessionConfig(
79+
session_type=SessionType.RTH,
80+
custom_times=SessionTimes(
81+
rth_start=time(9, 0),
82+
rth_end=time(15, 30),
83+
timezone=pytz.timezone("US/Eastern")
84+
)
85+
)
86+
87+
custom_suite = await TradingSuite.create(
88+
instrument="CL",
89+
session_config=custom_config
90+
)
91+
92+
await rth_suite.disconnect()
93+
await eth_suite.disconnect()
94+
await custom_suite.disconnect()
95+
```
96+
5297
### Configuration File Setup
5398

5499
```python
@@ -108,6 +153,7 @@ from project_x_py.types import (
108153
OrderbookConfig
109154
)
110155
from project_x_py.risk_manager import RiskConfig
156+
from project_x_py.sessions import SessionConfig, SessionType
111157

112158
async def custom_configuration():
113159
# Custom component configurations
@@ -129,11 +175,18 @@ async def custom_configuration():
129175
max_drawdown_percent=10.0
130176
)
131177

178+
# Session configuration (v3.4.0+)
179+
session_config = SessionConfig(
180+
session_type=SessionType.RTH,
181+
product="MNQ" # Product-specific session times
182+
)
183+
132184
suite = await TradingSuite.create(
133185
"MNQ",
134186
order_manager_config=order_config,
135187
position_manager_config=position_config,
136-
risk_config=risk_config
188+
risk_config=risk_config,
189+
session_config=session_config # New in v3.4.0
137190
)
138191

139192
await suite.disconnect()
@@ -250,6 +303,37 @@ async def data_access():
250303
await suite.disconnect()
251304
```
252305

306+
### Session-Aware Data Access (v3.4.0+)
307+
308+
```python
309+
from project_x_py.sessions import SessionType
310+
311+
async def session_data_access():
312+
# Create suite with session configuration
313+
suite = await TradingSuite.create(
314+
"MNQ",
315+
timeframes=["1min", "5min"],
316+
session_config=SessionConfig(session_type=SessionType.RTH)
317+
)
318+
319+
# Get session-specific data
320+
rth_data = await suite.data.get_session_bars("5min", SessionType.RTH)
321+
eth_data = await suite.data.get_session_bars("5min", SessionType.ETH)
322+
323+
# Session trades
324+
rth_trades = await suite.data.get_session_trades(SessionType.RTH)
325+
326+
# Session statistics
327+
from project_x_py.sessions import SessionStatistics
328+
stats = SessionStatistics(suite)
329+
rth_stats = await stats.calculate_session_stats(SessionType.RTH)
330+
331+
print(f"RTH Volatility: {rth_stats['volatility']:.2%}")
332+
print(f"RTH Volume: {rth_stats['total_volume']:,}")
333+
334+
await suite.disconnect()
335+
```
336+
253337
## Event Handling
254338

255339
### Real-time Events

docs/changelog.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,41 @@ All notable changes to the ProjectX Python SDK will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.4.0] - 2025-08-28
9+
10+
### 🚀 New Feature: ETH vs RTH Trading Sessions (Experimental)
11+
12+
**IMPORTANT**: This is an experimental feature that has not been thoroughly tested with live market data. Use with caution in production environments.
13+
14+
This release introduces comprehensive trading session filtering, allowing you to separate Electronic Trading Hours (ETH) from Regular Trading Hours (RTH) for more precise market analysis and strategy execution.
15+
16+
### Added
17+
- **Trading Sessions Module** (`src/project_x_py/sessions/`) with SessionConfig, SessionFilterMixin, and session-aware components
18+
- **TradingSuite Integration** with new `session_config` parameter
19+
- **Session-Aware Indicators** for calculating technical indicators on session-specific data
20+
- **Session Statistics** for separate ETH vs RTH performance metrics
21+
- **Maintenance Break Exclusion** (5-6 PM ET daily)
22+
- **Comprehensive Example** in `examples/sessions/16_eth_vs_rth_sessions_demo.py`
23+
- **Documentation** in `docs/guide/sessions.md`
24+
25+
### Known Limitations
26+
- Session boundaries may need adjustment based on contract specifications
27+
- Overnight session handling requires further testing
28+
- Performance impact with large datasets not fully optimized
29+
- Some futures products may have non-standard session times
30+
31+
### Related
32+
- PR #59: ETH vs RTH Trading Sessions Feature
33+
34+
## [3.3.6] - 2025-08-28
35+
36+
### Major Quality Assurance Release
37+
- Complete code quality compliance with zero mypy errors, zero linting issues, zero IDE diagnostics
38+
- Order Manager module complete overhaul with protocol compliance
39+
- Fixed TradingSuite duplicate subscription issues
40+
- Added 100+ new comprehensive tests for edge cases
41+
- Complete test coverage with all 1,300+ tests passing
42+
843
## [3.3.4] - 2025-01-23
944

1045
### Added

0 commit comments

Comments
 (0)