Interface Notice
- All Known Implementing Classes:
IndicatorNotice, StrategyNotice
Exists because a log line is not reachable by the person who needs it. A strategy submitted
over the API runs on a worker whose logs the author never sees, so a condition that only produced
a WARN would be invisible exactly where it matters most. A notice is data: it can
be read locally, returned alongside a backtest result, or surfaced in a UI.
Notices describe the run, not the market. "This indicator needs bar data but is bound to a ticker stream" and "the market-data source died, so this strategy is blind" are notices; "RSI crossed 70" is a signal.
Implementations add whatever their scope needs — an indicator notice names the indicator and the instrument it concerns, a strategy-wide one has neither. That is why this base carries only what every notice can honestly answer; do not push a field up here that some implementation would have to leave null.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumSeverity, ordered least to most serious. -
Method Summary
Modifier and TypeMethodDescriptioncode()Stable, greppable identifier of the condition — clients may switch on it, so treat it as API.default Objectkey()What makes this notice unique.level()How much attention this deserves.message()Human-readable explanation, safe to show to a strategy author: it should say what is wrong and what to do about it, without assuming access to engine internals or logs.
-
Method Details
-
level
-
code
String code()Stable, greppable identifier of the condition — clients may switch on it, so treat it as API. Dotted and namespaced by origin, e.g.indicator.bar-data-on-ticker-path.- Returns:
- the notice code
-
message
String message()Human-readable explanation, safe to show to a strategy author: it should say what is wrong and what to do about it, without assuming access to engine internals or logs.- Returns:
- the message
-
key
What makes this notice unique. Two notices sharing a key are the same diagnostic reported twice — the same problem seen again — so a collector keys on this to report it once.Defaults to the code, which is right for conditions a run can only have one of (its market-data source either died or did not). Implementations whose condition can occur several times independently must narrow it: an indicator notice keys on (code, indicator) and a property notice on (code, property), otherwise the second offender would be swallowed by the first.
- Returns:
- this notice's identity, for deduplication
-