[GAP-056]: inert breakeven params hidden

- NT8StrategyBase.cs: hide inert breakeven parameters with Browsable(false) and unused descriptions

- SimpleORBNT8.cs: label settings export AutoBreakeven values as unused compatibility fields

- NT8StrategyBaseBreakevenParamsTests.cs: add source assertions for hidden/inert parameters and no order-flow reads

- SPRINT_BOARD.md/decisions.md: record Option A and verification evidence

Build: clean | Tests: 555 passing; Core 466 passing | Dual-deployed: no - skipped by prompt
This commit is contained in:
2026-08-25 13:30:11 -04:00
parent 8a1c3d1649
commit cdd9aa25bb
6 changed files with 231 additions and 5 deletions

View File

@@ -79,9 +79,14 @@
**[GAP-052] Two hardcoded tick-value tables have already drifted out of sync** | Stage 1 | ✅ IMPLEMENTED — deploy skipped by operator **[GAP-052] Two hardcoded tick-value tables have already drifted out of sync** | Stage 1 | ✅ IMPLEMENTED — deploy skipped by operator
- `BasicRiskManager.GetTickValue` (6 symbols) and `BasicPositionSizer.GetTickValue` (8 symbols) disagreed: `BasicPositionSizer` supported `6E`/`6A`, while `BasicRiskManager` fell through to its `default: 12.50`. For `6A`, the real tick value is `$10.00`, creating a latent 25% risk-calculation error if traded. NQ/MNQ were unaffected and remain unchanged. - `BasicRiskManager.GetTickValue` (6 symbols) and `BasicPositionSizer.GetTickValue` (8 symbols) disagreed: `BasicPositionSizer` supported `6E`/`6A`, while `BasicRiskManager` fell through to its `default: 12.50`. For `6A`, the real tick value is `$10.00`, creating a latent 25% risk-calculation error if traded. NQ/MNQ were unaffected and remain unchanged.
- Prompt: `TASK_GAP052_TICK_VALUE_CONSOLIDATION_PROMPT.md`. Implemented Option A: shared platform-neutral `InstrumentTickValueTable` containing the union of existing symbols (`ES`, `MES`, `NQ`, `MNQ`, `CL`, `GC`, `6E`, `6A`). Basic and Advanced risk/sizing helpers now delegate to the shared table, and `6A` risk validation uses `$10.00` instead of falling through to `$12.50`. Verification: focused tests 26/26, `verify-build.bat` 552/552, Core Release no-build 463/463. Deployment skipped per operator instruction. - Prompt: `TASK_GAP052_TICK_VALUE_CONSOLIDATION_PROMPT.md`. Implemented Option A: shared platform-neutral `InstrumentTickValueTable` containing the union of existing symbols (`ES`, `MES`, `NQ`, `MNQ`, `CL`, `GC`, `6E`, `6A`). Basic and Advanced risk/sizing helpers now delegate to the shared table, and `6A` risk validation uses `$10.00` instead of falling through to `$12.50`. Verification: focused tests 26/26, `verify-build.bat` 552/552, Core Release no-build 463/463. Deployment skipped per operator instruction.
**[GAP-056] `EnableAutoBreakeven`/`BreakevenTriggerTicks`/`BreakevenOffsetTicks` are fully inert** | Stage 1 | ✅ IMPLEMENTED — deploy skipped by prompt
- Found during GAP-054 verification (`DEC-20260821-01`): GAP-054 removed the only code path that ever read these three parameters (the runner breakeven block that was clobbering the trailing stop). They remain declared, defaulted, and exposed in the NinjaTrader UI but do nothing — harmless, but an operator toggling `EnableAutoBreakeven` would reasonably expect an effect.
- Prompt: `TASK_GAP056_INERT_BREAKEVEN_PARAMS_PROMPT.md`. Implemented Option A: retained the properties for saved workspace/settings compatibility, hid all three from the NT8 property grid with `[Browsable(false)]`, and labeled the SimpleORB settings export as `UNUSED`. No order-flow, sizing, risk, `SetStopLoss`, or `SetTrailStop` logic changed. Verification: focused tests 3/3, `verify-build.bat` 555/555, Core Release no-build 466/466. Deploy intentionally skipped by task prompt.
### Also raised by the review, not yet prompted ### Also raised by the review, not yet prompted
GAP-051 (`MicroUpgradeThreshold` fires every session) · GAP-052 (two hardcoded tick-value tables) · GAP-051 (`MicroUpgradeThreshold` fires every session) · GAP-052 (two hardcoded tick-value tables) ·
GAP-053 (`executive_summary.md` and `roadmap.md` Sprint 3 list present ~12 completed tasks as open) · GAP-053 (`executive_summary.md` and `roadmap.md` Sprint 3 list present ~12 completed tasks as open) ·
plus GAP-057 (no test seam for NinjaScript managed-order SetStopLoss/SetTrailStop calls) ·
plus the standing dirty working tree — 17 modified, 5 untracked, including two live strategy files. plus the standing dirty working tree — 17 modified, 5 untracked, including two live strategy files.
--- ---

