What comes back
Illustrative example. The figures are hypothetical, not a recommendation.
checked_at and starts with a summary: one line with the number of rules outside their range before and after the change, how many are newly or further outside, and how many are back inside. It adds a note when no rule was checked, when cash would fall below 0, or when within_rules is false only because rules already outside stay outside.
The rules list
rules lists only the rules outside their range before or after the change, with newly_outside first, then further_outside, still_outside and back_inside, and class bands before size rules inside each. Rules that stay inside are counted in rules_judged_count and not listed.
kindisclass_band,position_size(a long, judged against the class’s size range) orshort_position_size(a short, judged against its short size range). Both size kinds judge the size without its sign.- Percentages are shares of total value: priced non-cash holdings plus the cash row. A class’s total is the net of its holdings, so a short subtracts, and a total below zero counts as 0.
gap_before_ptsandgap_after_ptsare the distance outside the range in percentage points, 0 when inside. A percent within 0.01 of a point of an edge counts as inside, andfurther_outsideneeds a gap more than 0.01 of a point larger than before. The gap itself is reported as measured.shares_afteris signed, so a negative number is a short. A change worth 100000000000000 or more is refused withINVALID_INPUT, and so is a portfolio worth nothing or less at the prices you gave.
How to read change
Each row in rules has one of four words. They describe a rule’s distance from its range. They say nothing about the trade.
A holding sold to zero is no longer judged on size, so a size breach it had is
back_inside. A holding added for the first time wasn’t judged on size before, so a size breach it creates is newly_outside.
A holding sold past zero becomes a short, and it is judged on the side it ends on, so a size breach it had as a long is not listed as back_inside. If its class has no short size range, the symbol appears in not_covered.
The two questions
newly_or_further_outside_count and within_rules answer different questions.
newly_or_further_outside_countcounts thenewly_outsideandfurther_outsiderows. It answers: did this change add a breach or deepen one. A script that wants to avoid both can check that it equals 0, and readnot_coveredfor what no rule judged.within_rulesanswers: is the whole book inside every rule after the change. It istrueonly when no rule is outside its range after the change,rules_judged_countis above 0, andcash.sufficientistrue. A breach that already existed keeps itfalse.
within_rules: false as “not confirmed”, never as a block Allocait enforces. false with rules_judged_count: 0 means no rule was checked. true says nothing about anything no rule covers.
What no rule covered
not_covered has one entry for each changed symbol whose class has no band in the scenario (NO_CLASS_RULE), or has a band but no size range for the side it ends on (NO_SIZE_RANGE: a long needs a position size, a short a short size; a symbol sold to zero from a short is named only when the class has neither).
It also lists each holding the change does not touch that no band judges (NO_CLASS_RULE, traded: false), as /compliance/check lists it as unchecked. It is there so within_rules: true is never read as “a rule looked at this symbol”.
Exposure after the change
exposure_after says how much of the book gains if prices rise once the whole change is applied. It is a reading beside the rules, and within_rules doesn’t read it. See Exposure.
Related
Check a change
What to send and how a failed call reads.
Status words
What the status values mean.
Shorts
How a negative share count is judged.
Options
How options are priced and expire.