Sprint 3: Production Hardening — 9 tasks completed
## Summary Implemented 9 production-hardening tasks across risk, execution, calendar, and governance. All changes verified: build clean (0 errors), 492 tests passing (404 core + 78 integration + 10 perf). ## Core Changes ### Risk & Portfolio (3 tasks) - **GAP-019** Portfolio Heat Tier 3.5: Added MaxHeatPct (default 3%) to AdvancedRiskConfig; ValidatePortfolioHeat() computes TotalOpenRisk + NewTradeRisk / Equity * 100; rejects when exceeded. - **GAP-003** RiskPerTrade <= MaxTradeRisk Assertion: RiskPerTrade property in RiskConfig; throws ArgumentException at ValidateOrder() if RiskPerTrade > MaxTradeRisk; 3 unit tests. - **GAP-005** GetRiskStatus() Live Config: _currentDailyLossLimit field updated from config.DailyLossLimit on each ValidateOrder(); GetRiskStatus() returns actual value; 3 unit tests. ### Execution & Position Management (3 tasks) - **TASK-06a** Runner Mode Architecture: RunnerMode enum (Auto/Mode1DualLeg/Mode2RunnerOnly/ Mode3ScalerOnly/Disabled); ResolveRunnerMode() logic; 4-mode SubmitOrderToNT8() behavior. - **TASK-06b** ATR Dynamic Stop: EnableDynamicStop, AtrPeriod, AtrMultiplier, MinStopTicks, MaxStopTicks; computes dynStop = clamp(round(ATR/TickSize * Mult), Min, Max); overrides intent.StopTicks. - **GAP-006** Position-Close Re-arm: OnPositionUpdate() sends clear_trade_taken when flat; EnableBarBasedRearm parameter gates legacy bar-driven re-arm (default false for live). ### Strategy Intelligence (2 tasks) - **GAP-004** orbRangeTicks Fix: DailyBarContext.OrbRangeTicks field; computed from actual ORB high/low / TickSize; passed to Factor 7 (ORBvsATR). - **GAP-010** Short-Side Regime Filter: EnableShortTrendFilter param; vetoes shorts when AVWAP slope > 0 (bullish); configurable, default true. ### Calendar & Trailing (2 tasks) - **GAP-008** CME Holiday Awareness: NEW CmeHolidayCalendar.cs with 9 observed holidays + Good Friday (Easter calc); EnableCMEHolidayGuard skips ORB window on holidays. - **GAP-009** ATR Trailing Real ATR: EnableATRTrailing, ATRTrailingPeriod (14), ATRTrailingMultiplier (2.0), ATRTrailingMinTicks (8), ATRTrailingMaxTicks (60); computes trailTicks from ATR(Close,Period)[0]. ## Governance - SPRINT_BOARD.md, current_status.md, decisions.md (DEC-20260711-01 through -09), NEXT_PROMPT.md updated - All 9 tasks moved ACTIVE -> COMPLETED; GAP-011 (Gitea CI) now ACTIVE ## Verification - verify-build.bat: 0 errors, 0 warnings - Tests: 492 passing (404 core + 78 integration + 10 performance) ## Files - Modified: 13 source, 3 test, 9 governance - Deleted: 28 obsolete spec/docs - Added: 1 new module (NT8.Core.Calendar), governance files - Dual-deployed to NT8 Custom\Strategies\ ## Rollback Tag: sprint3-production-hardening-complete To revert: git reset --hard sprint3-production-hardening-complete
This commit is contained in:
83
docs/archive/fix-specs/NET_FRAMEWORK_CONVERSION.md
Normal file
83
docs/archive/fix-specs/NET_FRAMEWORK_CONVERSION.md
Normal file
@@ -0,0 +1,83 @@
|
||||
# NT8 SDK - .NET Framework 4.8 Compatibility Changes
|
||||
|
||||
## Summary
|
||||
Successfully converted the NT8 SDK from .NET Core 9 to .NET Framework 4.8 for NinjaTrader 8 compatibility.
|
||||
|
||||
## Key Changes Made
|
||||
|
||||
### 1. Framework Targeting
|
||||
- **Updated all projects** from `net9.0` to `net48`
|
||||
- **Disabled modern C# features** (nullable references, records, etc.)
|
||||
- **Set C# language version** to 5.0 for compatibility
|
||||
|
||||
### 2. Project Files Updated
|
||||
- `Directory.Build.props` - Framework targeting and compilation settings
|
||||
- All `.csproj` files - Target framework and package references
|
||||
- CI/CD pipeline - Windows runner for .NET Framework builds
|
||||
|
||||
### 3. Modern C# Feature Conversions
|
||||
- **Records → Classes**: Converted all `record` types to traditional classes
|
||||
- **Nullable references**: Removed `string?` syntax, using standard `string`
|
||||
- **String interpolation**: Converted to `String.Format()` calls
|
||||
- **Pattern matching**: Replaced with traditional `switch` statements
|
||||
|
||||
### 4. Package Dependencies
|
||||
- **Removed**: Microsoft.Extensions.Logging, Microsoft.Extensions.Configuration
|
||||
- **Added**: Newtonsoft.Json, System.ComponentModel.Annotations
|
||||
- **Testing**: Switched from xUnit to MSTest for .NET Framework compatibility
|
||||
|
||||
### 5. Custom Logging System
|
||||
- Created `ILogger` interface compatible with .NET Framework
|
||||
- Implemented `BasicLogger` class for console output
|
||||
- Maintains similar API to Microsoft.Extensions.Logging
|
||||
|
||||
### 6. File Structure
|
||||
- **Created**: Missing configuration models (`Configuration.cs`)
|
||||
- **Updated**: All interface implementations to use new models
|
||||
- **Converted**: Test files to MSTest framework
|
||||
- **Added**: Build verification script (`verify-build.bat`)
|
||||
|
||||
## What Works Now
|
||||
|
||||
### ✅ Compilation
|
||||
- All projects target .NET Framework 4.8
|
||||
- Compatible with NinjaTrader 8 requirements
|
||||
- No modern C# features that NT8 can't handle
|
||||
|
||||
### ✅ Core Functionality
|
||||
- Risk management system (BasicRiskManager)
|
||||
- Position sizing system (BasicPositionSizer)
|
||||
- Strategy interface framework
|
||||
- Configuration and logging systems
|
||||
|
||||
### ✅ Testing
|
||||
- MSTest framework compatible with .NET Framework
|
||||
- Basic test suite for risk management
|
||||
- Build verification script
|
||||
|
||||
## What's Missing (Phase 1)
|
||||
|
||||
### 🔄 NT8 Integration
|
||||
- Actual NinjaTrader 8 adapter implementations
|
||||
- Market data provider integration
|
||||
- Order execution system
|
||||
|
||||
### 🔄 Advanced Features
|
||||
- Full strategy examples
|
||||
- Configuration file handling
|
||||
- Enhanced logging and monitoring
|
||||
|
||||
## Next Steps
|
||||
|
||||
1. **Test the build**: Run `verify-build.bat` to confirm compilation
|
||||
2. **NT8 Integration**: Begin Phase 1 with actual NT8 adapter development
|
||||
3. **Strategy Development**: Implement example strategies using the framework
|
||||
|
||||
## Compatibility Notes
|
||||
|
||||
- **NinjaTrader 8**: Requires .NET Framework 4.8 ✅
|
||||
- **C# Language**: Limited to C# 5.0 features ✅
|
||||
- **Package Management**: Uses NuGet packages compatible with .NET Framework ✅
|
||||
- **Testing**: MSTest framework works with Visual Studio and NT8 environment ✅
|
||||
|
||||
The SDK is now ready for NinjaTrader 8 integration while maintaining the sophisticated risk-first architecture from the original design.
|
||||
Reference in New Issue
Block a user