View File

@@ -0,0 +1,89 @@
# TASK: GAP-056 — EnableAutoBreakeven/BreakevenTriggerTicks/BreakevenOffsetTicks are fully inert
# Staged: 2026-08-21 (found during GAP-054 verification, DEC-20260821-01), promoted 2026-08-25
# Sprint: Stage 1 — UI/hygiene, zero trading-behaviour risk (parameters already do nothing)
# Owner: Kilocode
# Deploy: COMMIT ONLY — do NOT run deploy-to-nt8.bat or copy build output to
# the live NT8 install as part of this task. Verify-build and commit
# as usual; leave the deploy step for the operator to run manually
# once ready.
# ─────────────────────────────────────────────────────────────────
## THE DEFECT
`EnableAutoBreakeven`, `BreakevenTriggerTicks`, and `BreakevenOffsetTicks`
are declared, defaulted (`EnableAutoBreakeven=true`, `BreakevenTriggerTicks
=20`, `BreakevenOffsetTicks=1`), and exposed in the strategy's NinjaTrader
UI — but do nothing. GAP-054 removed the only code path that ever read
them (the runner breakeven block that was clobbering the trailing stop —
`SetStopLoss()` on `_runnerSignalName`). There was never a separate
scaler-leg breakeven implementation for them to still govern; confirmed by
direct source read during GAP-054 verification (`DEC-20260821-01`).
This is not a trading-risk item — inert means harmless, the strategy
behaves identically regardless of these values — but an operator who sets
`EnableAutoBreakeven=true` in the NinjaTrader UI would reasonably expect
it to do something, and currently it silently doesn't.
## READ-FIRST
1. Read `DEC-20260821-01` in `docs/00-governance/decisions.md` for the full
finding.
2. Grep `NT8StrategyBase.cs`/`SimpleORBNT8.cs` for all three parameter
names to confirm they are genuinely unread anywhere (declaration and
settings-export/log line only) before changing anything — don't take
the DEC entry's claim at face value, re-verify it's still true now that
GAP-054/060/059/051/052 have all landed since.
## THE CHANGE — pick one, and say which and why in your writeback
**Option A — mark unused, keep declared.** Add `[Browsable(false)]` (or
update the `[Display]`/`Description` attribute text to state "Currently
unused — no code path reads this value") to all three parameters so they
no longer appear as live controls in the NinjaTrader UI, or at minimum no
longer look actionable. Smallest diff, reversible, no risk of breaking
anything that might reference them by name (e.g. saved workspace
templates, `settings_*.txt` exports).
**Option B — remove outright.** Delete the three parameters entirely,
including their settings-export/log line. Larger diff, cleaner end state,
but check whether `settings_*.txt` parsing (dashboard, TOOL-002 config
drift detector, or anything else that reads exported settings files)
depends on these fields being present before removing — if so, either
keep them in the export with a literal "unused" value or confirm nothing
downstream breaks.
Default to Option A unless you find a concrete reason Option B is safe and
clearly better — state that reasoning either way.
## DO NOT
- Do not re-add any breakeven logic — the removal in GAP-054 was correct
and intentional (that's what fixed the runner's trailing stop). This
task is about the now-dead parameters, not about restoring behavior.
- Do not change `SetStopLoss`/`SetTrailStop` order-flow logic at all.
- Do not touch the runner/scaler trail mechanism GAP-054 fixed.
## TESTS (required)
1. Whichever option is chosen: a test confirming the parameter(s) are
genuinely unread by any code path that affects order flow, sizing, or
risk (source-text assertion is fine given this class's established
precedent — same pattern as prior `SimpleORBNT8DefaultsTests.cs`/
`NT8StrategyBaseRejectSummaryTests.cs` tests this session).
2. If Option B (removal): a test or explicit confirmation that
settings-export/log parsing elsewhere in the codebase does not depend
on these three fields being present.
## VALIDATION (operator)
None required for correctness — this is UI/hygiene only, no order flow,
sizing, or risk behavior changes either way. If Option A is chosen and you
want visual confirmation, open the strategy's NinjaTrader parameter dialog
and confirm the three fields read as unused/non-browsable as intended.
## GOVERNANCE
Track as [GAP-056] in SPRINT_BOARD.md. Update `docs/00-governance/decisions.md`
`DEC-20260821-01` status to note GAP-056 implemented, which option was
chosen and why.
Reference: this task, `DEC-20260821-01`.

View File

@@ -105,7 +105,8 @@ Use this file to record durable project decisions that affect implementation pat
2. **GAP-057 — no test seam exposes NinjaScript's `SetStopLoss`/`SetTrailStop` managed-order calls.** `TASK_GAP054_RUNNER_TRAIL_PROMPT.md` asked for a regression test asserting no `SetStopLoss` call is issued after `SetTrailStop` for a runner signal, with instructions to propose the smallest seam if none exists. Kilocode correctly did not fabricate coverage, but a concrete seam proposal wasn't written up. This is the same defect class as GAP-054 (silent exit-order clobbering) — worth closing so a future change to this block gets real regression coverage instead of relying on manual source review, as this review just did. 2. **GAP-057 — no test seam exposes NinjaScript's `SetStopLoss`/`SetTrailStop` managed-order calls.** `TASK_GAP054_RUNNER_TRAIL_PROMPT.md` asked for a regression test asserting no `SetStopLoss` call is issued after `SetTrailStop` for a runner signal, with instructions to propose the smallest seam if none exists. Kilocode correctly did not fabricate coverage, but a concrete seam proposal wasn't written up. This is the same defect class as GAP-054 (silent exit-order clobbering) — worth closing so a future change to this block gets real regression coverage instead of relying on manual source review, as this review just did.
- **Decision:** Track both, do not action either as part of GAP-054. No operator decision required to log them. - **Decision:** Track both, do not action either as part of GAP-054. No operator decision required to log them.
- **Related Files:** `src/NT8.Adapters/Strategies/NT8StrategyBase.cs`, `TASK_GAP054_RUNNER_TRAIL_PROMPT.md` - **Related Files:** `src/NT8.Adapters/Strategies/NT8StrategyBase.cs`, `TASK_GAP054_RUNNER_TRAIL_PROMPT.md`
- **Action Required:** None immediate. Stage as low-priority follow-up prompts when convenient. - **GAP-056 Implementation Note (2026-08-25):** Implemented Option A for the inert breakeven parameters. `EnableAutoBreakeven`, `BreakevenTriggerTicks`, and `BreakevenOffsetTicks` remain declared/defaulted for saved workspace and settings compatibility, but are now `[Browsable(false)]` and their `Display` descriptions state they are currently unused. `SimpleORBNT8` settings export now labels the values as `UNUSED (retained for compatibility)`. This is reversible and avoids breaking persisted templates; Option B removal was not chosen because there was no concrete need to delete the fields and no benefit worth risking workspace/settings references. Added source-level tests proving the properties are hidden/marked unused and not read by `OnBarUpdate()` or `SubmitOrderToNT8()`. Verification: focused GAP-056 tests passed 3/3; `verify-build.bat` passed with 555/555 tests (466 Core, 79 Integration, 10 Performance); `dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimal` passed 466/466. Deploy intentionally skipped by task prompt.
- **Action Required:** GAP-056 complete. GAP-057 remains ready as the remaining follow-up from this decision.
### DEC-20260819-01 ### DEC-20260819-01
- **ID:** DEC-20260819-01 - **ID:** DEC-20260819-01

View File

@@ -271,16 +271,19 @@ namespace NinjaTrader.NinjaScript.Strategies
public bool EnableShortTrades { get; set; } public bool EnableShortTrades { get; set; }
[NinjaScriptProperty] [NinjaScriptProperty]
[Display(Name = "Enable Auto Breakeven", GroupName = "Exit Management", Order = 1)] [Browsable(false)]
[Display(Name = "Enable Auto Breakeven", GroupName = "Exit Management", Order = 1, Description = "Currently unused; retained for saved workspace compatibility.")]
public bool EnableAutoBreakeven { get; set; } public bool EnableAutoBreakeven { get; set; }
[NinjaScriptProperty] [NinjaScriptProperty]
[Display(Name = "Breakeven Trigger Ticks", GroupName = "Exit Management", Order = 2)] [Browsable(false)]
[Display(Name = "Breakeven Trigger Ticks", GroupName = "Exit Management", Order = 2, Description = "Currently unused; retained for saved workspace compatibility.")]
[Range(1, 100)] [Range(1, 100)]
public int BreakevenTriggerTicks { get; set; } public int BreakevenTriggerTicks { get; set; }
[NinjaScriptProperty] [NinjaScriptProperty]
[Display(Name = "Breakeven Offset Ticks", GroupName = "Exit Management", Order = 3)] [Browsable(false)]
[Display(Name = "Breakeven Offset Ticks", GroupName = "Exit Management", Order = 3, Description = "Currently unused; retained for saved workspace compatibility.")]
[Range(0, 20)] [Range(0, 20)]
public int BreakevenOffsetTicks { get; set; } public int BreakevenOffsetTicks { get; set; }

View File

@@ -450,7 +450,7 @@ namespace NinjaTrader.NinjaScript.Strategies
lines.Insert(endIdx + 6, string.Format("StopDollars : {0:C}", StopTicks * tickDollarValue)); lines.Insert(endIdx + 6, string.Format("StopDollars : {0:C}", StopTicks * tickDollarValue));
lines.Insert(endIdx + 7, string.Format("TargetDollars : {0:C}", TargetTicks * tickDollarValue)); lines.Insert(endIdx + 7, string.Format("TargetDollars : {0:C}", TargetTicks * tickDollarValue));
lines.Insert(endIdx + 8, string.Format("RR_Ratio : {0:F2}:1", (double)TargetTicks / StopTicks)); lines.Insert(endIdx + 8, string.Format("RR_Ratio : {0:F2}:1", (double)TargetTicks / StopTicks));
lines.Insert(endIdx + 9, String.Format("AutoBreakeven : {0} @ {1}ticks + {2}tick offset", lines.Insert(endIdx + 9, String.Format("AutoBreakeven : UNUSED (retained for compatibility) {0} @ {1}ticks + {2}tick offset",
EnableAutoBreakeven, BreakevenTriggerTicks, BreakevenOffsetTicks)); EnableAutoBreakeven, BreakevenTriggerTicks, BreakevenOffsetTicks));
lines.Insert(endIdx + 10, String.Format("Runner : {0} | Trail={1}ticks", lines.Insert(endIdx + 10, String.Format("Runner : {0} | Trail={1}ticks",
EnableRunner, RunnerTrailTicks)); EnableRunner, RunnerTrailTicks));

View File

@@ -0,0 +1,128 @@
using System;
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace NT8.Core.Tests.Adapters
{
[TestClass]
public class NT8StrategyBaseBreakevenParamsTests
{
[TestMethod]
public void BreakevenParameters_AreHiddenAndMarkedUnused()
{
string source = File.ReadAllText(FindStrategyBaseSourceFile());
AssertPropertyHiddenAndUnused(source, "EnableAutoBreakeven");
AssertPropertyHiddenAndUnused(source, "BreakevenTriggerTicks");
AssertPropertyHiddenAndUnused(source, "BreakevenOffsetTicks");
}
[TestMethod]
public void BreakevenParameters_AreNotReadByOrderFlowMethods()
{
string source = File.ReadAllText(FindStrategyBaseSourceFile());
string onBarUpdate = ExtractMethodBlock(source, "protected override void OnBarUpdate");
string submitOrder = ExtractMethodBlock(source, "private void SubmitOrderToNT8");
AssertNoBreakevenParameterReference(onBarUpdate);
AssertNoBreakevenParameterReference(submitOrder);
}
[TestMethod]
public void SimpleORBSettingsExport_LabelsBreakevenAsUnused()
{
string source = File.ReadAllText(FindSimpleOrbSourceFile());
string method = ExtractMethodBlock(source, "protected override List<string> GetStrategySettingsLines");
Assert.IsTrue(method.Contains("AutoBreakeven : UNUSED (retained for compatibility)"), "Settings export must not present inert breakeven parameters as active controls.");
}
private static void AssertPropertyHiddenAndUnused(string source, string propertyName)
{
string block = ExtractPropertyBlock(source, propertyName);
Assert.IsTrue(block.Contains("[Browsable(false)]"), propertyName + " must be hidden from the NinjaTrader property grid.");
Assert.IsTrue(block.Contains("Currently unused; retained for saved workspace compatibility."), propertyName + " must state why it remains declared.");
Assert.IsTrue(block.Contains("public"), propertyName + " must remain declared for saved workspace compatibility.");
}
private static void AssertNoBreakevenParameterReference(string method)
{
Assert.IsFalse(method.Contains("EnableAutoBreakeven"), "Order flow must not read EnableAutoBreakeven while it is inert.");
Assert.IsFalse(method.Contains("BreakevenTriggerTicks"), "Order flow must not read BreakevenTriggerTicks while it is inert.");
Assert.IsFalse(method.Contains("BreakevenOffsetTicks"), "Order flow must not read BreakevenOffsetTicks while it is inert.");
}
private static string FindStrategyBaseSourceFile()
{
return FindSourceFile("NT8StrategyBase.cs");
}
private static string FindSimpleOrbSourceFile()
{
return FindSourceFile("SimpleORBNT8.cs");
}
private static string FindSourceFile(string fileName)
{
DirectoryInfo dir = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory);
while (dir != null)
{
string candidate = Path.Combine(dir.FullName, "src", "NT8.Adapters", "Strategies", fileName);
if (File.Exists(candidate))
return candidate;
dir = dir.Parent;
}
throw new FileNotFoundException("Could not locate src\\NT8.Adapters\\Strategies\\" + fileName + " from test output directory.");
}
private static string ExtractPropertyBlock(string source, string propertyName)
{
string signature = "public";
int property = source.IndexOf(propertyName + " { get; set; }", StringComparison.Ordinal);
if (property < 0)
Assert.Fail("Property not found: " + propertyName);
int start = source.LastIndexOf("[NinjaScriptProperty]", property, StringComparison.Ordinal);
if (start < 0)
Assert.Fail("Property missing NinjaScriptProperty attribute: " + propertyName);
int end = source.IndexOf(signature, property, StringComparison.Ordinal);
if (end < 0)
Assert.Fail("Property declaration not found: " + propertyName);
end = source.IndexOf(";", end, StringComparison.Ordinal);
if (end < 0)
Assert.Fail("Property declaration terminator not found: " + propertyName);
return source.Substring(start, end - start + 1);
}
private static string ExtractMethodBlock(string source, string signature)
{
int start = source.IndexOf(signature, StringComparison.Ordinal);
if (start < 0)
Assert.Fail("Source does not contain method: " + signature);
int brace = source.IndexOf("{", start, StringComparison.Ordinal);
if (brace < 0)
Assert.Fail("Method has no opening brace: " + signature);
int depth = 0;
for (int i = brace; i < source.Length; i++)
{
if (source[i] == '{')
depth++;
else if (source[i] == '}')
{
depth--;
if (depth == 0)
return source.Substring(start, i - start + 1);
}
}
Assert.Fail("Method has no closing brace: " + signature);
return string.Empty;
}
}
}