openalgo-script 0.1.0-alpha.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1200 -0
- package/README.md +49 -28
- package/dist/adapters/charts/alerts.d.ts +70 -0
- package/dist/adapters/charts/alerts.d.ts.map +1 -0
- package/dist/adapters/charts/alerts.js +52 -0
- package/dist/adapters/charts/alerts.js.map +1 -0
- package/dist/adapters/charts/bars.d.ts +39 -0
- package/dist/adapters/charts/bars.d.ts.map +1 -0
- package/dist/adapters/charts/bars.js +32 -0
- package/dist/adapters/charts/bars.js.map +1 -0
- package/dist/adapters/charts/candles.d.ts +40 -0
- package/dist/adapters/charts/candles.d.ts.map +1 -0
- package/dist/adapters/charts/candles.js +85 -0
- package/dist/adapters/charts/candles.js.map +1 -0
- package/dist/adapters/charts/colours.d.ts +47 -0
- package/dist/adapters/charts/colours.d.ts.map +1 -0
- package/dist/adapters/charts/colours.js +80 -0
- package/dist/adapters/charts/colours.js.map +1 -0
- package/dist/adapters/charts/columns.d.ts +37 -0
- package/dist/adapters/charts/columns.d.ts.map +1 -0
- package/dist/adapters/charts/columns.js +56 -0
- package/dist/adapters/charts/columns.js.map +1 -0
- package/dist/adapters/charts/contract.d.ts +278 -0
- package/dist/adapters/charts/contract.d.ts.map +1 -0
- package/dist/adapters/charts/contract.js +2 -0
- package/dist/adapters/charts/contract.js.map +1 -0
- package/dist/adapters/charts/descriptor.d.ts +48 -0
- package/dist/adapters/charts/descriptor.d.ts.map +1 -0
- package/dist/adapters/charts/descriptor.js +111 -0
- package/dist/adapters/charts/descriptor.js.map +1 -0
- package/dist/adapters/charts/drawings.d.ts +43 -0
- package/dist/adapters/charts/drawings.d.ts.map +1 -0
- package/dist/adapters/charts/drawings.js +172 -0
- package/dist/adapters/charts/drawings.js.map +1 -0
- package/dist/adapters/charts/errors.d.ts +28 -0
- package/dist/adapters/charts/errors.d.ts.map +1 -0
- package/dist/adapters/charts/errors.js +21 -0
- package/dist/adapters/charts/errors.js.map +1 -0
- package/dist/adapters/charts/fields.d.ts +33 -0
- package/dist/adapters/charts/fields.d.ts.map +1 -0
- package/dist/adapters/charts/fields.js +51 -0
- package/dist/adapters/charts/fields.js.map +1 -0
- package/dist/adapters/charts/fills.d.ts +23 -0
- package/dist/adapters/charts/fills.d.ts.map +1 -0
- package/dist/adapters/charts/fills.js +48 -0
- package/dist/adapters/charts/fills.js.map +1 -0
- package/dist/adapters/charts/index.d.ts +37 -0
- package/dist/adapters/charts/index.d.ts.map +1 -0
- package/dist/adapters/charts/index.js +33 -0
- package/dist/adapters/charts/index.js.map +1 -0
- package/dist/adapters/charts/levels.d.ts +39 -0
- package/dist/adapters/charts/levels.d.ts.map +1 -0
- package/dist/adapters/charts/levels.js +61 -0
- package/dist/adapters/charts/levels.js.map +1 -0
- package/dist/adapters/charts/markers.d.ts +41 -0
- package/dist/adapters/charts/markers.d.ts.map +1 -0
- package/dist/adapters/charts/markers.js +75 -0
- package/dist/adapters/charts/markers.js.map +1 -0
- package/dist/adapters/charts/paint.d.ts +61 -0
- package/dist/adapters/charts/paint.d.ts.map +1 -0
- package/dist/adapters/charts/paint.js +47 -0
- package/dist/adapters/charts/paint.js.map +1 -0
- package/dist/adapters/charts/plots.d.ts +39 -0
- package/dist/adapters/charts/plots.d.ts.map +1 -0
- package/dist/adapters/charts/plots.js +117 -0
- package/dist/adapters/charts/plots.js.map +1 -0
- package/dist/adapters/charts/produced.d.ts +57 -0
- package/dist/adapters/charts/produced.d.ts.map +1 -0
- package/dist/adapters/charts/produced.js +11 -0
- package/dist/adapters/charts/produced.js.map +1 -0
- package/dist/adapters/charts/requests.d.ts +114 -0
- package/dist/adapters/charts/requests.d.ts.map +1 -0
- package/dist/adapters/charts/requests.js +277 -0
- package/dist/adapters/charts/requests.js.map +1 -0
- package/dist/adapters/charts/run.d.ts +147 -0
- package/dist/adapters/charts/run.d.ts.map +1 -0
- package/dist/adapters/charts/run.js +148 -0
- package/dist/adapters/charts/run.js.map +1 -0
- package/dist/adapters/charts/settings.d.ts +78 -0
- package/dist/adapters/charts/settings.d.ts.map +1 -0
- package/dist/adapters/charts/settings.js +225 -0
- package/dist/adapters/charts/settings.js.map +1 -0
- package/dist/adapters/charts/surfaces.d.ts +204 -0
- package/dist/adapters/charts/surfaces.d.ts.map +1 -0
- package/dist/adapters/charts/surfaces.js +2 -0
- package/dist/adapters/charts/surfaces.js.map +1 -0
- package/dist/adapters/charts/tables.d.ts +65 -0
- package/dist/adapters/charts/tables.d.ts.map +1 -0
- package/dist/adapters/charts/tables.js +84 -0
- package/dist/adapters/charts/tables.js.map +1 -0
- package/dist/core/catalogue/catalogue.generated.d.ts +98 -10
- package/dist/core/catalogue/catalogue.generated.d.ts.map +1 -1
- package/dist/core/catalogue/catalogue.generated.js +17 -9
- package/dist/core/catalogue/catalogue.generated.js.map +1 -1
- package/dist/core/catalogue/values.generated.d.ts +25 -0
- package/dist/core/catalogue/values.generated.d.ts.map +1 -1
- package/dist/core/check/arguments.d.ts +41 -0
- package/dist/core/check/arguments.d.ts.map +1 -0
- package/dist/core/check/arguments.js +84 -0
- package/dist/core/check/arguments.js.map +1 -0
- package/dist/core/check/call-sites.d.ts +22 -0
- package/dist/core/check/call-sites.d.ts.map +1 -0
- package/dist/core/check/call-sites.js +329 -0
- package/dist/core/check/call-sites.js.map +1 -0
- package/dist/core/check/call-warmup.d.ts +37 -0
- package/dist/core/check/call-warmup.d.ts.map +1 -0
- package/dist/core/check/call-warmup.js +97 -0
- package/dist/core/check/call-warmup.js.map +1 -0
- package/dist/core/check/calls.d.ts +33 -0
- package/dist/core/check/calls.d.ts.map +1 -0
- package/dist/core/check/calls.js +348 -0
- package/dist/core/check/calls.js.map +1 -0
- package/dist/core/check/check.d.ts +23 -0
- package/dist/core/check/check.d.ts.map +1 -0
- package/dist/core/check/check.js +163 -0
- package/dist/core/check/check.js.map +1 -0
- package/dist/core/check/checked.d.ts +198 -0
- package/dist/core/check/checked.d.ts.map +1 -0
- package/dist/core/check/checked.js +19 -0
- package/dist/core/check/checked.js.map +1 -0
- package/dist/core/check/checker.d.ts +182 -0
- package/dist/core/check/checker.d.ts.map +1 -0
- package/dist/core/check/checker.js +280 -0
- package/dist/core/check/checker.js.map +1 -0
- package/dist/core/check/conditional.d.ts +35 -0
- package/dist/core/check/conditional.d.ts.map +1 -0
- package/dist/core/check/conditional.js +100 -0
- package/dist/core/check/conditional.js.map +1 -0
- package/dist/core/check/constant.d.ts +47 -0
- package/dist/core/check/constant.d.ts.map +1 -0
- package/dist/core/check/constant.js +101 -0
- package/dist/core/check/constant.js.map +1 -0
- package/dist/core/check/declaration.d.ts +33 -0
- package/dist/core/check/declaration.d.ts.map +1 -0
- package/dist/core/check/declaration.js +181 -0
- package/dist/core/check/declaration.js.map +1 -0
- package/dist/core/check/expressions.d.ts +36 -0
- package/dist/core/check/expressions.d.ts.map +1 -0
- package/dist/core/check/expressions.js +398 -0
- package/dist/core/check/expressions.js.map +1 -0
- package/dist/core/check/functions.d.ts +31 -0
- package/dist/core/check/functions.d.ts.map +1 -0
- package/dist/core/check/functions.js +238 -0
- package/dist/core/check/functions.js.map +1 -0
- package/dist/core/check/handles.d.ts +48 -0
- package/dist/core/check/handles.d.ts.map +1 -0
- package/dist/core/check/handles.js +43 -0
- package/dist/core/check/handles.js.map +1 -0
- package/dist/core/check/index.d.ts +30 -0
- package/dist/core/check/index.d.ts.map +1 -0
- package/dist/core/check/index.js +26 -0
- package/dist/core/check/index.js.map +1 -0
- package/dist/core/check/library-bars.d.ts +7 -0
- package/dist/core/check/library-bars.d.ts.map +1 -0
- package/dist/core/check/library-bars.js +181 -0
- package/dist/core/check/library-bars.js.map +1 -0
- package/dist/core/check/library-orders.d.ts +5 -0
- package/dist/core/check/library-orders.d.ts.map +1 -0
- package/dist/core/check/library-orders.js +250 -0
- package/dist/core/check/library-orders.js.map +1 -0
- package/dist/core/check/library-output.d.ts +7 -0
- package/dist/core/check/library-output.d.ts.map +1 -0
- package/dist/core/check/library-output.js +195 -0
- package/dist/core/check/library-output.js.map +1 -0
- package/dist/core/check/library-series.d.ts +3 -0
- package/dist/core/check/library-series.d.ts.map +1 -0
- package/dist/core/check/library-series.js +415 -0
- package/dist/core/check/library-series.js.map +1 -0
- package/dist/core/check/library.d.ts +204 -0
- package/dist/core/check/library.d.ts.map +1 -0
- package/dist/core/check/library.js +198 -0
- package/dist/core/check/library.js.map +1 -0
- package/dist/core/check/literals.d.ts +19 -0
- package/dist/core/check/literals.d.ts.map +1 -0
- package/dist/core/check/literals.js +22 -0
- package/dist/core/check/literals.js.map +1 -0
- package/dist/core/check/outputs.d.ts +31 -0
- package/dist/core/check/outputs.d.ts.map +1 -0
- package/dist/core/check/outputs.js +113 -0
- package/dist/core/check/outputs.js.map +1 -0
- package/dist/core/check/statements.d.ts +25 -0
- package/dist/core/check/statements.d.ts.map +1 -0
- package/dist/core/check/statements.js +377 -0
- package/dist/core/check/statements.js.map +1 -0
- package/dist/core/check/suggest.d.ts +25 -0
- package/dist/core/check/suggest.d.ts.map +1 -0
- package/dist/core/check/suggest.js +61 -0
- package/dist/core/check/suggest.js.map +1 -0
- package/dist/core/check/surface.d.ts +38 -0
- package/dist/core/check/surface.d.ts.map +1 -0
- package/dist/core/check/surface.js +100 -0
- package/dist/core/check/surface.js.map +1 -0
- package/dist/core/check/tags.d.ts +4 -0
- package/dist/core/check/tags.d.ts.map +1 -0
- package/dist/core/check/tags.js +54 -0
- package/dist/core/check/tags.js.map +1 -0
- package/dist/core/check/types.d.ts +153 -0
- package/dist/core/check/types.d.ts.map +1 -0
- package/dist/core/check/types.js +221 -0
- package/dist/core/check/types.js.map +1 -0
- package/dist/core/check/warmup.d.ts +73 -0
- package/dist/core/check/warmup.d.ts.map +1 -0
- package/dist/core/check/warmup.js +62 -0
- package/dist/core/check/warmup.js.map +1 -0
- package/dist/core/diagnostics/collector.d.ts +12 -0
- package/dist/core/diagnostics/collector.d.ts.map +1 -1
- package/dist/core/diagnostics/collector.js +27 -1
- package/dist/core/diagnostics/collector.js.map +1 -1
- package/dist/core/emit/calls.d.ts +38 -0
- package/dist/core/emit/calls.d.ts.map +1 -0
- package/dist/core/emit/calls.js +347 -0
- package/dist/core/emit/calls.js.map +1 -0
- package/dist/core/emit/canonical.d.ts +39 -0
- package/dist/core/emit/canonical.d.ts.map +1 -0
- package/dist/core/emit/canonical.js +71 -0
- package/dist/core/emit/canonical.js.map +1 -0
- package/dist/core/emit/channels.d.ts +28 -0
- package/dist/core/emit/channels.d.ts.map +1 -0
- package/dist/core/emit/channels.js +110 -0
- package/dist/core/emit/channels.js.map +1 -0
- package/dist/core/emit/code.d.ts +75 -0
- package/dist/core/emit/code.d.ts.map +1 -0
- package/dist/core/emit/code.js +104 -0
- package/dist/core/emit/code.js.map +1 -0
- package/dist/core/emit/colours.d.ts +35 -0
- package/dist/core/emit/colours.d.ts.map +1 -0
- package/dist/core/emit/colours.js +50 -0
- package/dist/core/emit/colours.js.map +1 -0
- package/dist/core/emit/context.d.ts +271 -0
- package/dist/core/emit/context.d.ts.map +1 -0
- package/dist/core/emit/context.js +358 -0
- package/dist/core/emit/context.js.map +1 -0
- package/dist/core/emit/defaults.d.ts +45 -0
- package/dist/core/emit/defaults.d.ts.map +1 -0
- package/dist/core/emit/defaults.js +116 -0
- package/dist/core/emit/defaults.js.map +1 -0
- package/dist/core/emit/emit.d.ts +13 -0
- package/dist/core/emit/emit.d.ts.map +1 -0
- package/dist/core/emit/emit.js +281 -0
- package/dist/core/emit/emit.js.map +1 -0
- package/dist/core/emit/events.d.ts +21 -0
- package/dist/core/emit/events.d.ts.map +1 -0
- package/dist/core/emit/events.js +112 -0
- package/dist/core/emit/events.js.map +1 -0
- package/dist/core/emit/expressions.d.ts +23 -0
- package/dist/core/emit/expressions.d.ts.map +1 -0
- package/dist/core/emit/expressions.js +253 -0
- package/dist/core/emit/expressions.js.map +1 -0
- package/dist/core/emit/functions.d.ts +30 -0
- package/dist/core/emit/functions.d.ts.map +1 -0
- package/dist/core/emit/functions.js +171 -0
- package/dist/core/emit/functions.js.map +1 -0
- package/dist/core/emit/gaps.d.ts +34 -0
- package/dist/core/emit/gaps.d.ts.map +1 -0
- package/dist/core/emit/gaps.js +16 -0
- package/dist/core/emit/gaps.js.map +1 -0
- package/dist/core/emit/index.d.ts +29 -0
- package/dist/core/emit/index.d.ts.map +1 -0
- package/dist/core/emit/index.js +23 -0
- package/dist/core/emit/index.js.map +1 -0
- package/dist/core/emit/inputs.d.ts +47 -0
- package/dist/core/emit/inputs.d.ts.map +1 -0
- package/dist/core/emit/inputs.js +150 -0
- package/dist/core/emit/inputs.js.map +1 -0
- package/dist/core/emit/layout.d.ts +73 -0
- package/dist/core/emit/layout.d.ts.map +1 -0
- package/dist/core/emit/layout.js +126 -0
- package/dist/core/emit/layout.js.map +1 -0
- package/dist/core/emit/meta.d.ts +14 -0
- package/dist/core/emit/meta.d.ts.map +1 -0
- package/dist/core/emit/meta.js +68 -0
- package/dist/core/emit/meta.js.map +1 -0
- package/dist/core/emit/opcodes.d.ts +28 -0
- package/dist/core/emit/opcodes.d.ts.map +1 -0
- package/dist/core/emit/opcodes.js +137 -0
- package/dist/core/emit/opcodes.js.map +1 -0
- package/dist/core/emit/outputs.d.ts +67 -0
- package/dist/core/emit/outputs.d.ts.map +1 -0
- package/dist/core/emit/outputs.js +293 -0
- package/dist/core/emit/outputs.js.map +1 -0
- package/dist/core/emit/pool.d.ts +33 -0
- package/dist/core/emit/pool.d.ts.map +1 -0
- package/dist/core/emit/pool.js +79 -0
- package/dist/core/emit/pool.js.map +1 -0
- package/dist/core/emit/program.d.ts +333 -0
- package/dist/core/emit/program.d.ts.map +1 -0
- package/dist/core/emit/program.js +15 -0
- package/dist/core/emit/program.js.map +1 -0
- package/dist/core/emit/registers.d.ts +35 -0
- package/dist/core/emit/registers.d.ts.map +1 -0
- package/dist/core/emit/registers.js +170 -0
- package/dist/core/emit/registers.js.map +1 -0
- package/dist/core/emit/request-scope.d.ts +36 -0
- package/dist/core/emit/request-scope.d.ts.map +1 -0
- package/dist/core/emit/request-scope.js +41 -0
- package/dist/core/emit/request-scope.js.map +1 -0
- package/dist/core/emit/requests.d.ts +69 -0
- package/dist/core/emit/requests.d.ts.map +1 -0
- package/dist/core/emit/requests.js +230 -0
- package/dist/core/emit/requests.js.map +1 -0
- package/dist/core/emit/requires.d.ts +4 -0
- package/dist/core/emit/requires.d.ts.map +1 -0
- package/dist/core/emit/requires.js +71 -0
- package/dist/core/emit/requires.js.map +1 -0
- package/dist/core/emit/sha256.d.ts +24 -0
- package/dist/core/emit/sha256.d.ts.map +1 -0
- package/dist/core/emit/sha256.js +109 -0
- package/dist/core/emit/sha256.js.map +1 -0
- package/dist/core/emit/statements.d.ts +20 -0
- package/dist/core/emit/statements.d.ts.map +1 -0
- package/dist/core/emit/statements.js +393 -0
- package/dist/core/emit/statements.js.map +1 -0
- package/dist/core/emit/values.d.ts +80 -0
- package/dist/core/emit/values.d.ts.map +1 -0
- package/dist/core/emit/values.js +242 -0
- package/dist/core/emit/values.js.map +1 -0
- package/dist/core/engine/alerts.d.ts +66 -0
- package/dist/core/engine/alerts.d.ts.map +1 -0
- package/dist/core/engine/alerts.js +119 -0
- package/dist/core/engine/alerts.js.map +1 -0
- package/dist/core/engine/arithmetic.d.ts +82 -0
- package/dist/core/engine/arithmetic.d.ts.map +1 -0
- package/dist/core/engine/arithmetic.js +141 -0
- package/dist/core/engine/arithmetic.js.map +1 -0
- package/dist/core/engine/bars.d.ts +95 -0
- package/dist/core/engine/bars.d.ts.map +1 -0
- package/dist/core/engine/bars.js +133 -0
- package/dist/core/engine/bars.js.map +1 -0
- package/dist/core/engine/budget.d.ts +162 -0
- package/dist/core/engine/budget.d.ts.map +1 -0
- package/dist/core/engine/budget.js +188 -0
- package/dist/core/engine/budget.js.map +1 -0
- package/dist/core/engine/channels.d.ts +106 -0
- package/dist/core/engine/channels.d.ts.map +1 -0
- package/dist/core/engine/channels.js +99 -0
- package/dist/core/engine/channels.js.map +1 -0
- package/dist/core/engine/drawings.d.ts +64 -0
- package/dist/core/engine/drawings.d.ts.map +1 -0
- package/dist/core/engine/drawings.js +67 -0
- package/dist/core/engine/drawings.js.map +1 -0
- package/dist/core/engine/engine.d.ts +140 -0
- package/dist/core/engine/engine.d.ts.map +1 -0
- package/dist/core/engine/engine.js +405 -0
- package/dist/core/engine/engine.js.map +1 -0
- package/dist/core/engine/errors.d.ts +64 -0
- package/dist/core/engine/errors.d.ts.map +1 -0
- package/dist/core/engine/errors.js +63 -0
- package/dist/core/engine/errors.js.map +1 -0
- package/dist/core/engine/frames.d.ts +48 -0
- package/dist/core/engine/frames.d.ts.map +1 -0
- package/dist/core/engine/frames.js +41 -0
- package/dist/core/engine/frames.js.map +1 -0
- package/dist/core/engine/grids.d.ts +25 -0
- package/dist/core/engine/grids.d.ts.map +1 -0
- package/dist/core/engine/grids.js +77 -0
- package/dist/core/engine/grids.js.map +1 -0
- package/dist/core/engine/guard.d.ts +4 -0
- package/dist/core/engine/guard.d.ts.map +1 -0
- package/dist/core/engine/guard.js +46 -0
- package/dist/core/engine/guard.js.map +1 -0
- package/dist/core/engine/host.d.ts +219 -0
- package/dist/core/engine/host.d.ts.map +1 -0
- package/dist/core/engine/host.js +38 -0
- package/dist/core/engine/host.js.map +1 -0
- package/dist/core/engine/index.d.ts +49 -0
- package/dist/core/engine/index.d.ts.map +1 -0
- package/dist/core/engine/index.js +33 -0
- package/dist/core/engine/index.js.map +1 -0
- package/dist/core/engine/inputs.d.ts +77 -0
- package/dist/core/engine/inputs.d.ts.map +1 -0
- package/dist/core/engine/inputs.js +205 -0
- package/dist/core/engine/inputs.js.map +1 -0
- package/dist/core/engine/ledger/call.d.ts +63 -0
- package/dist/core/engine/ledger/call.d.ts.map +1 -0
- package/dist/core/engine/ledger/call.js +136 -0
- package/dist/core/engine/ledger/call.js.map +1 -0
- package/dist/core/engine/ledger/closable.d.ts +155 -0
- package/dist/core/engine/ledger/closable.d.ts.map +1 -0
- package/dist/core/engine/ledger/closable.js +173 -0
- package/dist/core/engine/ledger/closable.js.map +1 -0
- package/dist/core/engine/ledger/holdings.d.ts +194 -0
- package/dist/core/engine/ledger/holdings.d.ts.map +1 -0
- package/dist/core/engine/ledger/holdings.js +237 -0
- package/dist/core/engine/ledger/holdings.js.map +1 -0
- package/dist/core/engine/ledger/index.d.ts +19 -0
- package/dist/core/engine/ledger/index.d.ts.map +1 -0
- package/dist/core/engine/ledger/index.js +2 -0
- package/dist/core/engine/ledger/index.js.map +1 -0
- package/dist/core/engine/ledger/intent.d.ts +106 -0
- package/dist/core/engine/ledger/intent.d.ts.map +1 -0
- package/dist/core/engine/ledger/intent.js +21 -0
- package/dist/core/engine/ledger/intent.js.map +1 -0
- package/dist/core/engine/ledger/ledger.d.ts +143 -0
- package/dist/core/engine/ledger/ledger.d.ts.map +1 -0
- package/dist/core/engine/ledger/ledger.js +237 -0
- package/dist/core/engine/ledger/ledger.js.map +1 -0
- package/dist/core/engine/ledger/place.d.ts +75 -0
- package/dist/core/engine/ledger/place.d.ts.map +1 -0
- package/dist/core/engine/ledger/place.js +174 -0
- package/dist/core/engine/ledger/place.js.map +1 -0
- package/dist/core/engine/ledger/positions.d.ts +68 -0
- package/dist/core/engine/ledger/positions.d.ts.map +1 -0
- package/dist/core/engine/ledger/positions.js +114 -0
- package/dist/core/engine/ledger/positions.js.map +1 -0
- package/dist/core/engine/ledger/refuse.d.ts +43 -0
- package/dist/core/engine/ledger/refuse.d.ts.map +1 -0
- package/dist/core/engine/ledger/refuse.js +329 -0
- package/dist/core/engine/ledger/refuse.js.map +1 -0
- package/dist/core/engine/ledger/row.d.ts +176 -0
- package/dist/core/engine/ledger/row.d.ts.map +1 -0
- package/dist/core/engine/ledger/row.js +169 -0
- package/dist/core/engine/ledger/row.js.map +1 -0
- package/dist/core/engine/ledger/sizing.d.ts +142 -0
- package/dist/core/engine/ledger/sizing.d.ts.map +1 -0
- package/dist/core/engine/ledger/sizing.js +223 -0
- package/dist/core/engine/ledger/sizing.js.map +1 -0
- package/dist/core/engine/library/arrays.d.ts +14 -0
- package/dist/core/engine/library/arrays.d.ts.map +1 -0
- package/dist/core/engine/library/arrays.js +285 -0
- package/dist/core/engine/library/arrays.js.map +1 -0
- package/dist/core/engine/library/averages.d.ts +9 -0
- package/dist/core/engine/library/averages.d.ts.map +1 -0
- package/dist/core/engine/library/averages.js +41 -0
- package/dist/core/engine/library/averages.js.map +1 -0
- package/dist/core/engine/library/binding.d.ts +230 -0
- package/dist/core/engine/library/binding.d.ts.map +1 -0
- package/dist/core/engine/library/binding.js +109 -0
- package/dist/core/engine/library/binding.js.map +1 -0
- package/dist/core/engine/library/chart.d.ts +3 -0
- package/dist/core/engine/library/chart.d.ts.map +1 -0
- package/dist/core/engine/library/chart.js +83 -0
- package/dist/core/engine/library/chart.js.map +1 -0
- package/dist/core/engine/library/colours.d.ts +26 -0
- package/dist/core/engine/library/colours.d.ts.map +1 -0
- package/dist/core/engine/library/colours.js +81 -0
- package/dist/core/engine/library/colours.js.map +1 -0
- package/dist/core/engine/library/dates.d.ts +3 -0
- package/dist/core/engine/library/dates.d.ts.map +1 -0
- package/dist/core/engine/library/dates.js +75 -0
- package/dist/core/engine/library/dates.js.map +1 -0
- package/dist/core/engine/library/index.d.ts +13 -0
- package/dist/core/engine/library/index.d.ts.map +1 -0
- package/dist/core/engine/library/index.js +86 -0
- package/dist/core/engine/library/index.js.map +1 -0
- package/dist/core/engine/library/maths.d.ts +3 -0
- package/dist/core/engine/library/maths.d.ts.map +1 -0
- package/dist/core/engine/library/maths.js +89 -0
- package/dist/core/engine/library/maths.js.map +1 -0
- package/dist/core/engine/library/objects.d.ts +3 -0
- package/dist/core/engine/library/objects.d.ts.map +1 -0
- package/dist/core/engine/library/objects.js +199 -0
- package/dist/core/engine/library/objects.js.map +1 -0
- package/dist/core/engine/library/oscillators.d.ts +3 -0
- package/dist/core/engine/library/oscillators.d.ts.map +1 -0
- package/dist/core/engine/library/oscillators.js +29 -0
- package/dist/core/engine/library/oscillators.js.map +1 -0
- package/dist/core/engine/library/ranges.d.ts +3 -0
- package/dist/core/engine/library/ranges.d.ts.map +1 -0
- package/dist/core/engine/library/ranges.js +23 -0
- package/dist/core/engine/library/ranges.js.map +1 -0
- package/dist/core/engine/library/series.d.ts +3 -0
- package/dist/core/engine/library/series.d.ts.map +1 -0
- package/dist/core/engine/library/series.js +46 -0
- package/dist/core/engine/library/series.js.map +1 -0
- package/dist/core/engine/library/state.d.ts +35 -0
- package/dist/core/engine/library/state.d.ts.map +1 -0
- package/dist/core/engine/library/state.js +19 -0
- package/dist/core/engine/library/state.js.map +1 -0
- package/dist/core/engine/library/studies.d.ts +3 -0
- package/dist/core/engine/library/studies.d.ts.map +1 -0
- package/dist/core/engine/library/studies.js +35 -0
- package/dist/core/engine/library/studies.js.map +1 -0
- package/dist/core/engine/library/text.d.ts +6 -0
- package/dist/core/engine/library/text.d.ts.map +1 -0
- package/dist/core/engine/library/text.js +280 -0
- package/dist/core/engine/library/text.js.map +1 -0
- package/dist/core/engine/library/trend.d.ts +3 -0
- package/dist/core/engine/library/trend.d.ts.map +1 -0
- package/dist/core/engine/library/trend.js +29 -0
- package/dist/core/engine/library/trend.js.map +1 -0
- package/dist/core/engine/library/volume.d.ts +3 -0
- package/dist/core/engine/library/volume.d.ts.map +1 -0
- package/dist/core/engine/library/volume.js +51 -0
- package/dist/core/engine/library/volume.js.map +1 -0
- package/dist/core/engine/load.d.ts +45 -0
- package/dist/core/engine/load.d.ts.map +1 -0
- package/dist/core/engine/load.js +60 -0
- package/dist/core/engine/load.js.map +1 -0
- package/dist/core/engine/machine.d.ts +107 -0
- package/dist/core/engine/machine.d.ts.map +1 -0
- package/dist/core/engine/machine.js +337 -0
- package/dist/core/engine/machine.js.map +1 -0
- package/dist/core/engine/memory.d.ts +60 -0
- package/dist/core/engine/memory.d.ts.map +1 -0
- package/dist/core/engine/memory.js +92 -0
- package/dist/core/engine/memory.js.map +1 -0
- package/dist/core/engine/operations.d.ts +62 -0
- package/dist/core/engine/operations.d.ts.map +1 -0
- package/dist/core/engine/operations.js +149 -0
- package/dist/core/engine/operations.js.map +1 -0
- package/dist/core/engine/orders.d.ts +56 -0
- package/dist/core/engine/orders.d.ts.map +1 -0
- package/dist/core/engine/orders.js +83 -0
- package/dist/core/engine/orders.js.map +1 -0
- package/dist/core/engine/registers.d.ts +50 -0
- package/dist/core/engine/registers.d.ts.map +1 -0
- package/dist/core/engine/registers.js +85 -0
- package/dist/core/engine/registers.js.map +1 -0
- package/dist/core/engine/request-body.d.ts +138 -0
- package/dist/core/engine/request-body.d.ts.map +1 -0
- package/dist/core/engine/request-body.js +227 -0
- package/dist/core/engine/request-body.js.map +1 -0
- package/dist/core/engine/request-plan.d.ts +79 -0
- package/dist/core/engine/request-plan.d.ts.map +1 -0
- package/dist/core/engine/request-plan.js +228 -0
- package/dist/core/engine/request-plan.js.map +1 -0
- package/dist/core/engine/requests.d.ts +105 -0
- package/dist/core/engine/requests.d.ts.map +1 -0
- package/dist/core/engine/requests.js +260 -0
- package/dist/core/engine/requests.js.map +1 -0
- package/dist/core/engine/results.d.ts +40 -0
- package/dist/core/engine/results.d.ts.map +1 -0
- package/dist/core/engine/results.js +2 -0
- package/dist/core/engine/results.js.map +1 -0
- package/dist/core/engine/series.d.ts +61 -0
- package/dist/core/engine/series.d.ts.map +1 -0
- package/dist/core/engine/series.js +41 -0
- package/dist/core/engine/series.js.map +1 -0
- package/dist/core/engine/session/hours.d.ts +49 -0
- package/dist/core/engine/session/hours.d.ts.map +1 -0
- package/dist/core/engine/session/hours.js +31 -0
- package/dist/core/engine/session/hours.js.map +1 -0
- package/dist/core/engine/session/index.d.ts +17 -0
- package/dist/core/engine/session/index.d.ts.map +1 -0
- package/dist/core/engine/session/index.js +3 -0
- package/dist/core/engine/session/index.js.map +1 -0
- package/dist/core/engine/session/record.d.ts +56 -0
- package/dist/core/engine/session/record.d.ts.map +1 -0
- package/dist/core/engine/session/record.js +165 -0
- package/dist/core/engine/session/record.js.map +1 -0
- package/dist/core/engine/session/spec.d.ts +19 -0
- package/dist/core/engine/session/spec.d.ts.map +1 -0
- package/dist/core/engine/session/spec.js +31 -0
- package/dist/core/engine/session/spec.js.map +1 -0
- package/dist/core/engine/timeframe.d.ts +59 -0
- package/dist/core/engine/timeframe.d.ts.map +1 -0
- package/dist/core/engine/timeframe.js +140 -0
- package/dist/core/engine/timeframe.js.map +1 -0
- package/dist/core/engine/types.d.ts +15 -0
- package/dist/core/engine/types.d.ts.map +1 -0
- package/dist/core/engine/types.js +2 -0
- package/dist/core/engine/types.js.map +1 -0
- package/dist/core/engine/values/heap.d.ts +134 -0
- package/dist/core/engine/values/heap.d.ts.map +1 -0
- package/dist/core/engine/values/heap.js +230 -0
- package/dist/core/engine/values/heap.js.map +1 -0
- package/dist/core/engine/values/index.d.ts +13 -0
- package/dist/core/engine/values/index.d.ts.map +1 -0
- package/dist/core/engine/values/index.js +3 -0
- package/dist/core/engine/values/index.js.map +1 -0
- package/dist/core/engine/values/value.d.ts +82 -0
- package/dist/core/engine/values/value.d.ts.map +1 -0
- package/dist/core/engine/values/value.js +134 -0
- package/dist/core/engine/values/value.js.map +1 -0
- package/dist/core/engine/verify-budgets.d.ts +35 -0
- package/dist/core/engine/verify-budgets.d.ts.map +1 -0
- package/dist/core/engine/verify-budgets.js +172 -0
- package/dist/core/engine/verify-budgets.js.map +1 -0
- package/dist/core/engine/verify-code.d.ts +32 -0
- package/dist/core/engine/verify-code.d.ts.map +1 -0
- package/dist/core/engine/verify-code.js +278 -0
- package/dist/core/engine/verify-code.js.map +1 -0
- package/dist/core/engine/verify-requests.d.ts +44 -0
- package/dist/core/engine/verify-requests.d.ts.map +1 -0
- package/dist/core/engine/verify-requests.js +220 -0
- package/dist/core/engine/verify-requests.js.map +1 -0
- package/dist/core/engine/verify-shape.d.ts +46 -0
- package/dist/core/engine/verify-shape.d.ts.map +1 -0
- package/dist/core/engine/verify-shape.js +147 -0
- package/dist/core/engine/verify-shape.js.map +1 -0
- package/dist/core/engine/verify-tables.d.ts +19 -0
- package/dist/core/engine/verify-tables.d.ts.map +1 -0
- package/dist/core/engine/verify-tables.js +171 -0
- package/dist/core/engine/verify-tables.js.map +1 -0
- package/dist/core/engine/verify.d.ts +19 -0
- package/dist/core/engine/verify.d.ts.map +1 -0
- package/dist/core/engine/verify.js +309 -0
- package/dist/core/engine/verify.js.map +1 -0
- package/dist/core/index.d.ts +61 -6
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +48 -6
- package/dist/core/index.js.map +1 -1
- package/dist/core/parse/expressions.js +1 -1
- package/dist/core/parse/expressions.js.map +1 -1
- package/dist/core/parse/names.d.ts +7 -1
- package/dist/core/parse/names.d.ts.map +1 -1
- package/dist/core/parse/names.js +28 -2
- package/dist/core/parse/names.js.map +1 -1
- package/dist/core/stdlib/averages/exponential.d.ts +51 -0
- package/dist/core/stdlib/averages/exponential.d.ts.map +1 -0
- package/dist/core/stdlib/averages/exponential.js +72 -0
- package/dist/core/stdlib/averages/exponential.js.map +1 -0
- package/dist/core/stdlib/averages/index.d.ts +7 -0
- package/dist/core/stdlib/averages/index.d.ts.map +1 -0
- package/dist/core/stdlib/averages/index.js +5 -0
- package/dist/core/stdlib/averages/index.js.map +1 -0
- package/dist/core/stdlib/averages/select.d.ts +35 -0
- package/dist/core/stdlib/averages/select.d.ts.map +1 -0
- package/dist/core/stdlib/averages/select.js +43 -0
- package/dist/core/stdlib/averages/select.js.map +1 -0
- package/dist/core/stdlib/averages/shaped.d.ts +61 -0
- package/dist/core/stdlib/averages/shaped.d.ts.map +1 -0
- package/dist/core/stdlib/averages/shaped.js +126 -0
- package/dist/core/stdlib/averages/shaped.js.map +1 -0
- package/dist/core/stdlib/averages/simple.d.ts +58 -0
- package/dist/core/stdlib/averages/simple.d.ts.map +1 -0
- package/dist/core/stdlib/averages/simple.js +92 -0
- package/dist/core/stdlib/averages/simple.js.map +1 -0
- package/dist/core/stdlib/calendar/civil.d.ts +56 -0
- package/dist/core/stdlib/calendar/civil.d.ts.map +1 -0
- package/dist/core/stdlib/calendar/civil.js +70 -0
- package/dist/core/stdlib/calendar/civil.js.map +1 -0
- package/dist/core/stdlib/calendar/fields.d.ts +36 -0
- package/dist/core/stdlib/calendar/fields.d.ts.map +1 -0
- package/dist/core/stdlib/calendar/fields.js +93 -0
- package/dist/core/stdlib/calendar/fields.js.map +1 -0
- package/dist/core/stdlib/calendar/format.d.ts +19 -0
- package/dist/core/stdlib/calendar/format.d.ts.map +1 -0
- package/dist/core/stdlib/calendar/format.js +51 -0
- package/dist/core/stdlib/calendar/format.js.map +1 -0
- package/dist/core/stdlib/calendar/index.d.ts +7 -0
- package/dist/core/stdlib/calendar/index.d.ts.map +1 -0
- package/dist/core/stdlib/calendar/index.js +5 -0
- package/dist/core/stdlib/calendar/index.js.map +1 -0
- package/dist/core/stdlib/calendar/zone.d.ts +53 -0
- package/dist/core/stdlib/calendar/zone.d.ts.map +1 -0
- package/dist/core/stdlib/calendar/zone.js +138 -0
- package/dist/core/stdlib/calendar/zone.js.map +1 -0
- package/dist/core/stdlib/index.d.ts +57 -0
- package/dist/core/stdlib/index.d.ts.map +1 -0
- package/dist/core/stdlib/index.js +51 -0
- package/dist/core/stdlib/index.js.map +1 -0
- package/dist/core/stdlib/maths/arithmetic.d.ts +38 -0
- package/dist/core/stdlib/maths/arithmetic.d.ts.map +1 -0
- package/dist/core/stdlib/maths/arithmetic.js +66 -0
- package/dist/core/stdlib/maths/arithmetic.js.map +1 -0
- package/dist/core/stdlib/maths/elementary.d.ts +65 -0
- package/dist/core/stdlib/maths/elementary.d.ts.map +1 -0
- package/dist/core/stdlib/maths/elementary.js +93 -0
- package/dist/core/stdlib/maths/elementary.js.map +1 -0
- package/dist/core/stdlib/maths/index.d.ts +4 -0
- package/dist/core/stdlib/maths/index.d.ts.map +1 -0
- package/dist/core/stdlib/maths/index.js +4 -0
- package/dist/core/stdlib/maths/index.js.map +1 -0
- package/dist/core/stdlib/maths/rounding.d.ts +43 -0
- package/dist/core/stdlib/maths/rounding.d.ts.map +1 -0
- package/dist/core/stdlib/maths/rounding.js +62 -0
- package/dist/core/stdlib/maths/rounding.js.map +1 -0
- package/dist/core/stdlib/momentum/convergence.d.ts +36 -0
- package/dist/core/stdlib/momentum/convergence.d.ts.map +1 -0
- package/dist/core/stdlib/momentum/convergence.js +48 -0
- package/dist/core/stdlib/momentum/convergence.js.map +1 -0
- package/dist/core/stdlib/momentum/index.d.ts +6 -0
- package/dist/core/stdlib/momentum/index.d.ts.map +1 -0
- package/dist/core/stdlib/momentum/index.js +6 -0
- package/dist/core/stdlib/momentum/index.js.map +1 -0
- package/dist/core/stdlib/momentum/pressure.d.ts +43 -0
- package/dist/core/stdlib/momentum/pressure.d.ts.map +1 -0
- package/dist/core/stdlib/momentum/pressure.js +103 -0
- package/dist/core/stdlib/momentum/pressure.js.map +1 -0
- package/dist/core/stdlib/momentum/rates.d.ts +74 -0
- package/dist/core/stdlib/momentum/rates.d.ts.map +1 -0
- package/dist/core/stdlib/momentum/rates.js +134 -0
- package/dist/core/stdlib/momentum/rates.js.map +1 -0
- package/dist/core/stdlib/momentum/rsi.d.ts +21 -0
- package/dist/core/stdlib/momentum/rsi.d.ts.map +1 -0
- package/dist/core/stdlib/momentum/rsi.js +30 -0
- package/dist/core/stdlib/momentum/rsi.js.map +1 -0
- package/dist/core/stdlib/momentum/stochastic.d.ts +44 -0
- package/dist/core/stdlib/momentum/stochastic.d.ts.map +1 -0
- package/dist/core/stdlib/momentum/stochastic.js +97 -0
- package/dist/core/stdlib/momentum/stochastic.js.map +1 -0
- package/dist/core/stdlib/series/changes.d.ts +59 -0
- package/dist/core/stdlib/series/changes.d.ts.map +1 -0
- package/dist/core/stdlib/series/changes.js +129 -0
- package/dist/core/stdlib/series/changes.js.map +1 -0
- package/dist/core/stdlib/series/conditions.d.ts +34 -0
- package/dist/core/stdlib/series/conditions.d.ts.map +1 -0
- package/dist/core/stdlib/series/conditions.js +52 -0
- package/dist/core/stdlib/series/conditions.js.map +1 -0
- package/dist/core/stdlib/series/extremes.d.ts +29 -0
- package/dist/core/stdlib/series/extremes.d.ts.map +1 -0
- package/dist/core/stdlib/series/extremes.js +62 -0
- package/dist/core/stdlib/series/extremes.js.map +1 -0
- package/dist/core/stdlib/series/index.d.ts +9 -0
- package/dist/core/stdlib/series/index.d.ts.map +1 -0
- package/dist/core/stdlib/series/index.js +7 -0
- package/dist/core/stdlib/series/index.js.map +1 -0
- package/dist/core/stdlib/series/pivots.d.ts +25 -0
- package/dist/core/stdlib/series/pivots.d.ts.map +1 -0
- package/dist/core/stdlib/series/pivots.js +42 -0
- package/dist/core/stdlib/series/pivots.js.map +1 -0
- package/dist/core/stdlib/series/statistics.d.ts +64 -0
- package/dist/core/stdlib/series/statistics.d.ts.map +1 -0
- package/dist/core/stdlib/series/statistics.js +148 -0
- package/dist/core/stdlib/series/statistics.js.map +1 -0
- package/dist/core/stdlib/series/totals.d.ts +68 -0
- package/dist/core/stdlib/series/totals.d.ts.map +1 -0
- package/dist/core/stdlib/series/totals.js +115 -0
- package/dist/core/stdlib/series/totals.js.map +1 -0
- package/dist/core/stdlib/trend/directional.d.ts +69 -0
- package/dist/core/stdlib/trend/directional.d.ts.map +1 -0
- package/dist/core/stdlib/trend/directional.js +151 -0
- package/dist/core/stdlib/trend/directional.js.map +1 -0
- package/dist/core/stdlib/trend/index.d.ts +4 -0
- package/dist/core/stdlib/trend/index.d.ts.map +1 -0
- package/dist/core/stdlib/trend/index.js +4 -0
- package/dist/core/stdlib/trend/index.js.map +1 -0
- package/dist/core/stdlib/trend/psar.d.ts +33 -0
- package/dist/core/stdlib/trend/psar.d.ts.map +1 -0
- package/dist/core/stdlib/trend/psar.js +86 -0
- package/dist/core/stdlib/trend/psar.js.map +1 -0
- package/dist/core/stdlib/trend/supertrend.d.ts +30 -0
- package/dist/core/stdlib/trend/supertrend.d.ts.map +1 -0
- package/dist/core/stdlib/trend/supertrend.js +65 -0
- package/dist/core/stdlib/trend/supertrend.js.map +1 -0
- package/dist/core/stdlib/values/bar.d.ts +39 -0
- package/dist/core/stdlib/values/bar.d.ts.map +1 -0
- package/dist/core/stdlib/values/bar.js +33 -0
- package/dist/core/stdlib/values/bar.js.map +1 -0
- package/dist/core/stdlib/values/index.d.ts +11 -0
- package/dist/core/stdlib/values/index.d.ts.map +1 -0
- package/dist/core/stdlib/values/index.js +6 -0
- package/dist/core/stdlib/values/index.js.map +1 -0
- package/dist/core/stdlib/values/lookback.d.ts +83 -0
- package/dist/core/stdlib/values/lookback.d.ts.map +1 -0
- package/dist/core/stdlib/values/lookback.js +134 -0
- package/dist/core/stdlib/values/lookback.js.map +1 -0
- package/dist/core/stdlib/values/region.d.ts +55 -0
- package/dist/core/stdlib/values/region.d.ts.map +1 -0
- package/dist/core/stdlib/values/region.js +73 -0
- package/dist/core/stdlib/values/region.js.map +1 -0
- package/dist/core/stdlib/values/tail.d.ts +44 -0
- package/dist/core/stdlib/values/tail.d.ts.map +1 -0
- package/dist/core/stdlib/values/tail.js +23 -0
- package/dist/core/stdlib/values/tail.js.map +1 -0
- package/dist/core/stdlib/values/value.d.ts +64 -0
- package/dist/core/stdlib/values/value.d.ts.map +1 -0
- package/dist/core/stdlib/values/value.js +61 -0
- package/dist/core/stdlib/values/value.js.map +1 -0
- package/dist/core/stdlib/volatility/bands.d.ts +50 -0
- package/dist/core/stdlib/volatility/bands.d.ts.map +1 -0
- package/dist/core/stdlib/volatility/bands.js +101 -0
- package/dist/core/stdlib/volatility/bands.js.map +1 -0
- package/dist/core/stdlib/volatility/deviation.d.ts +43 -0
- package/dist/core/stdlib/volatility/deviation.d.ts.map +1 -0
- package/dist/core/stdlib/volatility/deviation.js +75 -0
- package/dist/core/stdlib/volatility/deviation.js.map +1 -0
- package/dist/core/stdlib/volatility/index.d.ts +6 -0
- package/dist/core/stdlib/volatility/index.d.ts.map +1 -0
- package/dist/core/stdlib/volatility/index.js +5 -0
- package/dist/core/stdlib/volatility/index.js.map +1 -0
- package/dist/core/stdlib/volatility/measures.d.ts +48 -0
- package/dist/core/stdlib/volatility/measures.d.ts.map +1 -0
- package/dist/core/stdlib/volatility/measures.js +73 -0
- package/dist/core/stdlib/volatility/measures.js.map +1 -0
- package/dist/core/stdlib/volatility/range.d.ts +69 -0
- package/dist/core/stdlib/volatility/range.d.ts.map +1 -0
- package/dist/core/stdlib/volatility/range.js +86 -0
- package/dist/core/stdlib/volatility/range.js.map +1 -0
- package/dist/core/stdlib/volume/accumulation.d.ts +61 -0
- package/dist/core/stdlib/volume/accumulation.d.ts.map +1 -0
- package/dist/core/stdlib/volume/accumulation.js +127 -0
- package/dist/core/stdlib/volume/accumulation.js.map +1 -0
- package/dist/core/stdlib/volume/flow.d.ts +60 -0
- package/dist/core/stdlib/volume/flow.d.ts.map +1 -0
- package/dist/core/stdlib/volume/flow.js +125 -0
- package/dist/core/stdlib/volume/flow.js.map +1 -0
- package/dist/core/stdlib/volume/index.d.ts +5 -0
- package/dist/core/stdlib/volume/index.d.ts.map +1 -0
- package/dist/core/stdlib/volume/index.js +4 -0
- package/dist/core/stdlib/volume/index.js.map +1 -0
- package/dist/core/stdlib/volume/weighted.d.ts +52 -0
- package/dist/core/stdlib/volume/weighted.d.ts.map +1 -0
- package/dist/core/stdlib/volume/weighted.js +64 -0
- package/dist/core/stdlib/volume/weighted.js.map +1 -0
- package/dist/core/version/version.generated.d.ts +2 -2
- package/dist/core/version/version.generated.d.ts.map +1 -1
- package/dist/core/version/version.generated.js +2 -2
- package/dist/core/version/version.generated.js.map +1 -1
- package/package.json +38 -14
- package/spec/errors.json +382 -183
- package/src/adapters/charts/alerts.ts +116 -0
- package/src/adapters/charts/bars.ts +63 -0
- package/src/adapters/charts/candles.ts +137 -0
- package/src/adapters/charts/colours.ts +113 -0
- package/src/adapters/charts/columns.ts +99 -0
- package/src/adapters/charts/contract.ts +320 -0
- package/src/adapters/charts/descriptor.ts +199 -0
- package/src/adapters/charts/drawings.ts +213 -0
- package/src/adapters/charts/errors.ts +45 -0
- package/src/adapters/charts/fields.ts +74 -0
- package/src/adapters/charts/fills.ts +71 -0
- package/src/adapters/charts/index.ts +78 -0
- package/src/adapters/charts/levels.ts +92 -0
- package/src/adapters/charts/markers.ts +119 -0
- package/src/adapters/charts/paint.ts +101 -0
- package/src/adapters/charts/plots.ts +185 -0
- package/src/adapters/charts/produced.ts +68 -0
- package/src/adapters/charts/requests.ts +357 -0
- package/src/adapters/charts/run.ts +327 -0
- package/src/adapters/charts/settings.ts +273 -0
- package/src/adapters/charts/surfaces.ts +238 -0
- package/src/adapters/charts/tables.ts +155 -0
- package/src/core/catalogue/catalogue.generated.ts +17 -9
- package/src/core/catalogue/values.generated.ts +8 -0
- package/src/core/check/arguments.ts +126 -0
- package/src/core/check/call-sites.ts +385 -0
- package/src/core/check/call-warmup.ts +121 -0
- package/src/core/check/calls.ts +412 -0
- package/src/core/check/check.ts +183 -0
- package/src/core/check/checked.ts +228 -0
- package/src/core/check/checker.ts +393 -0
- package/src/core/check/conditional.ts +143 -0
- package/src/core/check/constant.ts +127 -0
- package/src/core/check/declaration.ts +230 -0
- package/src/core/check/expressions.ts +471 -0
- package/src/core/check/functions.ts +283 -0
- package/src/core/check/handles.ts +75 -0
- package/src/core/check/index.ts +67 -0
- package/src/core/check/library-bars.ts +194 -0
- package/src/core/check/library-orders.ts +290 -0
- package/src/core/check/library-output.ts +241 -0
- package/src/core/check/library-series.ts +457 -0
- package/src/core/check/library.ts +374 -0
- package/src/core/check/literals.ts +35 -0
- package/src/core/check/outputs.ts +152 -0
- package/src/core/check/statements.ts +465 -0
- package/src/core/check/suggest.ts +63 -0
- package/src/core/check/surface.ts +115 -0
- package/src/core/check/tags.ts +94 -0
- package/src/core/check/types.ts +260 -0
- package/src/core/check/warmup.ts +100 -0
- package/src/core/diagnostics/collector.ts +27 -1
- package/src/core/emit/calls.ts +415 -0
- package/src/core/emit/canonical.ts +81 -0
- package/src/core/emit/channels.ts +144 -0
- package/src/core/emit/code.ts +155 -0
- package/src/core/emit/colours.ts +75 -0
- package/src/core/emit/context.ts +461 -0
- package/src/core/emit/defaults.ts +150 -0
- package/src/core/emit/emit.ts +313 -0
- package/src/core/emit/events.ts +141 -0
- package/src/core/emit/expressions.ts +292 -0
- package/src/core/emit/functions.ts +195 -0
- package/src/core/emit/gaps.ts +44 -0
- package/src/core/emit/index.ts +74 -0
- package/src/core/emit/inputs.ts +179 -0
- package/src/core/emit/layout.ts +165 -0
- package/src/core/emit/meta.ts +104 -0
- package/src/core/emit/opcodes.ts +160 -0
- package/src/core/emit/outputs.ts +357 -0
- package/src/core/emit/pool.ts +102 -0
- package/src/core/emit/program.ts +385 -0
- package/src/core/emit/registers.ts +179 -0
- package/src/core/emit/request-scope.ts +52 -0
- package/src/core/emit/requests.ts +258 -0
- package/src/core/emit/requires.ts +91 -0
- package/src/core/emit/sha256.ts +119 -0
- package/src/core/emit/statements.ts +438 -0
- package/src/core/emit/values.ts +284 -0
- package/src/core/engine/alerts.ts +152 -0
- package/src/core/engine/arithmetic.ts +165 -0
- package/src/core/engine/bars.ts +224 -0
- package/src/core/engine/budget.ts +284 -0
- package/src/core/engine/channels.ts +171 -0
- package/src/core/engine/drawings.ts +127 -0
- package/src/core/engine/engine.ts +498 -0
- package/src/core/engine/errors.ts +100 -0
- package/src/core/engine/frames.ts +85 -0
- package/src/core/engine/grids.ts +98 -0
- package/src/core/engine/guard.ts +71 -0
- package/src/core/engine/host.ts +251 -0
- package/src/core/engine/index.ts +93 -0
- package/src/core/engine/inputs.ts +263 -0
- package/src/core/engine/ledger/call.ts +218 -0
- package/src/core/engine/ledger/closable.ts +269 -0
- package/src/core/engine/ledger/holdings.ts +354 -0
- package/src/core/engine/ledger/index.ts +28 -0
- package/src/core/engine/ledger/intent.ts +112 -0
- package/src/core/engine/ledger/ledger.ts +314 -0
- package/src/core/engine/ledger/place.ts +277 -0
- package/src/core/engine/ledger/positions.ts +123 -0
- package/src/core/engine/ledger/refuse.ts +378 -0
- package/src/core/engine/ledger/row.ts +318 -0
- package/src/core/engine/ledger/sizing.ts +292 -0
- package/src/core/engine/library/arrays.ts +316 -0
- package/src/core/engine/library/averages.ts +97 -0
- package/src/core/engine/library/binding.ts +325 -0
- package/src/core/engine/library/chart.ts +115 -0
- package/src/core/engine/library/colours.ts +111 -0
- package/src/core/engine/library/dates.ts +109 -0
- package/src/core/engine/library/index.ts +103 -0
- package/src/core/engine/library/maths.ts +134 -0
- package/src/core/engine/library/objects.ts +265 -0
- package/src/core/engine/library/oscillators.ts +124 -0
- package/src/core/engine/library/ranges.ts +51 -0
- package/src/core/engine/library/series.ts +236 -0
- package/src/core/engine/library/state.ts +47 -0
- package/src/core/engine/library/studies.ts +150 -0
- package/src/core/engine/library/text.ts +303 -0
- package/src/core/engine/library/trend.ts +79 -0
- package/src/core/engine/library/volume.ts +101 -0
- package/src/core/engine/load.ts +104 -0
- package/src/core/engine/machine.ts +446 -0
- package/src/core/engine/memory.ts +129 -0
- package/src/core/engine/operations.ts +171 -0
- package/src/core/engine/orders.ts +121 -0
- package/src/core/engine/registers.ts +104 -0
- package/src/core/engine/request-body.ts +328 -0
- package/src/core/engine/request-plan.ts +270 -0
- package/src/core/engine/requests.ts +382 -0
- package/src/core/engine/results.ts +41 -0
- package/src/core/engine/series.ts +82 -0
- package/src/core/engine/session/hours.ts +86 -0
- package/src/core/engine/session/index.ts +17 -0
- package/src/core/engine/session/record.ts +191 -0
- package/src/core/engine/session/spec.ts +45 -0
- package/src/core/engine/timeframe.ts +161 -0
- package/src/core/engine/types.ts +47 -0
- package/src/core/engine/values/heap.ts +295 -0
- package/src/core/engine/values/index.ts +34 -0
- package/src/core/engine/values/value.ts +158 -0
- package/src/core/engine/verify-budgets.ts +202 -0
- package/src/core/engine/verify-code.ts +332 -0
- package/src/core/engine/verify-requests.ts +255 -0
- package/src/core/engine/verify-shape.ts +164 -0
- package/src/core/engine/verify-tables.ts +176 -0
- package/src/core/engine/verify.ts +341 -0
- package/src/core/index.ts +128 -6
- package/src/core/parse/expressions.ts +1 -1
- package/src/core/parse/names.ts +29 -2
- package/src/core/stdlib/averages/exponential.ts +119 -0
- package/src/core/stdlib/averages/index.ts +45 -0
- package/src/core/stdlib/averages/select.ts +71 -0
- package/src/core/stdlib/averages/shaped.ts +161 -0
- package/src/core/stdlib/averages/simple.ts +139 -0
- package/src/core/stdlib/calendar/civil.ts +89 -0
- package/src/core/stdlib/calendar/fields.ts +124 -0
- package/src/core/stdlib/calendar/format.ts +71 -0
- package/src/core/stdlib/calendar/index.ts +15 -0
- package/src/core/stdlib/calendar/zone.ts +161 -0
- package/src/core/stdlib/index.ts +400 -0
- package/src/core/stdlib/maths/arithmetic.ts +74 -0
- package/src/core/stdlib/maths/elementary.ts +124 -0
- package/src/core/stdlib/maths/index.ts +43 -0
- package/src/core/stdlib/maths/rounding.ts +78 -0
- package/src/core/stdlib/momentum/convergence.ts +82 -0
- package/src/core/stdlib/momentum/index.ts +47 -0
- package/src/core/stdlib/momentum/pressure.ts +141 -0
- package/src/core/stdlib/momentum/rates.ts +188 -0
- package/src/core/stdlib/momentum/rsi.ts +49 -0
- package/src/core/stdlib/momentum/stochastic.ts +147 -0
- package/src/core/stdlib/series/changes.ts +177 -0
- package/src/core/stdlib/series/conditions.ts +74 -0
- package/src/core/stdlib/series/extremes.ts +92 -0
- package/src/core/stdlib/series/index.ts +83 -0
- package/src/core/stdlib/series/pivots.ts +63 -0
- package/src/core/stdlib/series/statistics.ts +207 -0
- package/src/core/stdlib/series/totals.ts +164 -0
- package/src/core/stdlib/trend/directional.ts +196 -0
- package/src/core/stdlib/trend/index.ts +13 -0
- package/src/core/stdlib/trend/psar.ts +131 -0
- package/src/core/stdlib/trend/supertrend.ts +100 -0
- package/src/core/stdlib/values/bar.ts +54 -0
- package/src/core/stdlib/values/index.ts +14 -0
- package/src/core/stdlib/values/lookback.ts +198 -0
- package/src/core/stdlib/values/region.ts +86 -0
- package/src/core/stdlib/values/tail.ts +58 -0
- package/src/core/stdlib/values/value.ts +82 -0
- package/src/core/stdlib/volatility/bands.ts +178 -0
- package/src/core/stdlib/volatility/deviation.ts +111 -0
- package/src/core/stdlib/volatility/index.ts +48 -0
- package/src/core/stdlib/volatility/measures.ts +96 -0
- package/src/core/stdlib/volatility/range.ts +143 -0
- package/src/core/stdlib/volume/accumulation.ts +152 -0
- package/src/core/stdlib/volume/flow.ts +173 -0
- package/src/core/stdlib/volume/index.ts +43 -0
- package/src/core/stdlib/volume/weighted.ts +101 -0
- package/src/core/version/version.generated.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,1206 @@ nothing, fails the build before it can become permanent.
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## 0.2.0
|
|
11
|
+
|
|
12
|
+
**This release is the studies surface, finished.** A script compiles in a browser
|
|
13
|
+
tab in milliseconds and computes, bar by bar, the same numbers everywhere. One
|
|
14
|
+
hundred and one independently written studies compile, load and run; five of
|
|
15
|
+
them match arithmetic transcribed from `stdlib.md` section 20 alone, bit for
|
|
16
|
+
bit, warmups included. The chart adapter turns a compiled study into an
|
|
17
|
+
indicator descriptor, and a stored setting now reaches a declaration option
|
|
18
|
+
through it.
|
|
19
|
+
|
|
20
|
+
**Upgrade for studies. Do not upgrade expecting a backtest or an editor.** There
|
|
21
|
+
is no equity curve, no drawdown, no trade list and no reproducible run: that is
|
|
22
|
+
Phase 5. There are no editor functions: that is Phase 4. There is no second
|
|
23
|
+
engine and no conformance suite, so the portability claim is still a design
|
|
24
|
+
rather than a result: that is Phase 6. `README.md` says the same in the same
|
|
25
|
+
words, because the registry page must not overstate.
|
|
26
|
+
|
|
27
|
+
**The order surface changed a great deal and is not finished.** A strategy can
|
|
28
|
+
place orders through a host and the ledger refuses what the specification says
|
|
29
|
+
to refuse, but six rounds of adversarial work on it each found a real defect,
|
|
30
|
+
and the entries below are mostly that work. If you are building on orders, read
|
|
31
|
+
them. If you are building on studies, the short version is that nothing in the
|
|
32
|
+
study path changed under you.
|
|
33
|
+
|
|
34
|
+
Previously published as `0.1.0-alpha.0` and `0.1.0-alpha.1`, which parsed and
|
|
35
|
+
did not compute. This version takes `latest`.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
**A bracket now names the position the strategy is actually holding.** `exit()`
|
|
39
|
+
and `order.bracket()` hand the host the position reference they protect, and
|
|
40
|
+
`host-interface.md` 7.1 tells a host to look that reference up only when it is
|
|
41
|
+
not `0`, because `0` means the leg holds nothing yet. The reference was a slot
|
|
42
|
+
on the position book rather than an answer worked out from it: set when a
|
|
43
|
+
reference was minted, cleared when that one reference returned to zero, and
|
|
44
|
+
never pointed at another. So a leg holding two positions, whose newer one closed
|
|
45
|
+
while the older one was still held, reported holding none, and the bracket went
|
|
46
|
+
out carrying `0` while the strategy held ten units. The same slot read the other
|
|
47
|
+
way named a reference nothing ever opened: a reference minted for an order the
|
|
48
|
+
destination then refused stayed the answer for every bracket after it, so the
|
|
49
|
+
intent carried a number a host reconciling against its own positions cannot find
|
|
50
|
+
on the other side. Neither needed an unusual destination. One entry, one
|
|
51
|
+
opposing entry large enough to open a second position and an ordinary partial
|
|
52
|
+
fill reach the first. **The reference is now derived from the leg's own book**:
|
|
53
|
+
the newest position its fills have settled anything on, and the position it is
|
|
54
|
+
opening only where nothing has settled at all, which is the order `stdlib.md`
|
|
55
|
+
17.7 states the two in. Both pages now say which position is named where a leg
|
|
56
|
+
holds more than one.
|
|
57
|
+
|
|
58
|
+
**The arithmetic manifest now measures what it prints, and a check keeps it
|
|
59
|
+
that way.** `stdlib.md` section 20 is the page a second engine implements its
|
|
60
|
+
arithmetic from, and the way it goes wrong is always the same: a figure is
|
|
61
|
+
measured once, printed beside a refusal, and believed forever. Three sentences
|
|
62
|
+
there are corrected. `linreg` said its sums over `x` were "formed as written",
|
|
63
|
+
which covered a real refusal and a spelling that cannot be failed: splitting the
|
|
64
|
+
divisor of the sum of squares into the 2 and the 3 it is made of differs on 3716
|
|
65
|
+
of the whole lengths from 1 to 100000, first at 15, where it gives
|
|
66
|
+
1014.9999999999999 against 1015, while the grouping of the products cannot
|
|
67
|
+
differ at any length a window can have. `wma` said its divisor was "computed as
|
|
68
|
+
written" and nothing about how it is written changes its value. And 20.2.1 said
|
|
69
|
+
a carried total is not bit-identical to a fresh sum on any bar, which is false:
|
|
70
|
+
it agrees on 236 of the 19981 windows at length 20 over a walk of twenty
|
|
71
|
+
thousand bars, and what is true, that it differs on the other 19745 and drifts
|
|
72
|
+
further as the history grows, is now the sentence. **A new check,
|
|
73
|
+
`scripts/check-section-20.mjs`, requires every count the section prints to be
|
|
74
|
+
read back out of the page by a test that measures it again**, so a figure
|
|
75
|
+
quoted there and measured nowhere fails the build. It found the three counts the
|
|
76
|
+
exponential mean prints, which a test quoted in a comment and asserted nothing
|
|
77
|
+
about.
|
|
78
|
+
|
|
79
|
+
**A close now flattens the part it was told to flatten, on the side that reduces
|
|
80
|
+
it.** `close(tag)` took its direction from the leg's net rather than from the
|
|
81
|
+
part the tag names, so it could send an order that **added** to that part. A leg
|
|
82
|
+
holding ten long under one tag and four short under another is a net six long,
|
|
83
|
+
and closing the short part was answered with a sell of four: that part went to
|
|
84
|
+
eight short, the other tag's long was cut to six, and a call named `close` had
|
|
85
|
+
opened position. This is the shape a hedge is written in, and `stdlib.md` 17.2
|
|
86
|
+
says of the reading that takes the leg's net that it would let `close` open a
|
|
87
|
+
position. Three things follow it and are now held: what is already working
|
|
88
|
+
against a part is counted on the part's own side, so a second `close(tag)` holds
|
|
89
|
+
back the close already on its way instead of sending the part again; a part on
|
|
90
|
+
the side its leg is not on is closed by the whole of itself rather than by
|
|
91
|
+
whatever the leg has left, because closing it moves the leg away from zero; and
|
|
92
|
+
a part whose position has already returned to zero sends nothing rather than
|
|
93
|
+
opening it again.
|
|
94
|
+
|
|
95
|
+
**A position reference no longer reads as the side it is not on.** A reference's
|
|
96
|
+
side was read from what had settled on it plus what a reduction claimed of the
|
|
97
|
+
**leg** at the moment it was sent, and those two numbers can drift apart. A
|
|
98
|
+
second stated close claims nothing, because the first already spoke for the
|
|
99
|
+
whole leg, and it still fills and still reduces what has settled: the sum went
|
|
100
|
+
negative, the reference read short while it was long, and an entry opposing it
|
|
101
|
+
was handed it as an order that **adds**. Under a declaration counting in lots,
|
|
102
|
+
cash or an equity percent, `buy(qty = 10)` and then two closes of one and a
|
|
103
|
+
`sell(qty = 9)`, with every order answered in full and nothing rejected, left
|
|
104
|
+
reference 1 having opened ten long and settled one short. A reference is now
|
|
105
|
+
measured against the orders' own sizes, which fall as a fill arrives, so the two
|
|
106
|
+
halves of that sum cannot drift.
|
|
107
|
+
|
|
108
|
+
**Two more, both found by the properties rather than by reading, and both the
|
|
109
|
+
same sentence: a close is sent against the position it is closing.** A close
|
|
110
|
+
whose quantity the engine cannot count in units was handed the reference an
|
|
111
|
+
entry was opening on the other side, where the leg's own long was entirely
|
|
112
|
+
inside an order the destination still had. And a bracket minted a position
|
|
113
|
+
reference when the leg was flat, so a script whose first order call is `exit()`
|
|
114
|
+
or `order.bracket()` burned reference 1 on an instruction that appends no row
|
|
115
|
+
and moves nothing: the entry after it opened on reference 2, and the bracket
|
|
116
|
+
carried a reference no order ever shared, which a host reconciling intents
|
|
117
|
+
against positions cannot find on the other side. **A bracket now carries the
|
|
118
|
+
position it protects, and `0` where the leg holds none**, which is what a
|
|
119
|
+
cancellation has always carried; `host-interface.md` 7.1 says so for the party
|
|
120
|
+
that has to read it.
|
|
121
|
+
|
|
122
|
+
**`order.reverse` is unchanged, and now says why.** Its opening half mints a
|
|
123
|
+
position of its own without going through the division every other entry takes.
|
|
124
|
+
That is correct by construction rather than an omission: a reference minted
|
|
125
|
+
there has nothing on it, so the order cannot cross it. Dividing it instead is a
|
|
126
|
+
defect, because the orders of a call are all mapped before any of them appends a
|
|
127
|
+
row, so the opening half would be divided against the very position the closing
|
|
128
|
+
half is flattening. `tests/engine/parts.test.ts` pins the reference now as well
|
|
129
|
+
as the quantities.
|
|
130
|
+
|
|
131
|
+
**How much of this is checked rather than promised.** Two thousand generated
|
|
132
|
+
scripts, ten bars each, against a destination that answers late, partially, out
|
|
133
|
+
of order, with rejections, with more than was asked, with a frame repeated, with
|
|
134
|
+
a stale quantity restated after a later one, and not at all. The oracle is
|
|
135
|
+
folded from what the host sent and what it answered and reads nothing the engine
|
|
136
|
+
kept, because an oracle folded from the ledger agrees with the engine by
|
|
137
|
+
construction, which is how both of these defects passed 1414 tests. Every fix
|
|
138
|
+
was then mutated back one at a time and the suite run against each.
|
|
139
|
+
|
|
140
|
+
**An order now knows which position it belongs to.** An order picked its position
|
|
141
|
+
reference by comparing its own side against the leg's net, which is folded from
|
|
142
|
+
settled fills, so while an entry was unanswered the leg read flat and an order
|
|
143
|
+
opposing that entry was not seen as opposing anything: `buy(qty = 6)` on one bar
|
|
144
|
+
and `sell(qty = 9)` on the next, against a destination that had said nothing, put
|
|
145
|
+
both orders on position reference 1, which opened six long and settled three
|
|
146
|
+
short. That is one position holding both signs, which is the single failure the
|
|
147
|
+
position reference exists to prevent, because a fill arriving late can no longer
|
|
148
|
+
say which position it settled. The same script with the entry acknowledged first
|
|
149
|
+
was already correct, which is the whole shape of the defect: **what a bar sends
|
|
150
|
+
must not depend on how fast the destination answers**, and now it does not.
|
|
151
|
+
|
|
152
|
+
A position is measured by what is on it, settled and what is still working
|
|
153
|
+
together. A position with six units still to come is a position holding six, and
|
|
154
|
+
an order that opposes it takes those six off it before it opens anything, because
|
|
155
|
+
otherwise nothing can ever bring that position back to zero. Three more shapes
|
|
156
|
+
went with it. A close after such an entry held nothing back for it and sent the
|
|
157
|
+
position again, which is last round's runaway exit with an entry in place of the
|
|
158
|
+
close. An order agreeing with the leg's net was attached to whichever position was
|
|
159
|
+
current, which during a flip is the one carrying the other sign, so a buy of
|
|
160
|
+
twelve took a position from nine short to three long. And a close or an
|
|
161
|
+
`order.reverse` sized against the whole leg and attached the result to one
|
|
162
|
+
position, with nothing asking whether that position could absorb it: a leg holding
|
|
163
|
+
seventy two short across two positions was handed one order large enough to take
|
|
164
|
+
either of them through zero. Each of them is now one order per position it
|
|
165
|
+
reduces, oldest first.
|
|
166
|
+
|
|
167
|
+
**A close is held to every order already coming off the leg, not only the ones
|
|
168
|
+
that were reductions when they left.** An entry the destination has not answered,
|
|
169
|
+
on a leg the orders after it took the other way, is a reduction now whatever it
|
|
170
|
+
was then. Left out of the count, `close(qty = 12)` against a leg twelve short was
|
|
171
|
+
accepted as true when five of the twelve were already on their way.
|
|
172
|
+
|
|
173
|
+
**Pyramiding counts the entries the leg holds in a direction**, which is what the
|
|
174
|
+
declaration option has always said, and which used to be the same number as the
|
|
175
|
+
entries on one position reference. It is not any more: an entry placed while the
|
|
176
|
+
whole of a position is already in an order the destination still has opens a
|
|
177
|
+
position of its own, because the one it would join is about to reach zero and
|
|
178
|
+
end. And whether an order is an entry at all is now read from the order rather
|
|
179
|
+
than from the leg's net, which calls every order an entry while the leg reads
|
|
180
|
+
flat.
|
|
181
|
+
|
|
182
|
+
**In lots, cash and an equity percent, an opposing entry is still one order, and
|
|
183
|
+
two things about it are now held.** It carries a position reference of its own
|
|
184
|
+
whether or not anything has settled, which is the defect above wearing another
|
|
185
|
+
unit and was not held before. And the position it leaves behind is named again: a
|
|
186
|
+
close works its own quantity out in units, so it is divided across the positions
|
|
187
|
+
holding the leg's side and reaches that one in turn, and it returns to zero as
|
|
188
|
+
soon as the leg's net comes back to its side. What still waits on the instrument's
|
|
189
|
+
lot size is the instruction itself closing it, and a leg whose net never returns
|
|
190
|
+
to that side carries the position for the rest of the run. OS7005's deferral says
|
|
191
|
+
so, and `tests/engine/ending.test.ts` asserts both halves rather than describing
|
|
192
|
+
them.
|
|
193
|
+
|
|
194
|
+
**What no engine answers for, recorded rather than left to be found.** A position
|
|
195
|
+
settles on the side it did not open on only when an order on it was never answered
|
|
196
|
+
in full: one still going, or one that ended rejected, cancelled or expired with
|
|
197
|
+
part of its quantity unfilled. An order divided against an unanswered order is
|
|
198
|
+
placed against units that were promised and may not arrive, and the alternative is
|
|
199
|
+
holding an order back until the destination answers, which is an engine that stops
|
|
200
|
+
trading when a destination is slow. Over six thousand generated runs against a
|
|
201
|
+
destination that answers late, out of order, partially, with a rejection and not
|
|
202
|
+
at all, every position all of whose orders were answered in full ended on the side
|
|
203
|
+
it opened on.
|
|
204
|
+
|
|
205
|
+
**A setting a reader stores now reaches the declaration option it was written
|
|
206
|
+
into.** `docs/inputs.md` teaches `study("S", precision = input(2, "Places"))` as
|
|
207
|
+
how a reader gets to change something the declaration decides. Through this
|
|
208
|
+
package's own chart adapter it did not: `descriptorFor` took no settings at all,
|
|
209
|
+
so `plots[0].priceFormat.precision` was 2 whatever the host had stored, and 5
|
|
210
|
+
when the script wrote `input(5, ...)`, which is the default and not the setting.
|
|
211
|
+
The engine loaded with the same stored value resolved it correctly, so the chart
|
|
212
|
+
formatted a pane at one precision while the column beside it was computed at
|
|
213
|
+
another. `ChartAdapterOptions` gains **`settings`**, and every declaration field
|
|
214
|
+
written as an `input()` now resolves against it: the study's name and category,
|
|
215
|
+
its placement, and every plot, band and alert field. A host that keeps one
|
|
216
|
+
descriptor per study instance passes that instance's stored settings and builds
|
|
217
|
+
again when a user changes one; the parts that follow a later change with no
|
|
218
|
+
rebuild are the calls, `levels`, `range`, the painting hooks and the calculation,
|
|
219
|
+
and which is which is recorded in `spec/chart-narrowings.json` and measured by
|
|
220
|
+
`scripts/check-chart-surface.mjs` rather than promised. One declaration option
|
|
221
|
+
still cannot be tuned and now says so: a plot's `style` is a plain string in the
|
|
222
|
+
compiled format, so an `input()` written there is folded to its default with no
|
|
223
|
+
diagnostic anywhere. That is issue 0018, and closing it is a format change.
|
|
224
|
+
|
|
225
|
+
**And a stored setting the engine will refuse no longer reaches the chart.** The
|
|
226
|
+
change above brought its own defect, in the half of it nothing had asked about:
|
|
227
|
+
the declared shape is built before anything is calculated, so a settings map of
|
|
228
|
+
`{ Places: 99 }` against `input(2, "Places", min = 0, max = 8)` put a precision
|
|
229
|
+
of 99 into `plots[0].priceFormat`, and `{ Places: -4 }` put -4 there. The run
|
|
230
|
+
refuses that map with OS6019 and nothing is drawn, but the descriptor a host was
|
|
231
|
+
handed first carries a number the input forbids, and a host may show it in a
|
|
232
|
+
legend or on a price scale before it asks for a bar. The adapter also kept a
|
|
233
|
+
second idea of an unusable value beside the engine's: a stored `null` or object
|
|
234
|
+
read as the declared default while the engine refused the same map, and a stored
|
|
235
|
+
`"7"` read as neither, landing on the chart's own fallback of 4.
|
|
236
|
+
|
|
237
|
+
Both are one question with one answer now, and it is the engine's own:
|
|
238
|
+
`checkSetting` is the function the load refuses with, and the adapter asks it
|
|
239
|
+
before a load exists. A stored value it will not take reads as the **declared
|
|
240
|
+
default** in the declared shape, and travels to the engine exactly as the host
|
|
241
|
+
stored it, so the run still stops with OS6019 naming the key and the bound.
|
|
242
|
+
Neither half is a fallback: the value is not repaired, and the shape is not
|
|
243
|
+
withheld, because the settings dialog a reader corrects the value in is built
|
|
244
|
+
from it. The incremental path compares what the engine is handed rather than what
|
|
245
|
+
the shape shows, because every refused value shows the same default and a
|
|
246
|
+
signature taken from the shape would keep a held engine across a change from a
|
|
247
|
+
setting that runs to one that cannot. `scripts/check-chart-surface.mjs` moves a
|
|
248
|
+
plot width outside its declared bounds, as text and as `null`, and reads both the
|
|
249
|
+
shape and the run on each.
|
|
250
|
+
|
|
251
|
+
**An input written in place whose title is empty now has a code that is true of
|
|
252
|
+
it: OS3024.** `input(14, "")` raised OS3021, whose message says the input "has no
|
|
253
|
+
title written as a string literal" and whose fix says to give it one. The reader
|
|
254
|
+
had. It was empty, and the sentence told them to make the edit they had already
|
|
255
|
+
made. OS3021 keeps the two programs it describes, an input with no title argument
|
|
256
|
+
and one whose title is not a literal; the empty title is OS3024, whose fix is to
|
|
257
|
+
give the title something to say. Beside it, a decision that had been made by
|
|
258
|
+
nobody is now written down: **an input assigned to a name and given an empty
|
|
259
|
+
title is labelled by the name**, exactly as one given no title is, because a
|
|
260
|
+
named input has its key already and what an empty title costs there is only a
|
|
261
|
+
label. `language.md` 13.4 states it, and a test pins it.
|
|
262
|
+
|
|
263
|
+
**`spec/errors.md` and `spec/errors.json` are now compared in full.** The page is
|
|
264
|
+
named the authority a reader is sent to, and the file is what the compiler is
|
|
265
|
+
generated from, and until now only the test pointer and the two example blocks
|
|
266
|
+
were held to each other: changing one word of a message on the page passed the
|
|
267
|
+
whole build, showing a reader one sentence and the user of the compiler a
|
|
268
|
+
different one. Every heading, first line, message, placeholder gloss, cause, fix,
|
|
269
|
+
deferral and unexercised sentence is now compared character for character, along
|
|
270
|
+
with the two tables outside part 8 that are copies of the file as well. Both of
|
|
271
|
+
those had already drifted: the ranges table said the argument block held 20
|
|
272
|
+
entries and the catalogue held 147, against 23 and 150, and the refinements table
|
|
273
|
+
was missing an entry added in the last release.
|
|
274
|
+
|
|
275
|
+
**The error code check reads the whole tree, not only its Markdown.** Its own
|
|
276
|
+
docstring said "nothing else in the repository gets to invent one" while it
|
|
277
|
+
walked `.md` files, and source comments cite codes heavily: changing one in a
|
|
278
|
+
comment to a code the catalogue does not define passed the whole build. It now
|
|
279
|
+
reads every file the project holds, source and tests and tooling alike, and
|
|
280
|
+
prints the count it read. A number outside every thousand block the catalogue
|
|
281
|
+
declares is not a code and is counted rather than refused, which is what lets
|
|
282
|
+
four checks go on attacking their own rules with a fabricated entry; those
|
|
283
|
+
citations and the files holding them are printed on every run.
|
|
284
|
+
|
|
285
|
+
**Three sentences in `stdlib.md` section 20 fixed nothing and have been
|
|
286
|
+
replaced.** Section 20 is the manifest a second engine implements from, so a
|
|
287
|
+
sentence there that cannot be violated costs an implementer the time the section
|
|
288
|
+
exists to save. `rsi` said that naming the ratio first and writing
|
|
289
|
+
`100 - (100 / (1 + ratio))` was "the same expression with an extra rounding in
|
|
290
|
+
it": there is no extra rounding, and the two spellings are bit identical on every
|
|
291
|
+
value at all three gate lengths. `alma` fixed the grouping of `2 * spread *
|
|
292
|
+
spread`, which cannot differ because one factor is a power of two; the
|
|
293
|
+
arrangement that does differ is the chain of divisions, and that is what it names
|
|
294
|
+
now. `bollinger` said a span was "formed once". 20.1 gains the general rule so
|
|
295
|
+
the next one is caught by reading, and two measured figures that were overstated
|
|
296
|
+
as "most" are now the numbers: `fade`'s refused arrangement differs at 40 of the
|
|
297
|
+
101 whole percentages, and `math.toDegrees`'s at 26 in every hundred.
|
|
298
|
+
|
|
299
|
+
**A fourth one, and the rule that covers all four.** `swma` said "the two middle
|
|
300
|
+
terms are formed as `2 * value`, and the four terms are added left to right":
|
|
301
|
+
one sentence, one half of which can be failed and one of which cannot, with
|
|
302
|
+
nothing to tell a reader which. Writing `value * 2` or `value + value` instead is
|
|
303
|
+
bit identical on every finite value, measured over 25176 values covering every
|
|
304
|
+
binade of the double range in both signs, the subnormals included. Writing the
|
|
305
|
+
four additions in a different grouping is not: over twenty thousand four bar
|
|
306
|
+
windows of ordinary prices, pairing them differs on 5281, adding right to left on
|
|
307
|
+
7230, and dividing each term by 6 as it is added on 9564. The entry now states
|
|
308
|
+
both, with the figures.
|
|
309
|
+
|
|
310
|
+
Four sentences of one shape in three rounds is a pattern rather than three
|
|
311
|
+
coincidences, so 20.1 now states the general rule rather than another list of
|
|
312
|
+
instances: **an arrangement is where one rounding falls relative to another**.
|
|
313
|
+
Only an operation that rounds can be part of one, and two operations that do not
|
|
314
|
+
read each other have no order between them. The three things that fixed nothing
|
|
315
|
+
become four, gaining the exact respelling of a step that does not round (`2 * v`,
|
|
316
|
+
`v * 2`, `v + v`; `v / 2`, `v * 0.5`) and the order of accumulations that do not
|
|
317
|
+
read each other, and the section now states the test a sentence has to pass to go
|
|
318
|
+
in it: name the second arrangement it refuses and count where the two differ. The
|
|
319
|
+
whole of section 20 was swept against that test, which found two more: `linreg`
|
|
320
|
+
and `covariance` fixed the pass structure of accumulations that never read each
|
|
321
|
+
other, `covariance`'s down to the order the three are written in. Both now fix
|
|
322
|
+
what is real, which is that each total runs oldest first. `tests/stdlib` reads
|
|
323
|
+
every figure above out of the page and measures it again, so rewording a claim or
|
|
324
|
+
moving a figure fails a test instead of going on being quoted.
|
|
325
|
+
|
|
326
|
+
**CLAUDE.md rule 5 now says what its check covers.** "Name nobody. No outside
|
|
327
|
+
product, platform, company, trademark, market index or real instrument,
|
|
328
|
+
anywhere" is enforced by a fixed list of eighteen products and thirteen indices.
|
|
329
|
+
A name on the list is caught in any file and a name that is not on it passes,
|
|
330
|
+
which is the only mechanizable form of the rule; the rule was written as though
|
|
331
|
+
the check covered all of it. It now says which half is mechanical and which is
|
|
332
|
+
attention, and `scripts/check-names.mjs` says the same in its passing line,
|
|
333
|
+
because a green build read as proof of something wider is the way this one fails.
|
|
334
|
+
|
|
335
|
+
**A close still working at the destination is no longer sent again on the next
|
|
336
|
+
bar.** A position moves when a fill settles and from nothing else, so an order a
|
|
337
|
+
strategy has sent and not had answered has moved no position figure: the leg
|
|
338
|
+
still reads what it held before it left. The previous release held the orders of
|
|
339
|
+
one bar against that, and one bar out the defect was still there. Measured, with
|
|
340
|
+
the entry acknowledged and the closes not acknowledged, on the plainest exit a
|
|
341
|
+
strategy can write:
|
|
342
|
+
|
|
343
|
+
```
|
|
344
|
+
strategy("P", qty = 3)
|
|
345
|
+
if bar.index == 0
|
|
346
|
+
buy(qty = 3)
|
|
347
|
+
if bar.index > 0 and pos.size > 0
|
|
348
|
+
close()
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
six bars sent one close per bar and netted **twelve short** under one position
|
|
352
|
+
reference, ten bars netted twenty four, and it grew with the run. With the closes
|
|
353
|
+
filling one of three at a time it sent 3, then 3, then 3 and ended three short.
|
|
354
|
+
Nothing was reported, on a leg that opened long three, and a destination slower
|
|
355
|
+
than the chart is the whole of what it takes. The script was not wrong: `pos.size`
|
|
356
|
+
is folded from settled fills and correctly still read three.
|
|
357
|
+
|
|
358
|
+
**What is available to reduce is now the settled position less everything already
|
|
359
|
+
working against it**, over the run rather than over the bar, which subsumes the
|
|
360
|
+
bar rule rather than sitting beside it. What is working is read from the ledger:
|
|
361
|
+
an order that has not ended and has not fully filled, counted by the part of it
|
|
362
|
+
that has not filled. A partial fill releases what settled, so three sold with one
|
|
363
|
+
filled leaves two working and the next close sends two. A rejection, a
|
|
364
|
+
cancellation or an expiry releases the rest, and the script may close again.
|
|
365
|
+
`cancel()` is the way out of a destination that never answers, and it now works
|
|
366
|
+
end to end. An unsettled entry adds nothing to what a close may reduce, because
|
|
367
|
+
nothing has settled. `close(qty = ...)` against a leg whose close is already
|
|
368
|
+
going is **OS7017** naming nothing left, where before it sent the position a
|
|
369
|
+
second time.
|
|
370
|
+
|
|
371
|
+
**A crossing entry carries a position reference of its own in every `qtyType`.**
|
|
372
|
+
Under `"lots"`, `"cash"` and `"equityPercent"`, `buy(qty = 3)` then `sell(qty = 9)`
|
|
373
|
+
sent one order on the outgoing position's reference: at a lot size of twenty five
|
|
374
|
+
the destination saw reference 1 go from seventy five units to minus one hundred
|
|
375
|
+
and fifty, which is the crossing the split exists to prevent. Dividing the
|
|
376
|
+
quantity into a closing half and an opening half needs the instrument's lot size
|
|
377
|
+
and still waits on it, but **minting a reference needs no arithmetic**, so it is
|
|
378
|
+
done in all four. What still waits is written where a reader meets it, in
|
|
379
|
+
`stdlib.md` 17.1 and in OS7005's deferral: the outgoing position is not closed by
|
|
380
|
+
an order of its own.
|
|
381
|
+
|
|
382
|
+
**`pos.avgPrice` is now averaged over the positions on the side the leg holds.**
|
|
383
|
+
A leg holds more than one position whenever an opposing order is outstanding.
|
|
384
|
+
Summed across both, the cost of a position on its way out was subtracted from the
|
|
385
|
+
cost of the one on its way in: three hundred bought at one hundred beside two
|
|
386
|
+
hundred and twenty five sold at one hundred and ten reported an entry at
|
|
387
|
+
**seventy**, and every level measured from the entry would have been measured
|
|
388
|
+
from that. It also corrects the same blend during a flip, where a leg long three
|
|
389
|
+
at one hundred with a new short five at one hundred and ten reported one hundred
|
|
390
|
+
and twenty five.
|
|
391
|
+
|
|
392
|
+
**An order that names a `leg` is now refused: OS3023.** `stdlib.md` promised that
|
|
393
|
+
a leg outside the declared names was refused, and nothing raised it:
|
|
394
|
+
`buy(qty = 3, leg = "nosuchleg")` placed the order on the only leg with no
|
|
395
|
+
diagnostic, and a computed name was ignored too. The sharp case is
|
|
396
|
+
`buy(qty = 3, leg = "a")` followed by `close(leg = "b")`, which flattened the
|
|
397
|
+
position: a script that named one leg and closed another traded the leg it did
|
|
398
|
+
not name and was told nothing. Leg declarations are planned, so no file can
|
|
399
|
+
declare one, so there is no name the argument could carry; it is refused whatever
|
|
400
|
+
it holds and whether the name was written or computed, and the fix is to take the
|
|
401
|
+
argument out. It is a code of its own rather than OS3008 because OS3008's fix
|
|
402
|
+
sentence is "use one of these values" and here there are none, and a fix a reader
|
|
403
|
+
cannot act on is worse than no fix.
|
|
404
|
+
|
|
405
|
+
**Two sentences of `stdlib.md` 17.1 corrected.** One claimed the engine held
|
|
406
|
+
every order it can read in units to "no order crosses zero" bar one named
|
|
407
|
+
exception; the across-bars case above was entirely in units and was not that
|
|
408
|
+
exception, so the engine was made true and the sentence now says what is. The
|
|
409
|
+
other, "a bar declared `onUnconfirmed` is one bar however many times it is
|
|
410
|
+
executed", is true of the reducing count and read as a general rule about the
|
|
411
|
+
bar: on such a bar executed four times a close sends one order and `buy(qty = 3)`
|
|
412
|
+
sends four, which is `language.md` 7.5 working as designed. The sentence now
|
|
413
|
+
carries its scope, and both halves are asserted in tests.
|
|
414
|
+
|
|
415
|
+
**A settings value now stays on the row it was stored for.** An `input()` may be
|
|
416
|
+
written anywhere a value belongs, and one written in a declaration option or
|
|
417
|
+
inside a larger expression is bound to no name, so it was keyed by its position:
|
|
418
|
+
`input0`, `input1`, `input2`. `host-interface.md` 8.1 promises a key that
|
|
419
|
+
"survives every edit that does not rename it" and a positional key survives no
|
|
420
|
+
edit at all. Measured end to end, on a file with three tunables in it, inserting
|
|
421
|
+
one in the middle and renaming nothing moved the keys down and put the value a
|
|
422
|
+
user had stored for Width onto Smoothing, silently, because 8.3 validates a
|
|
423
|
+
number against a number and both are numbers. A delete and a reorder did the
|
|
424
|
+
same. **An input written where a value belongs is now keyed by its title**, which
|
|
425
|
+
is what the user sees on the row and what changing is the rename 8.1 excepts; an
|
|
426
|
+
input bound to a name is keyed by the name as before, and `var len = input(...)`
|
|
427
|
+
is the named form, so adding or removing the word does not move a stored value.
|
|
428
|
+
Uniqueness is held by refusing rather than by a suffix, because a suffix is a
|
|
429
|
+
position again: an input with neither a name nor a title written as a string
|
|
430
|
+
literal is **OS3021**, a title spelling another input's name is **OS3022**, and
|
|
431
|
+
two inputs carrying one title were already OS3017. This changes the stored key of
|
|
432
|
+
every input written in place, and there were none to change: across the gate
|
|
433
|
+
studies, the gate scripts and `examples/`, 0 of 241 inputs carried a generated
|
|
434
|
+
key, because until the previous entry below closed, such an input did not compile
|
|
435
|
+
at all.
|
|
436
|
+
|
|
437
|
+
**An `input()` may be written inside a read's expression.** `req.timeframe("1D",
|
|
438
|
+
high + input(1, "K"))` produced exactly one diagnostic, OS6018, whose message
|
|
439
|
+
tells the reader that if nothing else was reported their correct script came from
|
|
440
|
+
a broken compiler. Nothing forbade the script: `language.md` 13.4 forbids an
|
|
441
|
+
input in a block and in a function, a read's expression argument is neither, and
|
|
442
|
+
`stdlib.md` 15.4 already permitted a **name** bound to an input there, for a
|
|
443
|
+
reason that is about the setting rather than about the name. The compiled format
|
|
444
|
+
already carried the mechanism as well, in the `inputs` list a read's body has had
|
|
445
|
+
since `compiled-program.md` 2.16: the engine resolves the key in the enclosing
|
|
446
|
+
program before the body runs and fills a register of the body's own table. The
|
|
447
|
+
call now resolves through the same scope the name does, and two reads of one
|
|
448
|
+
setting inside one body share one register. A `var` holding a setting is still
|
|
449
|
+
OS6003 there, because a later assignment may change it.
|
|
450
|
+
|
|
451
|
+
**`var len = input(14, "Length")` no longer compiles to a dead settings row.** It
|
|
452
|
+
was accepted with no diagnostic and read absent on every bar: the name was given
|
|
453
|
+
one slot, the input another, and nothing joined them, so a user got a row in the
|
|
454
|
+
dialog they could move that changed nothing. It is now an ordinary `var` whose
|
|
455
|
+
initial value is the setting, which is how a running total starts from one. A
|
|
456
|
+
setting cannot change mid-run, so a `var` nothing assigns to holds exactly what
|
|
457
|
+
the plain form holds; what the word buys is the assignment. The name is not the
|
|
458
|
+
setting, though: a `var` is a cell a later assignment may change, so it is
|
|
459
|
+
OS3003 in a declaration option and OS6003 inside a read's expression, like any
|
|
460
|
+
other per-bar name.
|
|
461
|
+
|
|
462
|
+
**A hole in the compiler's own copy of verification check 5.** The check is three
|
|
463
|
+
sentences, and only two were walked: the depth agrees on every path, and it never
|
|
464
|
+
goes below zero. The third, that it is zero at the terminator, is not a
|
|
465
|
+
restatement of the second, because a `RET` reaches nothing after it: a body one
|
|
466
|
+
value short is at minus one exactly at the `RET`, where the walk asked nothing,
|
|
467
|
+
and the walk finished clean. That is how a read's expression with an `input()` in
|
|
468
|
+
it came to be emitted as a body no conforming engine will load, found by an
|
|
469
|
+
engine rather than by the compiler that wrote it. Every `RET` and every `HALT` is
|
|
470
|
+
now checked, rather than the last instruction, because an early `return` is a
|
|
471
|
+
terminator too.
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
**Every worked example in the error catalogue is now compiled, and every
|
|
475
|
+
pointer in it resolves.** The catalogue carries a before and an after block per
|
|
476
|
+
entry. The after block is the fix a reader is handed at the moment they are
|
|
477
|
+
stuck, and they paste it; nothing had ever put one through a compiler. That is
|
|
478
|
+
how OS7009's fix came to call a function the language does not have, be cited in
|
|
479
|
+
five documents and sit there being read. Four more did not compile: OS7012's
|
|
480
|
+
names a planned call, OS1023's puts a `plot` inside an `if`, and OS1022's and
|
|
481
|
+
OS3003's were both refused by the emitter, which was a defect in the emitter and
|
|
482
|
+
is fixed below. OS3003's example is back to the input form its own fix sentence
|
|
483
|
+
names. OS1022's stays as deleting the trailing operator, on its own merits: the
|
|
484
|
+
statement was already complete before the stray operator, and supplying an
|
|
485
|
+
operand instead invents a number the reader never wrote. Five compiled and warned, which is the compiler complaining about
|
|
486
|
+
the reader for doing what it had just told them to do. Every after block now
|
|
487
|
+
compiles with no diagnostic, bar the two warnings that say a fragment stopped
|
|
488
|
+
rather than that it is wrong.
|
|
489
|
+
|
|
490
|
+
The before blocks were held to the code they are filed under, by compiling them
|
|
491
|
+
and, for a runtime code, by loading the program on a host and running it over a
|
|
492
|
+
fixed dataset on two venues. Seven were about a different code than the one they
|
|
493
|
+
were printed under. OS3001, wrong number of arguments, showed a call with one
|
|
494
|
+
argument missing, which is OS3012. OS3004, a literal that is not a whole number,
|
|
495
|
+
showed a computed value, which is OS4003 on a bar. OS4003 showed an array index,
|
|
496
|
+
which `compiled-program.md` assigns to OS4004. OS4002, a read past the retained
|
|
497
|
+
depth, declared no depth to pass. OS7010, a bracket on the wrong side of the
|
|
498
|
+
entry, read the entry price on the bar the entry was placed, where it is absent,
|
|
499
|
+
so the refusal a reader would have met is OS7002. Each of those is now the
|
|
500
|
+
example its own code is about. Four codes are ceilings an example cannot reach,
|
|
501
|
+
a million array elements among them, and each of those entries now carries an
|
|
502
|
+
`unexercised` sentence saying so, which expires by itself the day one is proved.
|
|
503
|
+
Eight entries whose example is the host's input rather than a script say that in
|
|
504
|
+
an example `kind`, and are held to it: a block declared not to be source that
|
|
505
|
+
compiles fails the build.
|
|
506
|
+
|
|
507
|
+
Every entry also used to carry `"test": "tests/errors/<CODE>"`, and that
|
|
508
|
+
directory has never existed in any commit. A hundred and forty-five pointers,
|
|
509
|
+
every one dead, printed as "Test `tests/errors/OS7009`" beside a rule promising
|
|
510
|
+
that every entry has a test. They now name a file under `tests/` that writes the
|
|
511
|
+
code, or `null`. Twenty-four codes carry the null, seventeen of them deferred and
|
|
512
|
+
seven taught as current behaviour and exercised by nothing, which is printed on
|
|
513
|
+
every run and recorded as an issue rather than papered over with a row somebody
|
|
514
|
+
invented. `spec/errors.md` part 8 is compared with `errors.json` character for
|
|
515
|
+
character for the pointer and both example blocks, because it is a copy and this
|
|
516
|
+
pair had drifted for every entry at once.
|
|
517
|
+
|
|
518
|
+
Two checks, `scripts/check-examples-compile.mjs` and
|
|
519
|
+
`scripts/check-catalogue-tests.mjs`, enforce all of it, and both say what they
|
|
520
|
+
cannot reach and count it: eleven host codes are the host's own answer and this
|
|
521
|
+
harness drives one host, so they are compiled, run, and listed by name as not
|
|
522
|
+
proved on every run.
|
|
523
|
+
|
|
524
|
+
**The order layer now refuses what the specification says it refuses.** Eight
|
|
525
|
+
codes of the orders range were written into the catalogue, taught across five
|
|
526
|
+
documents in the present tense, credited by a shipped example with protecting it,
|
|
527
|
+
and raised by nothing: an order call became an intent and was held against no
|
|
528
|
+
rule at all. Measured on a host built from the page, an absent quantity was
|
|
529
|
+
replaced with the declaration's size and filled, two opposite orders on one bar
|
|
530
|
+
both filled while the position read zero for the whole run, a pyramiding limit of
|
|
531
|
+
one let three entries through, and a typed order with no price for that type went
|
|
532
|
+
out unrefused. OS7002, OS7004, OS7006, OS7007, OS7008, OS7009, OS7010 and OS7013
|
|
533
|
+
are now raised at the call that wrote them, and each of them refuses before
|
|
534
|
+
anything is handed over: every order call on a bar is mapped before any of them
|
|
535
|
+
is routed, so a refused order reaches no destination rather than being sent and
|
|
536
|
+
then reported. OS7005, OS7011, OS7012, OS7014 and OS7015 stay deferred in the
|
|
537
|
+
catalogue, each with the sentence saying what has to exist before it is raised.
|
|
538
|
+
An argument the script left out and an argument it wrote that came out absent are
|
|
539
|
+
no longer one thing. They used to be: two of an order call's defaults are absence
|
|
540
|
+
itself, the compiler substituted them, and `buy()` and `buy(qty = none)` compiled
|
|
541
|
+
to byte identical programs, so OS7002 had nothing to fire on. The catalogue's own
|
|
542
|
+
worked example for that refusal, `buy(qty = 1, stop = lowest(low, 20))`, placed a
|
|
543
|
+
market order on every bar of the twenty bar window and then stop orders: a stop
|
|
544
|
+
entry silently became a market entry on every warmup bar. An order call now
|
|
545
|
+
carries the names of the arguments the script wrote, so `buy()` still takes the
|
|
546
|
+
declaration's size and `buy()` with neither price is still a market order, while
|
|
547
|
+
every order argument written as a value that came out absent, a quantity, a
|
|
548
|
+
limit, a stop, a trigger, a type, a tag, a bracket's target or its distance, is
|
|
549
|
+
OS7002 naming that argument and reaches no destination. The example that credited OS7013 with a
|
|
550
|
+
protection now says what that refusal covers and what the shape of the script
|
|
551
|
+
covers.
|
|
552
|
+
|
|
553
|
+
**A `close` that could never close anything is now refused, and the repository
|
|
554
|
+
now says one thing about what a tag argument means.** `close(tag = "entryy")`,
|
|
555
|
+
a tag no order in the file is placed with, sent nothing and said nothing: the
|
|
556
|
+
position stayed open and the script believed it had flattened. It is now OS7016,
|
|
557
|
+
reported at the call before any bar runs. The checker rather than the engine,
|
|
558
|
+
because the engine cannot tell that mistake from an ordinary bar: a tag that has
|
|
559
|
+
never named a ledger row is also what a working script looks like before its
|
|
560
|
+
entry has fired, and refusing that would stop a strategy whose exit signal simply
|
|
561
|
+
came first, with no guard available to write, since every call that reads the
|
|
562
|
+
ledger is planned. A file, unlike a run, is complete. What is not refused, and is
|
|
563
|
+
covered by a test of its own so that it stays that way, is a close on a tag that
|
|
564
|
+
holds nothing right now: closing the same tag twice sends one order and says
|
|
565
|
+
nothing about the second call.
|
|
566
|
+
|
|
567
|
+
Underneath it is a rule that was always in the signatures and had never been
|
|
568
|
+
written down: **a tag that defaults to the empty string is a label the call
|
|
569
|
+
carries to the destination, and a tag that is required or defaults to absence is
|
|
570
|
+
a reference to something that has to exist.** The catalogue disagreed with it.
|
|
571
|
+
OS7009's worked example was a bracket whose tag named no order, presented as a
|
|
572
|
+
refusal, while the engine sends that bracket without a word, as it should: a
|
|
573
|
+
bracket sets the leg's own level and its tag rides along as a label. The example
|
|
574
|
+
is now a cancellation, which does raise the code. OS7009's fix was worse than
|
|
575
|
+
wrong: it told the reader to test `order.working(tag)`, which is marked planned,
|
|
576
|
+
so the fix the catalogue handed a reader was itself a refusal. Both halves now
|
|
577
|
+
say something that compiles today.
|
|
578
|
+
|
|
579
|
+
**A strategy's position is folded from what it traded, and a host is no longer
|
|
580
|
+
asked for one.** The five position facts answered from a position row on the
|
|
581
|
+
engine's host type, which no specification document describes and which a host
|
|
582
|
+
built from the page does not supply. On such a host every one of them read
|
|
583
|
+
absent, so a guard written `flat = pos.size == 0` was absent rather than true,
|
|
584
|
+
the branch was not taken, and a strategy shipped in `examples/` placed no orders,
|
|
585
|
+
raised no diagnostic and drew its plots as though it were working. The run now
|
|
586
|
+
keeps the ledger those facts were always documented to come from: an order call
|
|
587
|
+
becomes the order intents the host interface specifies, each intent appends a
|
|
588
|
+
row, and the cumulative frames a host reports fold into those rows exactly as the
|
|
589
|
+
library page's fold says, including the repeated frame that must cost nothing and
|
|
590
|
+
the fill that arrives after a cancellation and must not be thrown away. What a
|
|
591
|
+
script reads is what that strategy traded, which is the point: an account
|
|
592
|
+
position row is shared with every other strategy and every manual trade in the
|
|
593
|
+
same contract, so a size computed against one is computed against somebody
|
|
594
|
+
else's. The position option on the chart adapter is gone with it.
|
|
595
|
+
|
|
596
|
+
**A host can now deliver an order frame.** Sending cumulative frames has been a
|
|
597
|
+
conformance duty since the host interface page was written, the frame was
|
|
598
|
+
specified in ten fields, and no engine exposed anywhere to put one: an
|
|
599
|
+
implementer working through the list searched for an interface that was not
|
|
600
|
+
there. An engine that takes orders now takes a frame at any moment between bars,
|
|
601
|
+
folds what arrived at the bar boundary so that every position fact is constant
|
|
602
|
+
for the length of one execution, and reports on that bar what each frame did,
|
|
603
|
+
a refused one included.
|
|
604
|
+
|
|
605
|
+
**A series the engine cannot run on is now refused instead of computed on.** Two
|
|
606
|
+
codes the host interface page requires, OS6010 for no bars at all and OS6011 for
|
|
607
|
+
a bar whose time does not follow the one before it, were in the catalogue and in
|
|
608
|
+
the conformance list and were raised by nothing. A host handing over an empty
|
|
609
|
+
dataset, a swapped pair or the same timestamp twice was accepted in silence and
|
|
610
|
+
the study computed on it, which is the worst failure this project has: not a
|
|
611
|
+
crash, a wrong number nobody is told about, entering at the boundary so that
|
|
612
|
+
every value downstream is confidently derived from bars that were never valid.
|
|
613
|
+
Both are now raised, at the hand-over, on the whole-dataset path and the bar at a
|
|
614
|
+
time path alike, and a refused series stops the run. The cost is one comparison
|
|
615
|
+
per bar handed over: about half a millisecond over fifty thousand bars, against a
|
|
616
|
+
full compute of the same history that the benchmark records at a hundred and
|
|
617
|
+
eighty five milliseconds, and it is paid where the bars arrive rather than on
|
|
618
|
+
every execution of them.
|
|
619
|
+
|
|
620
|
+
**A read the host refused now reports its reason when it is written inline.**
|
|
621
|
+
`req.error(read)` and `req.isReady(read)` answered about a read assigned to a
|
|
622
|
+
name and answered nothing at all about the same read written out inside the call:
|
|
623
|
+
the compiler resolved it to a handle and emitted no request under it, so the host
|
|
624
|
+
was never asked and the script was told nothing was wrong. A study that draws
|
|
625
|
+
nothing while its own diagnostics say nothing is wrong is the worst version of a
|
|
626
|
+
silent failure, because the user has already looked and been sent to look
|
|
627
|
+
elsewhere. A read written inline is now a read like any other: it is emitted, the
|
|
628
|
+
host is asked about it, and its refusal reaches the script. Two reads written in
|
|
629
|
+
one file are two requests and count as two against a host's ceiling, which
|
|
630
|
+
`spec/host-interface.md` section 5.2 now states.
|
|
631
|
+
|
|
632
|
+
**A request now carries what the host interface page says it carries.** A host
|
|
633
|
+
built from `spec/host-interface.md` section 5.2 alone could not implement duty 3:
|
|
634
|
+
the table printed six fields, three of which never arrived, and the request
|
|
635
|
+
carried three more the table did not print. The request is now `id`, `read`,
|
|
636
|
+
`instrument`, `exchange`, `timeframe`, `mode` and `warmup`, on the page and in
|
|
637
|
+
the engine. `symbol` is `instrument`, which is what the page calls it and what
|
|
638
|
+
section 9 says it is; `read`, `mode` and `warmup` are documented, because the
|
|
639
|
+
engine sends them and they are each worth having; and `from` and `to` are gone
|
|
640
|
+
from the page, because the whole set of requests is settled before bar 0 and at
|
|
641
|
+
that moment the engine holds no bars and has no span to state. The page now gives
|
|
642
|
+
the arithmetic instead: the chart's own span, extended backwards by `warmup`
|
|
643
|
+
requested bars, worked out by the host, which is the side that has the bars.
|
|
644
|
+
|
|
645
|
+
**A read of another instrument is now told which exchange to resolve it on.**
|
|
646
|
+
`req.symbol`'s `exchange` defaults to `chart.exchange` in `stdlib.md` 15.1, the
|
|
647
|
+
compiled format spells the omission as an absence meaning the chart's own, and
|
|
648
|
+
the engine passed the absence straight through. A host was therefore left to
|
|
649
|
+
resolve an instrument on no venue at all wherever a script did not name one,
|
|
650
|
+
which is a different contract wherever a ticker is listed twice. The engine now
|
|
651
|
+
resolves it, along with the identity of a read of the chart's own instrument,
|
|
652
|
+
so every request carries an identity and a venue rather than a rule to apply.
|
|
653
|
+
|
|
654
|
+
**An instrument record that contradicts itself is now refused at load.** A host
|
|
655
|
+
that stated a `session` and no `timezone`, a session spelled `"9:00"` rather than
|
|
656
|
+
`"09:00"`, or days numbered from Sunday as zero, lost `vwap` and every session
|
|
657
|
+
study on every bar with nothing reported anywhere, because that is exactly what
|
|
658
|
+
an instrument with no schedule looks like. Each of the three is OS6012 at load
|
|
659
|
+
naming what is missing, and so is a timezone no calendar can read. A host that
|
|
660
|
+
states no session at all is unchanged and still conforming: the per-bar session
|
|
661
|
+
facts are absent and a script tests for them.
|
|
662
|
+
|
|
663
|
+
**An alert's message now carries the bar that fired it.** A study that computed
|
|
664
|
+
`"crossed up at " + text(close, 2)` sent a notification reading "Crossed up", the
|
|
665
|
+
declared title, on every alert this adapter has ever raised. The message is a
|
|
666
|
+
string per bar, so it cannot travel in the table of numbers a calculation
|
|
667
|
+
returns, and it was left out on the ground that nothing carried it across. The
|
|
668
|
+
chart's own entry takes a function of the same context its condition was judged
|
|
669
|
+
on, and that context carries the settings object, which is how every other hook
|
|
670
|
+
here finds the run it is reading. So the message is read from the run at the bar
|
|
671
|
+
that fired, and an alert whose message was absent on that bar still falls back to
|
|
672
|
+
the title, which is what a chart does for an entry that states no message at all.
|
|
673
|
+
|
|
674
|
+
**A `draw` setter now takes only the objects it can move.** Eleven of the
|
|
675
|
+
fourteen setters declared their object argument as "whatever you give me",
|
|
676
|
+
because the real type is a set of kinds and there was no way to write one. So
|
|
677
|
+
`draw.setFrom(aLabel, t, p)` compiled, wrote an anchor a label has no field for,
|
|
678
|
+
drew nothing and reported nothing, and `draw.setColor(5, red)` compiled as
|
|
679
|
+
readily. Each setter now names the kinds that carry the property it writes, which
|
|
680
|
+
is the kinds whose creation call takes that argument, and a call that misses is
|
|
681
|
+
OS3011 at that argument with the kinds it does take in the sentence. A
|
|
682
|
+
declaration handle in the same place keeps OS3019. Two documentation tables
|
|
683
|
+
promised more than any kind carries, `setStyle` on a box and `setTooltip` on a
|
|
684
|
+
line, and they now say what is drawn.
|
|
685
|
+
|
|
686
|
+
**A second declared grid is still dropped, and the drop is now written down and
|
|
687
|
+
checked.** A chart pane has one grid and the language declares as many as it
|
|
688
|
+
likes, so a study with two panels draws one, and nothing said so anywhere. The
|
|
689
|
+
refusal that belongs there cannot be written: it needs a catalogue code for a
|
|
690
|
+
host that cannot draw something a study declares, the catalogue has none, and
|
|
691
|
+
this project reports the gap rather than inventing one. It is reported in
|
|
692
|
+
`issues/0011`, with the sentence the entry should carry, and the documentation
|
|
693
|
+
for tables now tells a reader that the first declared grid is the one drawn.
|
|
694
|
+
|
|
695
|
+
Meanwhile the class is checked instead of promised. `spec/chart-narrowings.json`
|
|
696
|
+
records every field and every count the chart adapter does not carry, each with
|
|
697
|
+
its reason, and `scripts/check-chart-surface.mjs` compiles a study that declares
|
|
698
|
+
two of everything, builds a descriptor from it, and fails the build on a declared
|
|
699
|
+
field the record does not mention, a record entry the compiled format no longer
|
|
700
|
+
has, a narrowing recorded with no reason, and any declaration dropped whose limit
|
|
701
|
+
is not recorded. It also reads the mapping back out of a run, so a field recorded
|
|
702
|
+
as carried cannot be a claim. The record began with eight narrowings, one of them
|
|
703
|
+
found by writing it: a band whose colour is computed per bar has no per-bar colour
|
|
704
|
+
in a chart's band and is drawn in the first plot's colour.
|
|
705
|
+
|
|
706
|
+
**Every documented default now reaches the call.** `atr()`, `rsi(close)`,
|
|
707
|
+
`bollinger(close)`, `macd(close)`, `stoch()`, `psar()`, `supertrend()`, `adx()`,
|
|
708
|
+
`keltner()`, `donchian()`, `cci()`, `williamsR()` and the rest: twenty-nine calls
|
|
709
|
+
out of thirty-one, written exactly as the library reference prints them,
|
|
710
|
+
compiled with nothing reported, loaded with nothing reported, ran to the last bar
|
|
711
|
+
and drew no value on any bar. The reference gives each of those arguments a
|
|
712
|
+
default, the surface recorded only that the argument was optional, and an
|
|
713
|
+
argument left out reached the engine as absence, where a lookback of an absent
|
|
714
|
+
length answers absence for ever. Only the calls whose length was written out drew
|
|
715
|
+
anything.
|
|
716
|
+
|
|
717
|
+
The hundred and sixty missing defaults are now written into the surface, taken
|
|
718
|
+
from the reference, and an omitted argument is filled with the value the
|
|
719
|
+
reference prints. `vwap()` reads `hlc3`, a calendar call reads the chart's
|
|
720
|
+
timezone, and a grid cell written with no alignment is aligned left, each exactly
|
|
721
|
+
as writing the argument out would have done. A warmup follows its default too: an
|
|
722
|
+
omitted length used to weaken a study's warmup to a floor, so `atr()` promised
|
|
723
|
+
"no earlier than" where `atr(14)` promises bar 13. Both now promise bar 13.
|
|
724
|
+
|
|
725
|
+
A check refuses the class rather than the instance. An optional parameter must
|
|
726
|
+
either carry the default the specification states, spelled as the specification
|
|
727
|
+
spells it, or be recorded in `spec/default-exceptions.json` with what the
|
|
728
|
+
specification says in place of a value and why that is not one. Neither is a
|
|
729
|
+
defect and both is a contradiction, and a default the surface invented or one
|
|
730
|
+
that has drifted from the specification fails the build as well. Seventeen
|
|
731
|
+
parameters are recorded: the leg an order acts on and the size the `strategy()`
|
|
732
|
+
declaration sets, which the library has no value for, and one row that states no
|
|
733
|
+
mode where the two beside it do.
|
|
734
|
+
|
|
735
|
+
**The library the reference page promises now runs.** Ninety-five names compiled
|
|
736
|
+
and were then refused at load with an error that named a function and gave no
|
|
737
|
+
reason. Every one of them is settled: it either runs or says it is planned at the
|
|
738
|
+
call, where you can see what you wrote.
|
|
739
|
+
|
|
740
|
+
Sixty-three names that could not run now do. The moving averages `dema`, `tema`,
|
|
741
|
+
`vwma`, `swma`, `alma`, `linreg` and `ma`; the trend frames `psar`, `adx`,
|
|
742
|
+
`aroon` and `ichimoku`; the oscillators `stoch`, `stochRsi`, `ppo`, `cci`,
|
|
743
|
+
`williamsR`, `tsi`, `trix`, `cmo`, `dpo`, `ultimateOsc` and `awesomeOsc`;
|
|
744
|
+
`keltner`, `chop` and `hv`; the whole of the volume section, `vwap` and
|
|
745
|
+
`vwapAnchor` among it; `percentRank`, `correlation` and `covariance`; every
|
|
746
|
+
calendar call in `date`, and `session.isIn` with them; and the six instrument
|
|
747
|
+
facts `chart.timezone`, `chart.pointValue`, `chart.currency`,
|
|
748
|
+
`chart.instrumentType`, `chart.hasVolume` and `chart.hasOpenInterest`.
|
|
749
|
+
|
|
750
|
+
The arithmetic for the studies was already written and gated against reference
|
|
751
|
+
vectors; what was missing was a form an engine could drive a bar at a time, so
|
|
752
|
+
each one is now a step over a state region like the rest of the library, and its
|
|
753
|
+
whole-series form is that step folded. There is still one implementation of every
|
|
754
|
+
formula, and the engine holds none of it.
|
|
755
|
+
|
|
756
|
+
The calendar is new. It reads an instant in a named zone using the runtime's own
|
|
757
|
+
timezone database rather than a table copied into this package, because a copied
|
|
758
|
+
table goes stale silently in exactly the way a fixed offset does. Two readings
|
|
759
|
+
that have no single instant are settled in the specification rather than left to
|
|
760
|
+
an engine: an hour a spring change removed resolves to where it would have been,
|
|
761
|
+
and an hour an autumn change repeated resolves to the first of the two.
|
|
762
|
+
`date.weekOfYear` is the ISO week, which the specification now states.
|
|
763
|
+
|
|
764
|
+
Fifty-nine names are now marked planned instead of failing at load. The strategy
|
|
765
|
+
surface, everything in `order`, `leg` and `book` that is folded from a ledger, and
|
|
766
|
+
the position facts beyond the five an engine reads from the account's own row: no
|
|
767
|
+
engine holds a ledger in this release. So are the four session facts read off the
|
|
768
|
+
instrument's trading hours, which the engine's host record does not yet carry.
|
|
769
|
+
Nothing was removed from the specification; a marked name is refused where it is
|
|
770
|
+
written, with a message saying it is planned.
|
|
771
|
+
|
|
772
|
+
A test now fails the build if a name the checker accepts can neither run nor says
|
|
773
|
+
it is planned, so this cannot come back quietly.
|
|
774
|
+
|
|
775
|
+
**Three diagnostics now say what is true.** Calling or reading a name the library
|
|
776
|
+
lists as planned reports OS2020, whose message says the name is planned. It used to
|
|
777
|
+
report OS2001, which told a reader the name was not defined at this point in the
|
|
778
|
+
file and offered them a different function as the fix. OS2004 no longer tells a
|
|
779
|
+
reader to assign the value to a name at the top level in the case where it already
|
|
780
|
+
is one: a declaration handle, a runtime object and a library fact that is not a
|
|
781
|
+
series have no history whatever they are named, and the fix now says so. OS6016 no
|
|
782
|
+
longer describes a program below the engine's format as though it were above it,
|
|
783
|
+
and says that the major number decides in either direction.
|
|
784
|
+
|
|
785
|
+
**The integration guide described a surface the engine does not have.** The page on
|
|
786
|
+
running the engine told an integrator to hand over columnar arrays, one per field.
|
|
787
|
+
The engine takes one object per bar, so code written from that page did not compile
|
|
788
|
+
against the library. The page now describes the surface as it is, and the memory
|
|
789
|
+
case it was making, which is real and unanswered, is measured in `issues/0005`.
|
|
790
|
+
|
|
791
|
+
**Higher timeframe and other instrument reads run.** A file containing one used
|
|
792
|
+
to compile, carry its capability tag, and be refused at load with a message
|
|
793
|
+
naming the capability. The engine now evaluates a read's expression over the
|
|
794
|
+
requested bars and folds the result onto the chart's, so `req.timeframe`,
|
|
795
|
+
`req.symbol`, `req.isReady` and `req.error` do what the reference page says.
|
|
796
|
+
|
|
797
|
+
A read of the chart's own instrument at a coarser interval is folded from the
|
|
798
|
+
bars the engine already holds and needs nothing from a host. A read of another
|
|
799
|
+
instrument needs bars only a host can supply, so a host states a request provider
|
|
800
|
+
and an engine without one still refuses exactly those files, by name, at load:
|
|
801
|
+
that path is what an older engine uses to tell a newer file what it lacks, and it
|
|
802
|
+
is kept and tested.
|
|
803
|
+
|
|
804
|
+
**The three modes produce three different numbers, and the difference is the
|
|
805
|
+
whole repainting question.** A `"confirmed"` read takes the last coarse bar that
|
|
806
|
+
closed and steps on the first chart bar of the next one, so it never uses a bar
|
|
807
|
+
that had not happened. A `"developing"` read is the coarse bar as it stands on
|
|
808
|
+
this chart bar. A `"lookahead"` read is the coarse bar in full, from its first
|
|
809
|
+
chart bar, which is why it repaints. The first two stop at the bar being executed,
|
|
810
|
+
so a chart given a whole dataset and a chart given one bar at a time compute the
|
|
811
|
+
same numbers; the third reads past the bar, which is the mode.
|
|
812
|
+
|
|
813
|
+
**Read the default twice if you have written `[1]` inside a read.**
|
|
814
|
+
`req.timeframe("1D", high)` is yesterday's high, because `"confirmed"` is the
|
|
815
|
+
default and it takes the last day that closed. `req.timeframe("1D", high[1])` is
|
|
816
|
+
the day before that. Three documentation pages had those one day apart and said
|
|
817
|
+
so in words; they now say what the specification has said all along, and the
|
|
818
|
+
previous-session example no longer takes the extra step back.
|
|
819
|
+
|
|
820
|
+
A read's warmup is counted in requested bars rather than chart bars, because the
|
|
821
|
+
expression runs on the requested ones: `req.timeframe("1D", sma(close, 20))` is
|
|
822
|
+
absent until twenty daily bars have closed, which on an intraday chart is about a
|
|
823
|
+
month of history. A day, a week and a month are folded by the calendar, so a read
|
|
824
|
+
at one of them needs the instrument's timezone and is absent without it rather
|
|
825
|
+
than dated in a zone nobody chose.
|
|
826
|
+
|
|
827
|
+
A request that cannot be folded is refused at load with the code that names it,
|
|
828
|
+
OS6002 for one finer than the chart and OS6015 for one that is not a whole
|
|
829
|
+
multiple of it, and a timeframe a setting supplied that is not a timeframe is
|
|
830
|
+
OS6001. A refusal from the host is not: an unknown instrument, a range with no
|
|
831
|
+
bars, a source that would not answer and an interval the feed does not carry
|
|
832
|
+
leave the read absent, put the host's own words in `req.error(read)`, and let the
|
|
833
|
+
rest of the study keep drawing. A host's ceiling on how many reads a file may make
|
|
834
|
+
is OS5006 at load, with the count named rather than reads dropped quietly.
|
|
835
|
+
|
|
836
|
+
The compiled format gains no field. What it gained is section 2.16.2, the fold
|
|
837
|
+
itself: which requested bar each chart bar may see, written out so that a second
|
|
838
|
+
engine computes the same number rather than inventing its own alignment.
|
|
839
|
+
|
|
840
|
+
**A read's expression is verified like the program it sits in.** The same
|
|
841
|
+
interpreter walks it over another instrument's history, so its tables, its
|
|
842
|
+
instruction list and the lists of the functions it calls all go through check 1
|
|
843
|
+
and check 8. A body that was not verified could jump out of its own instruction
|
|
844
|
+
list, and the failure would have looked like a wrong number.
|
|
845
|
+
|
|
846
|
+
**Every output a study can produce now reaches a chart.** Markers, bar colouring,
|
|
847
|
+
the pane background, summary grids, watched conditions, drawing objects and reads
|
|
848
|
+
of another instrument were all fields the compiled program carried and the chart
|
|
849
|
+
adapter left empty, so a study that called `signal`, `barColor`, `background`,
|
|
850
|
+
`cell`, `alert`, `draw.line` or `req.symbol` computed everything and drew none of
|
|
851
|
+
it. Each of them is mapped onto the field the chart already has for it, under the
|
|
852
|
+
chart's own name for that field and taking the chart's own argument.
|
|
853
|
+
|
|
854
|
+
A marker arrives with its text, its declared shape and position and the bar's own
|
|
855
|
+
time, and only for the bars its branch was taken on. A bar colour and a background
|
|
856
|
+
arrive as columns of colours beside the plot columns, so a spliced tail carries
|
|
857
|
+
them. A grid arrives as the last executed bar left it, read once per calculation
|
|
858
|
+
rather than once per bar, which is the difference between a constant cost and the
|
|
859
|
+
length of the history, and its cells are placed into the declared size so that a
|
|
860
|
+
cell nothing wrote is blank rather than missing. A watched condition arrives as a
|
|
861
|
+
row a user can subscribe to, under the `id` the script gave it, whose predicate
|
|
862
|
+
reads the guard chain out of a column.
|
|
863
|
+
|
|
864
|
+
**A study's drawing objects are handed to the chart as a set, and the set is
|
|
865
|
+
replaced every time.** A line, a label, a box or a path the script created, moved,
|
|
866
|
+
recoloured and deleted over many bars arrives as the shapes it currently holds,
|
|
867
|
+
in the order it created them. Nothing has to tell the chart about a deletion, and
|
|
868
|
+
a bar that re-executed five times leaves what one execution of it leaves, because
|
|
869
|
+
the engine has already rolled the set back. An anchor crosses as a time and a
|
|
870
|
+
price, converted into the seconds a chart counts exactly where a bar's time is,
|
|
871
|
+
and an anchor past the newest bar stays where it was written so a projection
|
|
872
|
+
reaches into the margin. An anchor missing its time or its price draws nothing,
|
|
873
|
+
and a path with a hole in it becomes one shape per stretch that has none, rather
|
|
874
|
+
than a line through prices the script never named.
|
|
875
|
+
|
|
876
|
+
**A read of another instrument fetches through the chart, and the study draws
|
|
877
|
+
while it waits.** The engine settles every read before bar 0 and asks the host
|
|
878
|
+
there and then; a chart answers later, and a chart computes a study once before
|
|
879
|
+
it attaches the lifecycle that has the transport. So the first calculation says
|
|
880
|
+
"not yet", the read is absent, `req.isReady` is false and everything that does not
|
|
881
|
+
depend on the read is drawn; the answer asks for the recompute that uses it. The
|
|
882
|
+
range asked for covers the chart's own span, extended back by the read's warmup
|
|
883
|
+
and quantised to requested bar boundaries, so a chart that ticks does not fetch
|
|
884
|
+
once per bar, and what was fetched keeps serving while a wider fetch is in flight.
|
|
885
|
+
A host that refuses is carried through as its own words, in `req.error` for the
|
|
886
|
+
script and in the study's data status for the user, with a retry offered.
|
|
887
|
+
|
|
888
|
+
**An alert fires for now and never for history.** Adding a study to a chart
|
|
889
|
+
holding two years of bars fires nothing for any of them. The rule is in the
|
|
890
|
+
specification rather than in a host: an alert is raised only on a bar the host
|
|
891
|
+
states it is driving live and has confirmed, and `isRealtime` is a fact the host
|
|
892
|
+
already states for every execution. The frequency is the engine's too: `once` is
|
|
893
|
+
once for the life of the study, `oncePerBar` is once for a bar however many times
|
|
894
|
+
that bar executes, and `everyUpdate` is once per execution. A host whose own
|
|
895
|
+
runtime watches the declared conditions applies the same rule from its side, by
|
|
896
|
+
judging only the bars that are new since it last looked.
|
|
897
|
+
|
|
898
|
+
**A marker no longer appears on a bar that is still moving.** The channel
|
|
899
|
+
carrying it was published for every bar whatever the bar's state, so a host
|
|
900
|
+
reading the column drew the marker on a tick and took it off on the next one.
|
|
901
|
+
Step 9 discards a deferred channel on a bar it did not decide, and the columns a
|
|
902
|
+
host reads now say so. Plot columns are unaffected and are still published on
|
|
903
|
+
every execution.
|
|
904
|
+
|
|
905
|
+
**Which study owns the candles is a stated rule.** The instrument's bars are one
|
|
906
|
+
object and two studies painting them are two answers to one question. The owner
|
|
907
|
+
is the study latest in the chart's own study order that paints, which is the
|
|
908
|
+
order a legend shows and a user reorders, so it does not change because one
|
|
909
|
+
study recomputed before another. Every other study's bar colouring is not drawn.
|
|
910
|
+
|
|
911
|
+
**Five declaration options that could not be carried now say so at the line that
|
|
912
|
+
wrote them.** A level's colour, a grid's two colours and an alert's `id`, `title`
|
|
913
|
+
and `frequency` are written into the program before the first bar, and one
|
|
914
|
+
computed from bar data used to reach the compiler with nowhere to put it: it
|
|
915
|
+
reported OS6018, which says the program is malformed and asks the author to
|
|
916
|
+
report a compiler defect. They are checked with OS3003 like every other fixed
|
|
917
|
+
option, which names the option and says what to write instead.
|
|
918
|
+
|
|
919
|
+
**A colour built out of constants counts as one.** `fade(red, 50)` is the same
|
|
920
|
+
four numbers on every bar, and it is what a level or a marker is normally
|
|
921
|
+
coloured with. The checker accepts exactly the six colour calls the compiler
|
|
922
|
+
folds, so a field that has to be fixed before bar 0 can hold one.
|
|
923
|
+
|
|
924
|
+
**Two alerts can no longer share one name.** A subscription is kept under the
|
|
925
|
+
alert's id, so two entries under one name left the host with two conditions and
|
|
926
|
+
one row and nothing to say which the user subscribed to. It is OS3017, the same
|
|
927
|
+
code two plots sharing a title get, and it counts the derived name as well as
|
|
928
|
+
the written one. An id taken from an `input()` is derived rather than used, for
|
|
929
|
+
the reason OS8008 now gives: a name that moves when somebody opens the settings
|
|
930
|
+
dialog is not a name a subscription can be kept under. A derived id is now taken
|
|
931
|
+
from the call's line, which is what OS8008 said all along.
|
|
932
|
+
|
|
933
|
+
**The trailing stop in the volatility example drew nothing.** The band trails
|
|
934
|
+
against the band as it stood, and `max` and `min` propagate absence like every
|
|
935
|
+
other calculation, so the first bar after the average warmed up trailed against
|
|
936
|
+
an absent band, the band went absent, and the next bar's previous band was that
|
|
937
|
+
absence. The study ran, kept its legend row and plotted an empty column for the
|
|
938
|
+
rest of the dataset. The example reads the previous band through `orElse` in the
|
|
939
|
+
trail as well as in the comparison, and a test fails the build if that column
|
|
940
|
+
stops being drawn.
|
|
941
|
+
|
|
942
|
+
**A cell alignment that is not one of the three is refused.** `align = "middle"`
|
|
943
|
+
compiled and was silently drawn left for ever. It is OS3008, which names the
|
|
944
|
+
three and suggests the nearest.
|
|
945
|
+
|
|
946
|
+
**Drawing objects are live.** Lines, labels, boxes and polylines are created,
|
|
947
|
+
moved, extended, restyled, deleted and counted as bars arrive. Thirty-one calls,
|
|
948
|
+
every one of them driven bar by bar in the tests, and the lifetime rules the
|
|
949
|
+
specification states are now the ones the engine keeps.
|
|
950
|
+
|
|
951
|
+
Three of those rules decide what a study looks like on a live chart. An object
|
|
952
|
+
created while the newest bar was moving is rolled back when that bar runs again,
|
|
953
|
+
along with every change made to an object that already existed, so five updates
|
|
954
|
+
and a confirm leave exactly what one pass leaves and a live chart does not gain a
|
|
955
|
+
copy per tick. A setter given an object the script already deleted is OS4005 with
|
|
956
|
+
the bar it went on, rather than a silent no operation that leaves a drawing that
|
|
957
|
+
quietly stopped moving; a setter given `none` does nothing, which is what the
|
|
958
|
+
catalogue's own fix for OS4005 asks a script to produce. An anchor is a time and
|
|
959
|
+
a price and is never resolved against a bar, so an anchor past the newest bar
|
|
960
|
+
reaches into the margin and an old one does not move when more history loads.
|
|
961
|
+
|
|
962
|
+
**A ceiling on drawing objects, reported rather than absorbed: OS5010.** An
|
|
963
|
+
object lives until the script deletes it and nothing can reclaim one that is
|
|
964
|
+
still drawing, so a script that creates one per bar and deletes none used to grow
|
|
965
|
+
until the machine stopped it. It now stops with a diagnostic that names the
|
|
966
|
+
ceiling and the count. The ceiling is the host's, as the string ceiling is; the
|
|
967
|
+
language still fixes no number and nothing is ever dropped to make room, which is
|
|
968
|
+
the part that would make a study wrong on the left of the chart and right on the
|
|
969
|
+
right.
|
|
970
|
+
|
|
971
|
+
**An argument a drawing call leaves out now arrives as the default the
|
|
972
|
+
specification gives it.** `draw.line(t1, p1, t2, p2)` used to reach the engine
|
|
973
|
+
with an absent colour, an absent width and an absent line style, and absence on a
|
|
974
|
+
drawing surface means nothing is drawn. The library surface carries these four
|
|
975
|
+
calls' defaults and the compiler writes them into the program, so an engine needs
|
|
976
|
+
no table of them.
|
|
977
|
+
|
|
978
|
+
**A polyline keeps its own path.** The two arrays are read once, at the call, and
|
|
979
|
+
`draw.setPoints` is what changes a path, so pushing to an array a script kept for
|
|
980
|
+
its own bookkeeping no longer silently redraws a shape. The arrays are paired by
|
|
981
|
+
index, and a point missing a time or a price is a gap in the path rather than a
|
|
982
|
+
point dropped.
|
|
983
|
+
|
|
984
|
+
**`Engine.drawings()` hands a host facts instead of heap contents.** Each live
|
|
985
|
+
object arrives as its kind, its anchors in time and price, and its style, in
|
|
986
|
+
creation order. A host no longer dereferences anything, which it had no way to
|
|
987
|
+
do: a polyline's path was a handle into the engine's own heap.
|
|
988
|
+
|
|
989
|
+
**Two library calls no script could make are now callable.** The conversions to
|
|
990
|
+
`bool` and to `number` were published under those names, and both are reserved
|
|
991
|
+
words, so every spelling of them was refused before the checker saw one, with a
|
|
992
|
+
message about naming a variable handed to somebody who had written a call. They
|
|
993
|
+
are now `toBool(x)` and `toNumber(s)`. `text(x)` is unchanged: it is not a type
|
|
994
|
+
name, so it never collided.
|
|
995
|
+
|
|
996
|
+
If you wrote either old spelling it did not compile, so nothing that ran before
|
|
997
|
+
stops running. Writing one now is still OS1019, and the fix names the spelling
|
|
998
|
+
that works instead of telling you to rename a variable you never declared. The
|
|
999
|
+
rule behind it is in the specification: no library name is a reserved word, and a
|
|
1000
|
+
test fails the build if one ever is again.
|
|
1001
|
+
|
|
1002
|
+
**The no-eval check can no longer be got past.** The first rule of this project is
|
|
1003
|
+
that nothing here builds code out of text, and the check enforcing it knew only
|
|
1004
|
+
the obvious spellings. It now refuses the function builder however it is reached,
|
|
1005
|
+
including through `call`, `apply`, `bind`, `Reflect.construct` and a constructor
|
|
1006
|
+
property taken as a value; a name looked up on the global object by computed key;
|
|
1007
|
+
the runtime's own compiler reached through a binding rather than by naming its
|
|
1008
|
+
module; code assembled out of bytes; text put into a document; and a module
|
|
1009
|
+
specifier built out of text. It reads the git hooks and the compiled tests as
|
|
1010
|
+
well, which it never did. Before reading a file it puts forty-eight attack forms
|
|
1011
|
+
through its own rules and stops the build if one is not caught, or if an innocent
|
|
1012
|
+
form is.
|
|
1013
|
+
|
|
1014
|
+
**The build removes output that no source makes.** A compiled module from a
|
|
1015
|
+
layout two refactors old was still in `dist`, which `package.json` publishes, so
|
|
1016
|
+
the package carried a file no source produced, no test covered and nothing here
|
|
1017
|
+
explains. Every build now names and removes any such file before it compiles,
|
|
1018
|
+
in both outputs, reading the directories from the compiler's own configuration
|
|
1019
|
+
rather than from a copy of them.
|
|
1020
|
+
|
|
1021
|
+
**OS8001 now reaches a call that could be written past it.** The warning for a
|
|
1022
|
+
stateful call that runs on some bars and not others was decided by the pass that
|
|
1023
|
+
walks statements, so it saw an `if`, a `switch` arm and a loop body and nothing
|
|
1024
|
+
else. `v = trending ? ema(close, 20) : none` compiled with nothing reported and
|
|
1025
|
+
drew an average of the bars the guard let through, presented as an average. The
|
|
1026
|
+
warning now covers a ternary arm, both of them; the right operand of `and` and
|
|
1027
|
+
`or`, which is skipped whenever the left one has already decided the answer; the
|
|
1028
|
+
condition of an `else if`; and the values of a `case` arm after the first. Each
|
|
1029
|
+
of those is a place a bar can pass without evaluating the call, and the engine
|
|
1030
|
+
always ran them that way. What was missing was the compiler saying so.
|
|
1031
|
+
|
|
1032
|
+
A file that compiled clean before can report OS8001 now. Nothing it computes has
|
|
1033
|
+
changed, and the fix is the one the warning already names: take the call at the
|
|
1034
|
+
top level and use its result inside the guard.
|
|
1035
|
+
|
|
1036
|
+
**A tunable declaration option now compiles.** `language.md` 13.2 has always
|
|
1037
|
+
allowed an option value to be "a literal, arithmetic over literals, or a call to
|
|
1038
|
+
`input()`", 13.4 allows an `input()` anywhere at the top level of a file, and
|
|
1039
|
+
`decisions.md` decision 9 settled how such an option reaches a compiled program.
|
|
1040
|
+
The emitter carried none of it. An `input()` that was not the entire right-hand
|
|
1041
|
+
side of a top-level assignment had nowhere to go, so
|
|
1042
|
+
`study("Range", precision = input(2, "Precision"))` was refused with OS6018 and
|
|
1043
|
+
no program, and so were `study(input("R", "Title"))`,
|
|
1044
|
+
`len = input(14, "Length") + 1` and an input written inside any other expression.
|
|
1045
|
+
OS6018's message says a program that fails verification came from a broken
|
|
1046
|
+
compiler, so a correct script was told it had found our bug, and every
|
|
1047
|
+
declaration option in the language was a literal in practice whatever the page
|
|
1048
|
+
said. A platform adopting the language from those pages wrote a study that would
|
|
1049
|
+
not compile.
|
|
1050
|
+
|
|
1051
|
+
Two halves were missing and both are here. Folding now resolves an `input()`
|
|
1052
|
+
written in place to the `{ "input": "<key>" }` reference of
|
|
1053
|
+
`compiled-program.md` 2.3, which is the form decision 9 put in the format and
|
|
1054
|
+
which every field of `meta`, of `meta.strategy` and of every declaration in
|
|
1055
|
+
`outputs` may hold; the engine substitutes the resolved value at load, as it
|
|
1056
|
+
already did for an option written as a name. And an `input()` read inside an
|
|
1057
|
+
expression now loads the slot the engine writes at step 5 of every bar, while the
|
|
1058
|
+
same call written as the whole of `name = input(...)` goes on emitting nothing,
|
|
1059
|
+
because there the name and the input share that slot and the engine's write is
|
|
1060
|
+
the assignment. The two are told apart by which caller reaches the emitter, never
|
|
1061
|
+
by inspecting the call: the statement is the only place that can see whether the
|
|
1062
|
+
call is the whole of itself.
|
|
1063
|
+
|
|
1064
|
+
A colour computed from an input comes back with the rest of it.
|
|
1065
|
+
`plot(close, "C", fade(input(aqua, "Tint"), 50))` was refused for the same
|
|
1066
|
+
reason: the per-bar colour path emits the expression a script wrote, and the
|
|
1067
|
+
input inside it emitted nothing. It paints the colour the setting gives it on
|
|
1068
|
+
every bar now, which is what the checker had always accepted.
|
|
1069
|
+
|
|
1070
|
+
Nothing is now allowed that 13.2 and 13.4 did not already allow. An `input()`
|
|
1071
|
+
inside a block or a function is still OS3007, and the single line form of a
|
|
1072
|
+
function body is now held to that rule as the indented form always was:
|
|
1073
|
+
`fn f(x) => x + input(3, "K")` was checked as though it stood at the top level
|
|
1074
|
+
and declared a settings row from inside a function with nothing said.
|
|
1075
|
+
|
|
1076
|
+
**A `close` no longer crosses zero, and the ledger no longer keeps a row for an
|
|
1077
|
+
order nobody was sent.** On a leg holding one unit long, `close(qty = 5)` sent
|
|
1078
|
+
one sell of five: the leg ended the bar four short, under one position
|
|
1079
|
+
reference, with no diagnostic anywhere, and a call named `close` had opened a
|
|
1080
|
+
position. `stdlib.md` 17.1 forbids it outright, and a quantity the script
|
|
1081
|
+
states was the one a close sent without working it out. It is now OS7017,
|
|
1082
|
+
naming what was asked for and what is left to close, and the call reaches no
|
|
1083
|
+
destination: a bar that places a good
|
|
1084
|
+
order and then meets it sends nothing at all, the good order included.
|
|
1085
|
+
|
|
1086
|
+
Refused rather than quietly reduced to what is there. Sending the smaller number
|
|
1087
|
+
would send a quantity the script did not write and leave it believing it had
|
|
1088
|
+
closed the one it did, which is the wrong belief this release has now refused
|
|
1089
|
+
three times already; and reading the call as a reversal would let `close` open a
|
|
1090
|
+
position, which the order page already calls the most expensive naming mistake
|
|
1091
|
+
available. `close()` with no quantity is untouched and goes on working the
|
|
1092
|
+
number out for itself.
|
|
1093
|
+
|
|
1094
|
+
One consequence is worth knowing before you meet it.
|
|
1095
|
+
`close(tag = "entry", qty = 1)` on a tag that has already flattened is now
|
|
1096
|
+
refused, while `close(tag = "entry")` on that same tag stays silent and
|
|
1097
|
+
idempotent. The two look inconsistent and are not: a quantity is an argument the
|
|
1098
|
+
script wrote, so it is a claim about its own position and the claim can be
|
|
1099
|
+
false, while a call with no quantity asks the engine for the right number and has
|
|
1100
|
+
nothing in it to be wrong about. It is the same sentence that separates `buy()`
|
|
1101
|
+
from `buy(qty = none)`. The comparison with a stated quantity is made in
|
|
1102
|
+
full only where that quantity and the folded position count the same thing,
|
|
1103
|
+
which is a declaration whose `qtyType` is `"units"`; in lots, cash or equity
|
|
1104
|
+
percent they are different kinds of number, and the entry below says which half
|
|
1105
|
+
of it is made anyway.
|
|
1106
|
+
|
|
1107
|
+
The second half of that area: `engine.orders()` reported rows for orders no
|
|
1108
|
+
destination was ever handed. A bar that placed an order tagged `"good2"` and
|
|
1109
|
+
then called `cancel("nosuch")` left the destination with zero intents from that
|
|
1110
|
+
bar, which is right, and left the ledger reporting `good2` at `placed` with an
|
|
1111
|
+
empty `orderRef`. A host reconciling against that record after a stopped run saw
|
|
1112
|
+
an order it never received. A bar's rows and a bar's orders are now the same set:
|
|
1113
|
+
mapping a call still appends its row, because the calls after it on the same bar
|
|
1114
|
+
are measured against the rows before it, and a bar that is then refused takes
|
|
1115
|
+
those rows back.
|
|
1116
|
+
|
|
1117
|
+
**No order crosses zero, on the three paths that still reached it.** The
|
|
1118
|
+
sentence `stdlib.md` 17.1 states without qualification held on the shapes that
|
|
1119
|
+
had been tried. On a leg holding three long, `close()` twice on one bar sent two
|
|
1120
|
+
sells of three under one position reference: the destination netted three short,
|
|
1121
|
+
the ledger folded to minus three, and nothing was said. Five bare closes in a
|
|
1122
|
+
loop ended the leg twelve short, and `close(qty = 2)` twice ended it one short
|
|
1123
|
+
with each order inside OS7017's own ceiling. The cause was not the position
|
|
1124
|
+
figure, which is folded from settled fills and is right to be: an order sent a
|
|
1125
|
+
line ago has filled nothing, so the second close measured against the same
|
|
1126
|
+
position the first one did. **A reducing order is now measured against what is
|
|
1127
|
+
left to close on this bar**, which is what the part holds less what the bar has
|
|
1128
|
+
already sent against it, and the invariant is written into 17.1: the orders one
|
|
1129
|
+
bar sends can never sum past the position they are reducing. The second of two
|
|
1130
|
+
bare closes sends nothing, which is the same idempotence as closing a tag that
|
|
1131
|
+
holds nothing; a second stated quantity is held against what the first one left,
|
|
1132
|
+
so `close(qty = 2)` twice on a leg of three is one order and then OS7017 naming
|
|
1133
|
+
one left rather than three. The count covers a `sell` that reduces a long leg,
|
|
1134
|
+
the closing half of `order.reverse`, and a bar declared `onUnconfirmed` executed
|
|
1135
|
+
many times, which is one bar however often it runs.
|
|
1136
|
+
|
|
1137
|
+
**An entry that would cross zero is now sent as two orders, which is what the
|
|
1138
|
+
page already taught.** `sell(qty = abs(pos.size) + newQty)` is documented as one
|
|
1139
|
+
instruction the engine splits into two, because no order crosses zero, and the
|
|
1140
|
+
engine mapped one order at the quantity written: on a leg holding three, a sell
|
|
1141
|
+
of five left it two short under one position reference, where a late fill has no
|
|
1142
|
+
way to say which of the two positions it settled. It now sends the closing half
|
|
1143
|
+
at what is left of the outgoing position, under that position's own reference,
|
|
1144
|
+
and the opening half at the remainder under a reference minted for it, which is
|
|
1145
|
+
what `order.reverse` has always done. An order opposing a position the bar has
|
|
1146
|
+
already committed to closing in full is opening a replacement rather than
|
|
1147
|
+
reducing anything, so it too is minted a position of its own.
|
|
1148
|
+
|
|
1149
|
+
**A strategy declaring lots now gets the part of that rule that can be held for
|
|
1150
|
+
it.** OS7017 was narrowed to a declaration counting in units, so `buy(qty = 1)`
|
|
1151
|
+
and then `close(qty = 5)` under lots, cash or an equity percent sent one sell of
|
|
1152
|
+
five against a leg holding one, with no refusal on any of the three. The
|
|
1153
|
+
narrowing is sound where it is about two kinds of number, and it stays there:
|
|
1154
|
+
comparing a stated quantity with a folded position needs the instrument's lot
|
|
1155
|
+
size, which is the fact OS7005 has been deferred on from the beginning. But
|
|
1156
|
+
nothing left to close is zero in every one of those units, so **a close that
|
|
1157
|
+
states a quantity against a part holding nothing is now refused whatever the
|
|
1158
|
+
declaration counts in.** Two bare closes on one bar are held in every unit too,
|
|
1159
|
+
because the quantity a close works out for itself is in units by construction.
|
|
1160
|
+
What is still not held is one shape, named in OS7017's entry, in 17.2 and in the
|
|
1161
|
+
feature matrix: a quantity stated against a position that is still there, in a
|
|
1162
|
+
declaration counting in anything but units. An order like that is sent as
|
|
1163
|
+
written, and no quantity the engine works out after it adds to what it may have
|
|
1164
|
+
crossed, because an order the engine cannot read is counted as having closed the
|
|
1165
|
+
whole of what was left: a `close()` after it on the same part sends nothing. A
|
|
1166
|
+
second stated quantity on the same bar is another order of the same unheld
|
|
1167
|
+
shape, not a consequence of the first. Between a close that sends nothing and an
|
|
1168
|
+
order that crosses zero, 17.1 has already chosen.
|
|
1169
|
+
|
|
1170
|
+
Decision 42 records the tension this turned on, which is worth reading before
|
|
1171
|
+
relying on either half: sizing a bare close is the engine deciding a quantity,
|
|
1172
|
+
and refusing one refuses a call that wrote no claim at all. It is resolved by
|
|
1173
|
+
the rule the repository keeps arriving at rather than by choosing between them.
|
|
1174
|
+
An argument the script wrote is a claim and a false claim is refused; an
|
|
1175
|
+
argument it did not write is the engine's to work out, and what was always the
|
|
1176
|
+
engine's to work out here is what is left to close.
|
|
1177
|
+
|
|
1178
|
+
**One sentence of the arithmetic manifest could not be violated, and now can.**
|
|
1179
|
+
`stdlib.md` 20.3 said of the exponential mean that "the new value is multiplied
|
|
1180
|
+
first and the running value second, and the two products are added in that
|
|
1181
|
+
order". Binary64 multiplication and addition are both commutative, so that
|
|
1182
|
+
constrained nothing: run over the eighty bar fixture the release gate compares
|
|
1183
|
+
bit for bit, the swapped arrangement gives 0 differences out of 164 values. The
|
|
1184
|
+
arrangement that does vary is `running + (value - running) * weight`, which
|
|
1185
|
+
differs on 142 of them, and it is the one an implementer is most likely to reach
|
|
1186
|
+
for because it is one multiplication rather than two. The paragraph now names
|
|
1187
|
+
it, says what it measured, and says in the open what is deliberately not fixed.
|
|
1188
|
+
Section 20 is the manifest a second engine implements from, and a sentence that
|
|
1189
|
+
cannot bite sends that implementer to check the half that does not matter.
|
|
1190
|
+
|
|
1191
|
+
**The catalogue check now reads the fix sentence, not just the blocks.** The
|
|
1192
|
+
blocks were compiled and the sentence beside them never was, and the sentence is
|
|
1193
|
+
the part a reader acts on. That is how OS7009's fix came to tell a reader to
|
|
1194
|
+
call `order.working(tag)`, which is marked planned, and how OS3003's came to
|
|
1195
|
+
hand out `precision = input(2, "precision")` while its own after block had been
|
|
1196
|
+
edited to show something else because that form did not compile at the time. Two
|
|
1197
|
+
rules now, both narrow and both stated narrowly. Every call a fix names is put to
|
|
1198
|
+
the compiler, one at a time, and a name the language does not have or one marked
|
|
1199
|
+
planned fails the build, unless the entry itself carries a `deferred` sentence.
|
|
1200
|
+
And a fix that writes a call out with a reader's own values in it, a string
|
|
1201
|
+
literal or a named argument, has to show one of its calls in its own after
|
|
1202
|
+
block, which is the only part of an entry a compiler sees. What the rules do not
|
|
1203
|
+
cover is written in `scripts/lib/fix-sentence.mjs`: the fix is not compiled,
|
|
1204
|
+
because the code in it is a fragment of a line rather than a line; the second
|
|
1205
|
+
rule asks for one call rather than all of them, because eleven entries offer a
|
|
1206
|
+
reader two remedies and demonstrate one; an after block that writes no call at
|
|
1207
|
+
all is counted and named rather than skipped, and one entry is in that state;
|
|
1208
|
+
and neither rule can tell whether the advice is any good.
|
|
1209
|
+
|
|
10
1210
|
## 0.1.0-alpha.1
|
|
11
1211
|
|
|
12
1212
|
The first release published by the automation rather than by hand.
|