[GAP-050]: quantity-aware risk contract complete
- IRiskManager.cs: add quantity-aware ValidateOrder contract - AdvancedRiskManager.cs: delegate Tier 1 through sized BasicRiskManager overload and preserve 3-arg behavior - NT8StrategyBase.cs: remove BasicRiskManager type-check workaround and call sized interface method - NT8OrderAdapter.cs: size before risk validation and pass actual contracts - tests: add AdvancedRiskManager, NT8OrderAdapter, and NT8StrategyBase coverage Build: clean | Tests: 566 passing; Core 476 passing | Dual-deployed: no - skipped by prompt
This commit is contained in:
@@ -81,14 +81,6 @@ namespace NT8.Adapters.NinjaTrader
|
||||
|
||||
try
|
||||
{
|
||||
// Validate the intent through risk management
|
||||
var riskDecision = _riskManager.ValidateOrder(intent, context, config.RiskSettings);
|
||||
if (!riskDecision.Allow)
|
||||
{
|
||||
// Risk rejected the order flow.
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate position size
|
||||
var sizingResult = _positionSizer.CalculateSize(intent, context, config.SizingSettings);
|
||||
if (sizingResult.Contracts <= 0)
|
||||
@@ -97,6 +89,14 @@ namespace NT8.Adapters.NinjaTrader
|
||||
return;
|
||||
}
|
||||
|
||||
// Validate the sized intent through risk management.
|
||||
var riskDecision = _riskManager.ValidateOrder(intent, context, config.RiskSettings, sizingResult.Contracts);
|
||||
if (!riskDecision.Allow)
|
||||
{
|
||||
// Risk rejected the order flow.
|
||||
return;
|
||||
}
|
||||
|
||||
// In a real implementation, this would call NT8's order execution methods.
|
||||
ExecuteInNT8(intent, sizingResult);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user