[GAP-061]: AVWAP state context telemetry complete
- SimpleORBNT8.cs: append Avwap, AvwapSlope, and TrendConfirm to STATE_CONTEXT when CustomData contains them - SimpleORBNT8DefaultsTests.cs: add source assertions for AVWAP telemetry formatting, missing-key omission, and no scoring/log-format changes - SPRINT_BOARD.md/decisions.md: record observability-only implementation and direction-blind trend_confirm finding Build: clean | Tests: 561 passing; Core 472 passing | Dual-deployed: no - skipped by prompt
This commit is contained in:
@@ -367,9 +367,36 @@ namespace NinjaTrader.NinjaScript.Strategies
|
||||
fields.Add("OrbWindowStart", sdkOrb.OpeningRangeStart.ToString("HH:mm"));
|
||||
fields.Add("OrbWindowEnd", sdkOrb.OpeningRangeEnd.ToString("HH:mm"));
|
||||
fields.Add("OrbReady", sdkOrb.OpeningRangeReady.ToString());
|
||||
AddStateContextDouble(fields, context, "Avwap", "avwap", "F2");
|
||||
AddStateContextDouble(fields, context, "AvwapSlope", "avwap_slope", "F4");
|
||||
AddStateContextDouble(fields, context, "TrendConfirm", "trend_confirm", "F1");
|
||||
return fields;
|
||||
}
|
||||
|
||||
private static void AddStateContextDouble(Dictionary<string, string> fields, StrategyContext context, string outputKey, string customDataKey, string format)
|
||||
{
|
||||
if (fields == null || context == null || context.CustomData == null || !context.CustomData.ContainsKey(customDataKey))
|
||||
return;
|
||||
|
||||
object value = context.CustomData[customDataKey];
|
||||
if (value == null)
|
||||
return;
|
||||
|
||||
double numericValue;
|
||||
if (value is double)
|
||||
numericValue = (double)value;
|
||||
else if (value is float)
|
||||
numericValue = (double)(float)value;
|
||||
else if (value is int)
|
||||
numericValue = (double)(int)value;
|
||||
else if (value is long)
|
||||
numericValue = (double)(long)value;
|
||||
else
|
||||
return;
|
||||
|
||||
fields.Add(outputKey, numericValue.ToString(format));
|
||||
}
|
||||
|
||||
protected override void ConfigureStrategyParameters()
|
||||
{
|
||||
_strategyConfig.RiskSettings.DailyLossLimit = DailyLossLimit;
|
||||
|
||||
Reference in New Issue
Block a user