7.0 KiB
7.0 KiB
Common Compile Failures
Last Updated: 2026-04-05
Record concise error fingerprints and verified fixes.
Entry Template
- Date: YYYY-MM-DD
- Error:
CSXXXX - Fingerprint: file + line + short symptom
- Root cause: one sentence
- Fix: one to three concrete steps
- Prevention link: guardrail/pattern doc entry added
Starter Examples
-
CS0115no suitable method found to override- Root cause: incorrect NT8 override signature.
- Fix: replace with exact official signature; recompile.
-
CS0507cannot change access modifiers when overriding- Root cause: used
public override/private overrideinstead ofprotected override. - Fix: change to
protected override; recompile.
- Root cause: used
-
CS0246type or namespace not found- Root cause: missing using/namespace or undefined domain type.
- Fix: add correct namespace reference or confirmed type definition.
-
CS1503argument type mismatch- Root cause: wrong overload or argument ordering.
- Fix: align call with exact method signature and parameter types.
-
MaxDailyTrades overlap: second trade fires while first position still open
- Root cause:
_tradeTakenre-arm inSimpleORBStrategyis bar-driven, not position-close-driven. The strategy re-arms on the next bar after generating an intent, regardless of whether NT8 has closed the previous position. - Risk: only relevant when
MaxDailyTrades > 1. With defaultMaxDailyTrades=1this cannot occur. - Mitigation (SIM):
MaxOpenPositionsandDailyLossLimitin NT8 adapter limit exposure. - Fix (pre-live): wire re-arm to position-close callback in
NT8StrategyBase. See DEC-20260429-01 indocs/00-governance/decisions.md.
- Root cause:
-
C# 6+ syntax in C# 5 project
- Root cause: use of
$"",?.,nameof, expression-bodied members, etc. - Fix: rewrite using C# 5 compatible constructs.
- Root cause: use of
New Entries
- Post-task build verification skipped -- build broken after task completion
- Date: 2026-07-13
- Error:
CS0101(duplicateRunnerModeenum),CS0101(duplicateRunnerActivationModeproperty),CS1513(unbalanced#region/#endregion) - Fingerprint:
NT8StrategyBase.cs~line 249 (nested enum), ~line 279 (duplicate property), ~line 281 (extra#endregion) - Root cause: Post-task build verification (
verify-build.bat+dotnet test) was skipped after a previous task. Duplicate enum/property and unbalanced#region/#endregioncompiled in IDE with Roslyn leniency but failed the strict dotnet CLI build used by NT8 SDK CI. - Fix: Removed nested
RunnerModeenum (keep namespace-level at line ~35), removed duplicateRunnerActivationModeproperty (keep[NinjaScriptProperty]version at line ~181), removed extra#endregionat line 281. Ranverify-build.bat+dotnet test-- 492 tests passed (10 perf + 78 integration + 404 core). - Prevention link: Add mandatory
verify-build.bat && dotnet test --verbosity minimalstep to every task completion checklist indocs/00-governance/decisions.mdand sprint templates.
2026-08-03 [GAP-031] — Trade provenance wrote defaults instead of submitted values
- Root cause: The JSONL writer read confluence values from static strategy configuration and recomputed runner mode with quantity
1, while the session logger used accepted intent metadata and the actual resolved submission mode. - Fix: Serialize from the accepted
StrategyIntent.Metadataand pass the submission'sresolvedModeinto the provenance writer. - Prevention: Logging artifacts for a submitted trade must consume the same immutable decision/submission objects used by the human-readable session log.
2026-08-14 [GAP-036] — Provenance field sourced from the wrong dictionary
- Fingerprint:
risk_modeserializes as"Unknown"on every trade despite a real resolved mode existing at signal time. - Root cause:
GetRiskMode()reads_strategyConfig.Parameters["risk_mode"], but the SDK writes risk mode tocandidate.Metadata["risk_mode"]. Two different dictionaries. The key is never present inParameters, so the lookup silently falls through to the"Unknown"default. - Fix: Source from
intent.Metadata["risk_mode"], retainingParametersas fallback. - Prevention: A provenance field sourced from the wrong dictionary fails silently as
a plausible default value, not as an error. Any field that can legitimately hold a
sentinel (
"Unknown",0.0,"None") must have a round-trip test asserting a real value survives serialization. GAP-031 fixed four such fields and missed this one because the prompt enumerated fields by name rather than auditing every consumer of theParameters/Metadatasplit.
2026-08-14 [GAP-034] — Rejection reasons invisible in session logs
- Fingerprint: Zero trades on days with clear breakouts; session log shows only SESSION START and readiness lines, with no indication of why.
- Root cause:
FileLogwrites tosession_*.log;_logger.LogInformationwrites to the NT8 Output window. Every signal-rejection reason (grade filter,MaxDailyTrades, ORB range, RTH guard) routes through_loggeronly. If the Output window was not open, the reason is permanently lost. - Diagnostic value of absence:
ProcessStrategyIntentdoesFileLogaSIGNAL:line for every realtime intent. Absence ofSIGNAL:therefore proves no intent was produced and isolates the fault upstream of the execution pipeline. This is a usable bisection point. - Fix: Route all rejection reasons to
FileLogalongside_logger(GAP-035). - Prevention: Any decision that can silently suppress a trade must be durably logged to disk. An ephemeral UI window is not an audit trail.
2026-08-14 — Backtest/live divergence from secondary-series warm-up
- Fingerprint: A day that traded live produces zero trades when backtested alone.
- Root cause: In Strategy Analyzer the secondary daily series loads only from the
backtest start date.
BuildDailyBarContextreturnsCount=0below 2 daily bars, so daily-dependent confluence factors score neutral and the composite falls under the Grade A threshold. Separately, the regime gate requires 50 daily bars and never arms. Neither path errors; the NR7 advisory deliberately does not block. - Fix (workflow, not code): Start backtests 60+ trading days before the target day. Enable Tick Replay when using non-time-based bars, or bar construction will differ from live regardless of warm-up.
- Prevention: A zero-trade backtest is not evidence of no signal. Verify warm-up counts before interpreting any backtest result.
2026-08-03 [GAP-032] — Position-flat event bypassed MaxDailyTrades
- Root cause: Position closure cleared
_tradeTaken, while the daily-limit guard required both_tradeTakenand a count at the limit. - Fix: Make
_dailyTradeCount >= MaxDailyTradesauthoritative and reset the count only in session rollover handling. - Prevention: Daily eligibility counters must be scoped to trading date, never position lifecycle.