[GAP-062]: trend confirm direction fix complete
- src/NT8.Strategies/Examples/SimpleORBStrategy.cs: publish side-specific trend confirmation values - src/NT8.Core/Intelligence/FactorCalculators.cs: score trend confirmation by intent side - tests/NT8.Core.Tests/Intelligence/OrbConfluenceFactorTests.cs: add long/short symmetry coverage - SPRINT_BOARD.md: GAP-062 prompted -> implemented - docs/00-governance/current_status.md: updated GAP-062 status - docs/00-governance/decisions.md: recorded DEC-20260826-01 - TASK_GAP062_TREND_CONFIRM_DIRECTION_PROMPT.md: committed task prompt Build: clean | Tests: 569 passing | Dual-deployed: yes, backup 20260826_005308
This commit is contained in:
@@ -967,7 +967,9 @@ namespace NT8.Strategies.Examples
|
||||
context.CustomData["current_bar"] = bar;
|
||||
context.CustomData["avwap"] = avwap;
|
||||
context.CustomData["avwap_slope"] = avwapSlope;
|
||||
context.CustomData["trend_confirm"] = avwapSlope > 0.0 ? 1.0 : 0.0;
|
||||
context.CustomData["trend_confirm_long"] = avwapSlope > 0.0 ? 1.0 : 0.0;
|
||||
context.CustomData["trend_confirm_short"] = avwapSlope < 0.0 ? 1.0 : 0.0;
|
||||
context.CustomData["trend_confirm"] = ResolveTrendConfirmForTelemetry(bar, avwapSlope);
|
||||
context.CustomData["current_atr"] = Math.Max(0.01, bar.High - bar.Low);
|
||||
context.CustomData["normal_atr"] = Math.Max(0.01, normalAtr);
|
||||
context.CustomData["recent_execution_quality"] = 0.8;
|
||||
@@ -981,6 +983,29 @@ namespace NT8.Strategies.Examples
|
||||
}
|
||||
}
|
||||
|
||||
private double ResolveTrendConfirmForTelemetry(BarData bar, double avwapSlope)
|
||||
{
|
||||
int direction = _pendingBreakoutDirection;
|
||||
|
||||
if (direction == 0 && _openingRangeReady)
|
||||
{
|
||||
double openingRange = _openingRangeHigh - _openingRangeLow;
|
||||
double volatilityBuffer = openingRange * (_stdDevMultiplier - 1.0);
|
||||
if (volatilityBuffer < 0.0)
|
||||
volatilityBuffer = 0.0;
|
||||
|
||||
if (bar.Close > _openingRangeHigh + volatilityBuffer)
|
||||
direction = 1;
|
||||
else if (bar.Close < _openingRangeLow - volatilityBuffer)
|
||||
direction = -1;
|
||||
}
|
||||
|
||||
if (direction < 0)
|
||||
return avwapSlope < 0.0 ? 1.0 : 0.0;
|
||||
|
||||
return avwapSlope > 0.0 ? 1.0 : 0.0;
|
||||
}
|
||||
|
||||
private void ResetSession(DateTime sessionStart)
|
||||
{
|
||||
_currentSessionDate = sessionStart.Date;
|
||||
|
||||
Reference in New Issue
Block a user