AI trading missing data policies should distinguish a verified zero from an absent field, an old observation and an unavailable source. Assign each required input an explicit status and a permitted outcome before evaluation. An unknown input must not become zero, a negative signal or permission to trade. Research may continue with stated limitations, while new exposure waits for the evidence its rules require.
A missing funding value can mean an unsupported product, a failed request or a field the parser lost. Those explanations require different repairs. A fluent AI summary cannot determine which one occurred from a blank cell. The useful output is a reasoned state and a permitted next action.
Four conditions that a blank cell conceals
The following distinctions describe a general workflow design, not KLINEO configuration options or exchange-wide conventions.
| Condition | What the record establishes | Appropriate policy question |
|---|---|---|
| Observed zero | A successful, correctly scoped response explicitly reports numeric zero for this field | Is zero valid under this field's definition, and what does the rule do with it? |
| Missing | A required field or expected observation is absent | Was it omitted, lost during transformation, or never produced? |
| Stale | A retained observation exists but exceeds the decision's age or interval requirement | May it appear as historical context, and which actions must wait? |
| Unavailable | The required source or capability cannot currently supply an observation | Is recovery possible, or does this request require a different supported scope? |
These are related dimensions rather than four exclusive database values. A source can be unavailable while its cached value is stale. Preserve both facts. Likewise, a timestamp can be missing from an otherwise numeric response, leaving freshness unverified.
Representing absence explicitly helps. The JSON Schema reference on null distinguishes a present property containing null from an absent property. Neither is the numeric value 0. Your adapter still needs to define what each provider representation means; a schema alone cannot tell you why the observation is absent.
A zero balance can be valid. A zero price may violate the particular price field's contract. An empty list can mean “no matching records” only after checking request scope, response success and completeness. It cannot automatically prove that an account has no orders or exposure.
Give each input a contract and an owner
For every decision input, record its exact market and account scope where relevant, source, unit, observation time, receive time, validation status and reason code. Keep the original representation alongside the normalized value. Mark derived and substituted values so later nodes cannot mistake them for source observations.
Then define the input's role: required for a new entry, required for a protective action, or optional context. “Optional” is a decision made when designing the workflow. It must not become a label added after the feed fails.
The market-data freshness guide explains how to select the observation and age measure. Here the additional question is what the workflow may do when that requirement fails. A useful policy records all of the following:
- The valid domain, including whether zero is meaningful.
- The completeness and freshness requirements.
- The reason codes for failure, such as field absent, permission denied or history incomplete.
- The permitted fallback, its provenance and its expiry.
- The actions allowed during the gap and the evidence required to resume.
“Use the latest value” is incomplete unless it identifies which value, how old it may be and whether a delayed response may replace it. “Ask the AI” is incomplete unless the AI receives the actual status and has bounded authority.
A missing denominator can manufacture a passing signal
Consider a hypothetical research rule for one spot market: the current completed candle's volume must be at least 1.2 times the mean of the preceding four completed, consecutive candles. The required historical volumes are 8, 10, missing and 14 BTC. Current volume is 12 BTC. All values and thresholds are invented for this worksheet.
| Treatment | Baseline calculation | Apparent ratio | What the workflow should conclude |
|---|---|---|---|
| Replace missing with zero | (8 + 10 + 0 + 14) / 4 = 8 | 12 / 8 = 1.5 | This manufactures a passing result from an unobserved zero |
| Skip the missing candle | (8 + 10 + 14) / 3 ≈ 10.6667 | 12 / (32 / 3) = 1.125 | This computes a different, three-observation rule |
| Preserve the requirement | Four consecutive verified volumes are required | Unknown | Leave this condition unevaluated; block the new entry |
| Recover a verified value of 20 BTC | (8 + 10 + 20 + 14) / 4 = 13 | 12 / 13 ≈ 0.9231 | The complete example fails the 1.2 condition |
The recovered value illustrates one possible resolution, not a prediction of what missing data contains. If the absent observation were genuinely zero, the first calculation would be numerically correct only after verifying that fact and its scope.
Library defaults need inspection too. The pandas missing-data guide documents missing-value propagation and notes that reductions such as a mean generally skip missing values by default. A successful calculation therefore does not establish that your required sample was complete. Validate the expected count and interval continuity before accepting the statistic.
Provider behavior matters. Coinbase Exchange's candle documentation warns that historical data may be incomplete and that intervals without ticks do not receive published data. An absent bucket from that endpoint cannot, by itself, identify an outage or establish a zero-volume source candle. The backtest data-quality audit covers historical gap investigation and constructed records in greater depth.
Permit a bounded answer without granting execution authority
Suppose price and required volume history are valid, but an optional news source is unavailable. A research response can explain the measured signal and state that news context was not checked. It should remove claims that depend on that source. “No relevant news found” would imply a completed search; “news source unavailable” describes the actual evidence.
If the missing input is required account exposure, the permitted outcome changes. The workflow cannot verify whether a proposed order respects its exposure cap. A new-entry decision remains blocked even if market analysis is otherwise complete. Do not convert an unavailable account response into a zero position.
This does not justify disabling every existing exit. Define a separate incident policy for positions and protective orders already at the exchange. Confirm their actual status and use an authorized recovery path with the information that action requires. A missing-input gate for new risk does not prove that existing risk is protected or resolved.
The AI analysis review checklist helps separate evidence, interpretation and execution. Keep that separation in the run record: analysis completed with limitations, entry condition unknown, and no new order authorized can all be true simultaneously.
Test the policy by changing the evidence
Build fixtures that hold the trading idea constant while changing one input: numeric zero, explicit null, omitted field, stale timestamp, permission failure and interrupted history. Assert both the visible reason and the permitted action. Also test a valid zero denominator: a ratio may be undefined even though every input was observed correctly.
Use workflow simulation branches to test those decision paths and forbidden actions. For temporary retrieval failures, the research-tool timeout guide covers deadlines and degraded answers. Neither a later response nor a retry should silently replace the evidence attached to an already recorded decision.
Resume only after validating the repaired input, its freshness and any lookback affected by the gap. Save the policy version and the before-and-after reason. A summary that says only “data restored” hides whether the correct symbol, account and required history were restored.
Editorial method: prepared with AI assistance using the primary documentation linked above. The four-condition framework and volume worksheet are original educational constructions. No live feed, trading outcome or KLINEO implementation of this policy was tested.
