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
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chart's indicator descriptor, as this adapter targets it.
|
|
3
|
+
*
|
|
4
|
+
* **Why the shape is declared here rather than imported.** The chart library is
|
|
5
|
+
* a peer dependency: a host that wants a chart installs it, and a host that
|
|
6
|
+
* wants only the language must not be made to. This repository therefore does
|
|
7
|
+
* not install it, cannot type check against it, and would fail its own build the
|
|
8
|
+
* moment a file here imported it. So the adapter declares the shape it produces
|
|
9
|
+
* and the host's own build is where the two are compared: assigning the result
|
|
10
|
+
* of `descriptorFor` to the library's `IndicatorDescriptor` is a one line check
|
|
11
|
+
* that fails to compile if this file has drifted, and it costs a host nothing to
|
|
12
|
+
* write.
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* import type { IndicatorDescriptor } from "<the chart library>";
|
|
16
|
+
* const descriptor: IndicatorDescriptor = descriptorFor(program);
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* **That line catches a value of the wrong shape and not an argument of the
|
|
20
|
+
* wrong shape**, and the difference is worth knowing before trusting it. A
|
|
21
|
+
* method's parameters are compared in both directions, so a hook declared here
|
|
22
|
+
* as taking something the chart never passes still assigns: the chart calls it
|
|
23
|
+
* with what it has, the hook reads nothing, and the study draws none of that
|
|
24
|
+
* output with nothing anywhere saying so. That failure is the one this module
|
|
25
|
+
* has actually made. So every hook below takes the chart's own argument, spelled
|
|
26
|
+
* as the chart spells it, and every test in `tests/adapters/charts` calls each
|
|
27
|
+
* hook with the argument the chart passes rather than with one of its own.
|
|
28
|
+
*
|
|
29
|
+
* Where the two worlds spell something differently the translation is in this
|
|
30
|
+
* module, which is the only one allowed to know both.
|
|
31
|
+
*
|
|
32
|
+
* What is declared is the whole output surface: the inputs and the settings
|
|
33
|
+
* dialog a chart generates from them, the plots with their styles and scales,
|
|
34
|
+
* the bands between them, the horizontal levels, the pane's fixed range, the
|
|
35
|
+
* markers, the candle and pane painting, the summary grid, the drawing objects,
|
|
36
|
+
* the watched conditions, and the lifecycle a read of another instrument fetches
|
|
37
|
+
* through.
|
|
38
|
+
*
|
|
39
|
+
* **Some of what a study declares has no field on the descriptor to land in**,
|
|
40
|
+
* and it is left out rather than approximated. Which parts, and why each one
|
|
41
|
+
* has nowhere to go, is recorded in `spec/chart-narrowings.json`;
|
|
42
|
+
* `scripts/check-chart-surface.mjs` reads that record against the declarations
|
|
43
|
+
* of a compiled program and fails on anything dropped that is not in it, so a
|
|
44
|
+
* narrowing can no longer be added by forgetting to mention one. An alert's
|
|
45
|
+
* per-bar message was on that list for the life of this module and is now
|
|
46
|
+
* carried: the file that would have written it is the file that says so.
|
|
47
|
+
*
|
|
48
|
+
* Every member is narrowed to what the adapter can emit. A narrower type is
|
|
49
|
+
* still assignable to the library's wider one, and a value this adapter cannot
|
|
50
|
+
* produce is better left out than declared and never written.
|
|
51
|
+
*/
|
|
52
|
+
import type {
|
|
53
|
+
ChartAlertSpec,
|
|
54
|
+
ChartAttachContext,
|
|
55
|
+
ChartDrawing,
|
|
56
|
+
ChartGrid,
|
|
57
|
+
ChartMarker,
|
|
58
|
+
ChartSurfaceContext,
|
|
59
|
+
} from './surfaces.js';
|
|
60
|
+
|
|
61
|
+
/** One bar as the chart holds it. Its time is UTC seconds, not milliseconds. */
|
|
62
|
+
export interface ChartBar {
|
|
63
|
+
readonly time: number;
|
|
64
|
+
readonly open: number;
|
|
65
|
+
readonly high: number;
|
|
66
|
+
readonly low: number;
|
|
67
|
+
readonly close: number;
|
|
68
|
+
readonly volume?: number;
|
|
69
|
+
readonly oi?: number;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** The eight series a `"source"` input may select. */
|
|
73
|
+
export type ChartSource = 'open' | 'high' | 'low' | 'close' | 'hl2' | 'hlc3' | 'ohlc4' | 'volume';
|
|
74
|
+
|
|
75
|
+
/** The plot styles a single column of values can be drawn as, plus candles. */
|
|
76
|
+
export type ChartSeriesType =
|
|
77
|
+
| 'line'
|
|
78
|
+
| 'line-markers'
|
|
79
|
+
| 'step'
|
|
80
|
+
| 'area'
|
|
81
|
+
| 'histogram'
|
|
82
|
+
| 'column'
|
|
83
|
+
| 'candlestick';
|
|
84
|
+
|
|
85
|
+
export type ChartLineStyle = 'solid' | 'dashed' | 'dotted';
|
|
86
|
+
|
|
87
|
+
/** Which price axis a plot maps to. The empty string is a hidden overlay scale. */
|
|
88
|
+
export type ChartPriceScaleId = 'right' | 'left' | '';
|
|
89
|
+
|
|
90
|
+
export type ChartPriceFormat =
|
|
91
|
+
| { readonly type: 'price'; readonly precision?: number }
|
|
92
|
+
| { readonly type: 'percent'; readonly precision?: number }
|
|
93
|
+
| { readonly type: 'volume' };
|
|
94
|
+
|
|
95
|
+
/** The style fields a plot built here ever sets. */
|
|
96
|
+
export interface ChartSeriesStyle {
|
|
97
|
+
readonly title?: string;
|
|
98
|
+
readonly color?: string;
|
|
99
|
+
readonly lineWidth?: number;
|
|
100
|
+
readonly lineStyle?: ChartLineStyle;
|
|
101
|
+
readonly precision?: number;
|
|
102
|
+
readonly upColor?: string;
|
|
103
|
+
readonly downColor?: string;
|
|
104
|
+
readonly borderUpColor?: string;
|
|
105
|
+
readonly borderDownColor?: string;
|
|
106
|
+
readonly wickUpColor?: string;
|
|
107
|
+
readonly wickDownColor?: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export type ChartSettings = Record<string, unknown>;
|
|
111
|
+
export type ChartStore = Record<string, unknown>;
|
|
112
|
+
|
|
113
|
+
/** One column per key, aligned one to one with the bars, `null` for a gap. */
|
|
114
|
+
export type ChartValues = Record<string, readonly (number | null)[]>;
|
|
115
|
+
|
|
116
|
+
/** One row of the generated settings dialog. */
|
|
117
|
+
export type ChartInput =
|
|
118
|
+
| {
|
|
119
|
+
readonly key: string;
|
|
120
|
+
readonly type: 'number';
|
|
121
|
+
readonly label: string;
|
|
122
|
+
readonly default: number;
|
|
123
|
+
readonly min?: number;
|
|
124
|
+
readonly max?: number;
|
|
125
|
+
readonly step?: number;
|
|
126
|
+
readonly group?: string;
|
|
127
|
+
readonly tooltip?: string;
|
|
128
|
+
}
|
|
129
|
+
| {
|
|
130
|
+
readonly key: string;
|
|
131
|
+
readonly type: 'boolean';
|
|
132
|
+
readonly label: string;
|
|
133
|
+
readonly default: boolean;
|
|
134
|
+
readonly group?: string;
|
|
135
|
+
readonly tooltip?: string;
|
|
136
|
+
}
|
|
137
|
+
| {
|
|
138
|
+
readonly key: string;
|
|
139
|
+
readonly type: 'color';
|
|
140
|
+
readonly label: string;
|
|
141
|
+
readonly default: string;
|
|
142
|
+
readonly group?: string;
|
|
143
|
+
readonly tooltip?: string;
|
|
144
|
+
}
|
|
145
|
+
| {
|
|
146
|
+
readonly key: string;
|
|
147
|
+
readonly type: 'text';
|
|
148
|
+
readonly label: string;
|
|
149
|
+
readonly default: string;
|
|
150
|
+
readonly group?: string;
|
|
151
|
+
readonly tooltip?: string;
|
|
152
|
+
}
|
|
153
|
+
| {
|
|
154
|
+
readonly key: string;
|
|
155
|
+
readonly type: 'select';
|
|
156
|
+
readonly label: string;
|
|
157
|
+
readonly default: string;
|
|
158
|
+
readonly options: readonly { readonly label: string; readonly value: string }[];
|
|
159
|
+
readonly group?: string;
|
|
160
|
+
readonly tooltip?: string;
|
|
161
|
+
}
|
|
162
|
+
| {
|
|
163
|
+
readonly key: string;
|
|
164
|
+
readonly type: 'source';
|
|
165
|
+
readonly label: string;
|
|
166
|
+
readonly default: ChartSource;
|
|
167
|
+
readonly group?: string;
|
|
168
|
+
readonly tooltip?: string;
|
|
169
|
+
}
|
|
170
|
+
| {
|
|
171
|
+
readonly key: string;
|
|
172
|
+
readonly type: 'interval';
|
|
173
|
+
readonly label: string;
|
|
174
|
+
readonly default: string;
|
|
175
|
+
readonly group?: string;
|
|
176
|
+
readonly tooltip?: string;
|
|
177
|
+
}
|
|
178
|
+
| {
|
|
179
|
+
readonly key: string;
|
|
180
|
+
readonly type: 'time';
|
|
181
|
+
readonly label: string;
|
|
182
|
+
readonly default: string;
|
|
183
|
+
readonly group?: string;
|
|
184
|
+
readonly tooltip?: string;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
/** What a per-bar callback that has no series value of its own is handed. */
|
|
188
|
+
export interface ChartPaintContext {
|
|
189
|
+
readonly index: number;
|
|
190
|
+
readonly values: ChartValues;
|
|
191
|
+
readonly settings: ChartSettings;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/** What a per-bar colour callback is handed. */
|
|
195
|
+
export interface ChartColorContext extends ChartPaintContext {
|
|
196
|
+
readonly value: number;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** A candle plot's colour, split into the three parts a candle is drawn from. */
|
|
200
|
+
export interface ChartBarColor {
|
|
201
|
+
readonly body?: string;
|
|
202
|
+
readonly wick?: string;
|
|
203
|
+
readonly border?: string;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export interface ChartPlot {
|
|
207
|
+
readonly key: string;
|
|
208
|
+
readonly type: ChartSeriesType;
|
|
209
|
+
readonly title: string;
|
|
210
|
+
readonly style?: ChartSeriesStyle;
|
|
211
|
+
readonly priceScaleId?: ChartPriceScaleId;
|
|
212
|
+
readonly priceFormat?: ChartPriceFormat;
|
|
213
|
+
readonly overlay?: boolean;
|
|
214
|
+
readonly offset?: number;
|
|
215
|
+
readonly colorKey?: string;
|
|
216
|
+
readonly ohlc?: {
|
|
217
|
+
readonly open: string;
|
|
218
|
+
readonly high: string;
|
|
219
|
+
readonly low: string;
|
|
220
|
+
readonly close: string;
|
|
221
|
+
};
|
|
222
|
+
colorBy?(ctx: ChartColorContext): string | undefined;
|
|
223
|
+
colorParts?(ctx: ChartColorContext): ChartBarColor | undefined;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export interface ChartFill {
|
|
227
|
+
readonly between: readonly [string, string];
|
|
228
|
+
readonly colorUp?: string;
|
|
229
|
+
readonly colorDown?: string;
|
|
230
|
+
readonly colorUpKey?: string;
|
|
231
|
+
readonly colorDownKey?: string;
|
|
232
|
+
readonly opacity?: number;
|
|
233
|
+
readonly overlay?: boolean;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export interface ChartLevel {
|
|
237
|
+
readonly price: number;
|
|
238
|
+
readonly color?: string;
|
|
239
|
+
readonly title?: string;
|
|
240
|
+
readonly lineWidth?: number;
|
|
241
|
+
readonly lineStyle?: ChartLineStyle;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/** What `levels` is handed: the settings, with the data spread beside them. */
|
|
245
|
+
export type ChartLevelContext = ChartSettings & {
|
|
246
|
+
readonly settings?: ChartSettings;
|
|
247
|
+
readonly bars?: readonly ChartBar[];
|
|
248
|
+
readonly values?: ChartValues;
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
/** What the calculation cannot read off the bars themselves. */
|
|
252
|
+
export interface ChartCalcContext {
|
|
253
|
+
readonly barState: {
|
|
254
|
+
readonly isNew: boolean;
|
|
255
|
+
readonly isConfirmed: boolean;
|
|
256
|
+
readonly isRealtime: boolean;
|
|
257
|
+
readonly lastIndex: number;
|
|
258
|
+
};
|
|
259
|
+
readonly symbol?: string;
|
|
260
|
+
readonly interval?: string;
|
|
261
|
+
readonly timezone: string;
|
|
262
|
+
now(): number;
|
|
263
|
+
readonly tickSize?: number;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export interface ChartDescriptor {
|
|
267
|
+
readonly id: string;
|
|
268
|
+
readonly name: string;
|
|
269
|
+
readonly category?: string;
|
|
270
|
+
readonly placement: 'onchart' | 'pane';
|
|
271
|
+
readonly inputs: readonly ChartInput[];
|
|
272
|
+
readonly plots: readonly ChartPlot[];
|
|
273
|
+
readonly fills?: readonly ChartFill[];
|
|
274
|
+
/** The conditions a user may subscribe to, fixed before the first bar. */
|
|
275
|
+
readonly alerts?: readonly ChartAlertSpec[];
|
|
276
|
+
calc(
|
|
277
|
+
bars: readonly ChartBar[],
|
|
278
|
+
settings: ChartSettings,
|
|
279
|
+
store: ChartStore,
|
|
280
|
+
ctx?: ChartCalcContext,
|
|
281
|
+
): ChartValues;
|
|
282
|
+
calcTail?(
|
|
283
|
+
bars: readonly ChartBar[],
|
|
284
|
+
settings: ChartSettings,
|
|
285
|
+
fromIndex: number,
|
|
286
|
+
previous: ChartValues,
|
|
287
|
+
store: ChartStore,
|
|
288
|
+
ctx?: ChartCalcContext,
|
|
289
|
+
): ChartValues | null;
|
|
290
|
+
levels?(ctx: ChartLevelContext): readonly ChartLevel[];
|
|
291
|
+
range?(settings: ChartSettings): { readonly min: number; readonly max: number } | null;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* The instrument's own candles, one colour per bar and `null` where the script
|
|
295
|
+
* painted none.
|
|
296
|
+
*
|
|
297
|
+
* Present only on a study that calls `barColor()`. Only one study may own the
|
|
298
|
+
* candles of a pane at a time, which is `compiled-program.md` 11's rule rather
|
|
299
|
+
* than whichever calculation ran last; a chart that arbitrates between
|
|
300
|
+
* publishers applies it itself, and `candleOwner` is the same rule for a host
|
|
301
|
+
* whose chart does not.
|
|
302
|
+
*/
|
|
303
|
+
barColors?(ctx: ChartSurfaceContext): readonly (string | null)[];
|
|
304
|
+
/** The full height shading behind each bar's column, `null` for unshaded. */
|
|
305
|
+
background?(ctx: ChartSurfaceContext): readonly (string | null)[];
|
|
306
|
+
/** Every marker the last calculation produced, oldest bar first. */
|
|
307
|
+
markers?(ctx: ChartSurfaceContext): readonly ChartMarker[];
|
|
308
|
+
/** The declared grid as the last executed bar left it, or nothing. */
|
|
309
|
+
table?(ctx: ChartSurfaceContext): ChartGrid | null;
|
|
310
|
+
/** Every drawing object the script currently holds, oldest first. */
|
|
311
|
+
draws?(ctx: ChartSurfaceContext): readonly ChartDrawing[];
|
|
312
|
+
/**
|
|
313
|
+
* The lifecycle one instance runs, for a read of another instrument.
|
|
314
|
+
*
|
|
315
|
+
* Present only on a program that makes one. A study that computes from the
|
|
316
|
+
* chart's own bars needs no transport and declares no lifecycle, so it costs
|
|
317
|
+
* a host nothing.
|
|
318
|
+
*/
|
|
319
|
+
attach?(ctx: ChartAttachContext): (() => void) | void;
|
|
320
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A compiled program as a chart's indicator descriptor.
|
|
3
|
+
*
|
|
4
|
+
* The whole of the mapping is here in one function, because the mapping is the
|
|
5
|
+
* adapter: every other file in this module is one column of the table this
|
|
6
|
+
* assembles. `compiled-program.md` 11 writes that table out, and the shape of
|
|
7
|
+
* this function follows it line for line.
|
|
8
|
+
*
|
|
9
|
+
* **The calculation drives the engine and computes nothing.** A descriptor's
|
|
10
|
+
* `calc` is the chart asking for one column per plot; the engine already
|
|
11
|
+
* produces exactly that, one channel at a time, so `calc` loads a program, runs
|
|
12
|
+
* the bars and reads the channels out. Nothing here knows what a moving average
|
|
13
|
+
* is, and that is the point: a second implementation of any of it would be a
|
|
14
|
+
* second thing to keep in step with the specification.
|
|
15
|
+
*
|
|
16
|
+
* **The hooks that follow a calculation read it and do not repeat it.** Markers,
|
|
17
|
+
* the grid, the drawing objects and each alert's message channel are taken once,
|
|
18
|
+
* while the engine is in hand, and left in the run record `produced.ts` keeps.
|
|
19
|
+
* The chart calls each hook after every calculation, so asking twice gives one
|
|
20
|
+
* answer and a study with a grid costs the same over a hundred thousand bars as
|
|
21
|
+
* over ten. A message is the channel itself rather than a copy of it: an alert
|
|
22
|
+
* asks about one bar, and building a column of strings to answer that would cost
|
|
23
|
+
* the history.
|
|
24
|
+
*
|
|
25
|
+
* **A declaration option written as an `input()` is resolved against the
|
|
26
|
+
* settings the host states, not against the default.** That is the whole point
|
|
27
|
+
* of writing one: `study("S", precision = input(2, "Places"))` is how a reader
|
|
28
|
+
* changes something the declaration decides. The declared shape is fixed before
|
|
29
|
+
* bar 0 and every field of it is a value rather than a call, so the settings
|
|
30
|
+
* have to be in hand when it is built; `ChartAdapterOptions.settings` is where
|
|
31
|
+
* they come from, and a descriptor built without them reads every such field at
|
|
32
|
+
* its declared default. Which parts of the descriptor are resolved here and
|
|
33
|
+
* which are asked for again per call is recorded in
|
|
34
|
+
* `spec/chart-narrowings.json` and measured by
|
|
35
|
+
* `scripts/check-chart-surface.mjs`.
|
|
36
|
+
*
|
|
37
|
+
* **The id is the source hash, not the title.** A saved layout stores the
|
|
38
|
+
* descriptor id and the settings, and two scripts can easily share a title while
|
|
39
|
+
* an edited script keeps the one it had. Hashing the source means the same
|
|
40
|
+
* script restores to the same study and an edited one does not silently inherit
|
|
41
|
+
* the settings of the study it replaced. A host that manages its own script
|
|
42
|
+
* identities passes its own id instead.
|
|
43
|
+
*/
|
|
44
|
+
import type { CompiledProgram } from '../../core/emit/index.js';
|
|
45
|
+
import { alertMessages, buildAlerts } from './alerts.js';
|
|
46
|
+
import { valuesFrom } from './columns.js';
|
|
47
|
+
import type {
|
|
48
|
+
ChartBar,
|
|
49
|
+
ChartCalcContext,
|
|
50
|
+
ChartDescriptor,
|
|
51
|
+
ChartSettings,
|
|
52
|
+
ChartStore,
|
|
53
|
+
ChartValues,
|
|
54
|
+
} from './contract.js';
|
|
55
|
+
import { buildDrawings } from './drawings.js';
|
|
56
|
+
import { buildFills } from './fills.js';
|
|
57
|
+
import { boolField, stringField } from './fields.js';
|
|
58
|
+
import { buildLevels, buildRange } from './levels.js';
|
|
59
|
+
import { buildMarkers } from './markers.js';
|
|
60
|
+
import { buildPaint } from './paint.js';
|
|
61
|
+
import { buildPlots } from './plots.js';
|
|
62
|
+
import { producedFor, remember } from './produced.js';
|
|
63
|
+
import { stationIn } from './requests.js';
|
|
64
|
+
import { fullRun, release, tailRun } from './run.js';
|
|
65
|
+
import type { ChartAdapterOptions, RunOutput } from './run.js';
|
|
66
|
+
import { inputRows, lookupFor } from './settings.js';
|
|
67
|
+
import type {
|
|
68
|
+
ChartAttachContext,
|
|
69
|
+
ChartDrawing,
|
|
70
|
+
ChartGrid,
|
|
71
|
+
ChartMarker,
|
|
72
|
+
ChartSurfaceContext,
|
|
73
|
+
} from './surfaces.js';
|
|
74
|
+
import { buildTable } from './tables.js';
|
|
75
|
+
|
|
76
|
+
/** The grey an unnamed marker is drawn in, where the host names no default. */
|
|
77
|
+
const MARKER_COLOUR = 'rgba(128, 128, 128, 1)';
|
|
78
|
+
|
|
79
|
+
export function descriptorFor(
|
|
80
|
+
program: CompiledProgram,
|
|
81
|
+
options: ChartAdapterOptions = {},
|
|
82
|
+
): ChartDescriptor {
|
|
83
|
+
// The declared shape is fixed before bar 0, so the fields that make it up are
|
|
84
|
+
// read once, against the settings the host states. A host that states none
|
|
85
|
+
// gets the declared defaults, which is what a script with no `input()` in a
|
|
86
|
+
// declaration option has anyway. The ones a settings change may move
|
|
87
|
+
// afterwards carry a settings key instead of a value, and the two that cannot
|
|
88
|
+
// are read again per call: a level's style and the pane's range.
|
|
89
|
+
const declared = lookupFor(program, options.settings ?? {});
|
|
90
|
+
|
|
91
|
+
const overlay = boolField(program.meta.overlay, declared) === true;
|
|
92
|
+
const plots = buildPlots(program, declared, !overlay);
|
|
93
|
+
const levels = buildLevels(program);
|
|
94
|
+
const fills = buildFills(program, declared);
|
|
95
|
+
const paint = buildPaint(program);
|
|
96
|
+
const alerts = buildAlerts(program, declared);
|
|
97
|
+
const columns = [
|
|
98
|
+
...plots.columns,
|
|
99
|
+
...levels.columns,
|
|
100
|
+
...paint.columns,
|
|
101
|
+
...alerts.columns,
|
|
102
|
+
];
|
|
103
|
+
const markerColour = options.markerColor ?? MARKER_COLOUR;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* What the run produced that is not a column of numbers.
|
|
107
|
+
*
|
|
108
|
+
* It is keyed by the settings object the chart handed in, because that object
|
|
109
|
+
* is the study instance: the same one reaches every hook that follows the
|
|
110
|
+
* calculation, and `produced.ts` says why that is the only handle there is.
|
|
111
|
+
*/
|
|
112
|
+
const keep = (
|
|
113
|
+
bars: readonly ChartBar[],
|
|
114
|
+
settings: ChartSettings,
|
|
115
|
+
ran: RunOutput,
|
|
116
|
+
): void => {
|
|
117
|
+
const lookup = lookupFor(program, settings);
|
|
118
|
+
remember(settings, {
|
|
119
|
+
markers: buildMarkers(program, lookup, bars, ran.columns, markerColour),
|
|
120
|
+
table: buildTable(program, lookup, ran.tables),
|
|
121
|
+
drawings: buildDrawings(ran.drawings),
|
|
122
|
+
messages: alertMessages(program, ran.columns),
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
// A study's own group is its category, and a host may name one for a script
|
|
126
|
+
// whose author left the group blank.
|
|
127
|
+
const group = stringField(program.meta.group, declared, '');
|
|
128
|
+
const category = group === '' ? options.category : group;
|
|
129
|
+
|
|
130
|
+
return {
|
|
131
|
+
id: options.id ?? `openscript:${program.source.hash}`,
|
|
132
|
+
name: stringField(program.meta.title, declared, 'Study'),
|
|
133
|
+
...(category === undefined ? {} : { category }),
|
|
134
|
+
placement: overlay ? 'onchart' : 'pane',
|
|
135
|
+
inputs: inputRows(program),
|
|
136
|
+
plots: plots.plots,
|
|
137
|
+
...(fills.length === 0 ? {} : { fills }),
|
|
138
|
+
|
|
139
|
+
...(alerts.alerts.length === 0 ? {} : { alerts: alerts.alerts }),
|
|
140
|
+
|
|
141
|
+
calc(
|
|
142
|
+
bars: readonly ChartBar[],
|
|
143
|
+
settings: ChartSettings,
|
|
144
|
+
store: ChartStore,
|
|
145
|
+
ctx?: ChartCalcContext,
|
|
146
|
+
): ChartValues {
|
|
147
|
+
const ran = fullRun(program, bars, settings, store, ctx, options);
|
|
148
|
+
keep(bars, settings, ran);
|
|
149
|
+
return valuesFrom(columns, ran.columns, 0, bars.length);
|
|
150
|
+
},
|
|
151
|
+
|
|
152
|
+
calcTail(
|
|
153
|
+
bars: readonly ChartBar[],
|
|
154
|
+
settings: ChartSettings,
|
|
155
|
+
fromIndex: number,
|
|
156
|
+
_previous: ChartValues,
|
|
157
|
+
store: ChartStore,
|
|
158
|
+
ctx?: ChartCalcContext,
|
|
159
|
+
): ChartValues | null {
|
|
160
|
+
const ran = tailRun(program, bars, fromIndex, settings, store, ctx, options);
|
|
161
|
+
if (ran === null) return null;
|
|
162
|
+
keep(bars, settings, ran);
|
|
163
|
+
return valuesFrom(columns, ran.columns, fromIndex, bars.length);
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
...(program.outputs.levels.length === 0 ? {} : { levels: levels.levels }),
|
|
167
|
+
...(program.meta.range === null ? {} : { range: buildRange(program) }),
|
|
168
|
+
...(paint.barColors === undefined ? {} : { barColors: paint.barColors }),
|
|
169
|
+
...(paint.background === undefined ? {} : { background: paint.background }),
|
|
170
|
+
...(program.outputs.markers.length === 0
|
|
171
|
+
? {}
|
|
172
|
+
: {
|
|
173
|
+
markers: (ctx: ChartSurfaceContext): readonly ChartMarker[] =>
|
|
174
|
+
producedFor(ctx.settings).markers,
|
|
175
|
+
}),
|
|
176
|
+
...(program.outputs.tables.length === 0
|
|
177
|
+
? {}
|
|
178
|
+
: { table: (ctx: ChartSurfaceContext): ChartGrid | null => producedFor(ctx.settings).table }),
|
|
179
|
+
...(program.requires.includes('objects')
|
|
180
|
+
? {
|
|
181
|
+
draws: (ctx: ChartSurfaceContext): readonly ChartDrawing[] =>
|
|
182
|
+
producedFor(ctx.settings).drawings,
|
|
183
|
+
}
|
|
184
|
+
: {}),
|
|
185
|
+
// A study that reads only this chart's bars needs no lifecycle: the engine
|
|
186
|
+
// folds its own, and a descriptor that declared one anyway would cost every
|
|
187
|
+
// host a subscription for a transport nothing asks to use.
|
|
188
|
+
...(program.requires.includes('req.symbol')
|
|
189
|
+
? {
|
|
190
|
+
attach(ctx: ChartAttachContext): () => void {
|
|
191
|
+
stationIn(ctx.store).open(ctx);
|
|
192
|
+
return (): void => {
|
|
193
|
+
release(ctx.store);
|
|
194
|
+
};
|
|
195
|
+
},
|
|
196
|
+
}
|
|
197
|
+
: {}),
|
|
198
|
+
};
|
|
199
|
+
}
|