openalgo-script 0.1.0-alpha.0 → 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 +1249 -0
- package/README.md +288 -255
- 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 +62 -6
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +49 -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/index.d.ts +2 -0
- package/dist/core/version/index.d.ts.map +1 -0
- package/dist/core/version/index.js +2 -0
- package/dist/core/version/index.js.map +1 -0
- package/dist/core/version/version.generated.d.ts +10 -0
- package/dist/core/version/version.generated.d.ts.map +1 -0
- package/dist/core/version/version.generated.js +14 -0
- package/dist/core/version/version.generated.js.map +1 -0
- package/package.json +88 -52
- package/spec/errors.json +3403 -3204
- 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 +129 -6
- package/src/core/parse/expressions.ts +1 -1
- package/src/core/parse/functions.ts +109 -109
- package/src/core/parse/names.ts +29 -2
- package/src/core/parse/switches.ts +105 -105
- 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/index.ts +1 -0
- package/src/core/version/version.generated.ts +15 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The engine's library manifest: what a `CALL_LIB` can name, and what each
|
|
3
|
+
* entry does.
|
|
4
|
+
*
|
|
5
|
+
* `compiled-program.md` 2.5 gives this table its job. A compiled program
|
|
6
|
+
* carries its own copy of every function it calls, with the name, the argument
|
|
7
|
+
* count, whether the function holds state and what effect it has, and at load
|
|
8
|
+
* the engine compares each entry against this one. A mismatch is OS6004, and
|
|
9
|
+
* the entries carry facts the engine already knows precisely so that they can
|
|
10
|
+
* be disagreed with: it catches a program compiled against a newer library
|
|
11
|
+
* before it computes a single wrong number.
|
|
12
|
+
*
|
|
13
|
+
* **A name this engine does not implement is refused at load, not at the call.**
|
|
14
|
+
* The alternative, discovering it halfway through bar nine thousand, would give
|
|
15
|
+
* a user a broken chart and a message about a function rather than a message
|
|
16
|
+
* before anything was drawn.
|
|
17
|
+
*
|
|
18
|
+
* The table is keyed by name and argument count, because the library has names
|
|
19
|
+
* with more than one signature: `text` takes one value or a value and a digit
|
|
20
|
+
* count, and `min` takes two numbers or one array. The one pair that shares a
|
|
21
|
+
* name **and** a count is `clear`, which empties an array or a grid, and the
|
|
22
|
+
* engine tells those apart by asking the heap what the handle points at.
|
|
23
|
+
*/
|
|
24
|
+
import { ARRAY_ENTRIES } from './arrays.js';
|
|
25
|
+
import { AVERAGE_ENTRIES } from './averages.js';
|
|
26
|
+
import { CHART_ENTRIES } from './chart.js';
|
|
27
|
+
import { COLOUR_ENTRIES } from './colours.js';
|
|
28
|
+
import { DATE_ENTRIES } from './dates.js';
|
|
29
|
+
import { MATHS_ENTRIES } from './maths.js';
|
|
30
|
+
import { OBJECT_ENTRIES } from './objects.js';
|
|
31
|
+
import { OSCILLATOR_ENTRIES } from './oscillators.js';
|
|
32
|
+
import { RANGE_ENTRIES } from './ranges.js';
|
|
33
|
+
import { SERIES_ENTRIES } from './series.js';
|
|
34
|
+
import { STUDY_ENTRIES } from './studies.js';
|
|
35
|
+
import { TEXT_ENTRIES } from './text.js';
|
|
36
|
+
import { TREND_ENTRIES } from './trend.js';
|
|
37
|
+
import { VOLUME_ENTRIES } from './volume.js';
|
|
38
|
+
import type { ManifestEntry } from './binding.js';
|
|
39
|
+
|
|
40
|
+
const ENTRIES: readonly ManifestEntry[] = [
|
|
41
|
+
...COLOUR_ENTRIES,
|
|
42
|
+
...MATHS_ENTRIES,
|
|
43
|
+
...TEXT_ENTRIES,
|
|
44
|
+
...ARRAY_ENTRIES,
|
|
45
|
+
...SERIES_ENTRIES,
|
|
46
|
+
...AVERAGE_ENTRIES,
|
|
47
|
+
...STUDY_ENTRIES,
|
|
48
|
+
...TREND_ENTRIES,
|
|
49
|
+
...OSCILLATOR_ENTRIES,
|
|
50
|
+
...RANGE_ENTRIES,
|
|
51
|
+
...VOLUME_ENTRIES,
|
|
52
|
+
...OBJECT_ENTRIES,
|
|
53
|
+
...CHART_ENTRIES,
|
|
54
|
+
...DATE_ENTRIES,
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
function keyOf(name: string, arity: number): string {
|
|
58
|
+
return `${name}/${arity}`;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const INDEX = new Map<string, ManifestEntry>();
|
|
62
|
+
const ARITIES = new Map<string, number[]>();
|
|
63
|
+
for (const one of ENTRIES) {
|
|
64
|
+
INDEX.set(keyOf(one.name, one.arity), one);
|
|
65
|
+
const known = ARITIES.get(one.name);
|
|
66
|
+
if (known === undefined) ARITIES.set(one.name, [one.arity]);
|
|
67
|
+
else known.push(one.arity);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** The entry for one name and argument count, or nothing when there is none. */
|
|
71
|
+
export function manifestEntry(name: string, arity: number): ManifestEntry | undefined {
|
|
72
|
+
return INDEX.get(keyOf(name, arity));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** What this engine has under a name, for OS6004's message. */
|
|
76
|
+
export function manifestSays(name: string): string {
|
|
77
|
+
const arities = ARITIES.get(name);
|
|
78
|
+
if (arities === undefined) return `no function called ${name}`;
|
|
79
|
+
const counts = [...arities].sort((a, b) => a - b).join(' or ');
|
|
80
|
+
return `${name} with ${counts} argument${arities.length === 1 && arities[0] === 1 ? '' : 's'}`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Every entry, for the test that compares this table with the checker's. */
|
|
84
|
+
export function manifestEntries(): readonly ManifestEntry[] {
|
|
85
|
+
return ENTRIES;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type {
|
|
89
|
+
BarView,
|
|
90
|
+
CallContext,
|
|
91
|
+
Effect,
|
|
92
|
+
Guard,
|
|
93
|
+
HostFacts,
|
|
94
|
+
LibraryCall,
|
|
95
|
+
ManifestEntry,
|
|
96
|
+
PositionFacts,
|
|
97
|
+
} from './binding.js';
|
|
98
|
+
|
|
99
|
+
export type { StateRecord, StateSlot } from './state.js';
|
|
100
|
+
export { copyState } from './state.js';
|
|
101
|
+
|
|
102
|
+
export { COLOUR_NAMES, namedColour } from './colours.js';
|
|
103
|
+
export { spell } from './text.js';
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The arithmetic calls, `stdlib.md` section 8.
|
|
3
|
+
*
|
|
4
|
+
* Every one of them is the numeric library's, called through. The numbers are
|
|
5
|
+
* computed under `src/core/stdlib`, which depends on nothing else in the
|
|
6
|
+
* repository and is tested against reference vectors on its own, and this file
|
|
7
|
+
* is the wiring that hands it two engine values and takes one back. A second
|
|
8
|
+
* implementation here would be a second accumulation order waiting to drift,
|
|
9
|
+
* and section 8.3 makes that a release blocker rather than a tidiness problem.
|
|
10
|
+
*
|
|
11
|
+
* Three calls are not numeric and are here because they are written in the same
|
|
12
|
+
* place in the library's own tables: `isNone`, `orElse` and `bool` take any
|
|
13
|
+
* value, so they read the engine's value rather than a number.
|
|
14
|
+
*/
|
|
15
|
+
import {
|
|
16
|
+
E,
|
|
17
|
+
PI,
|
|
18
|
+
abs,
|
|
19
|
+
acos,
|
|
20
|
+
asin,
|
|
21
|
+
atan,
|
|
22
|
+
atan2,
|
|
23
|
+
ceil,
|
|
24
|
+
clamp,
|
|
25
|
+
cos,
|
|
26
|
+
exp,
|
|
27
|
+
floor,
|
|
28
|
+
hypot,
|
|
29
|
+
log,
|
|
30
|
+
log10,
|
|
31
|
+
log2,
|
|
32
|
+
max,
|
|
33
|
+
min,
|
|
34
|
+
mod,
|
|
35
|
+
pow,
|
|
36
|
+
round,
|
|
37
|
+
roundTo,
|
|
38
|
+
roundToStep,
|
|
39
|
+
sign,
|
|
40
|
+
sin,
|
|
41
|
+
sqrt,
|
|
42
|
+
tan,
|
|
43
|
+
toDegrees,
|
|
44
|
+
toRadians,
|
|
45
|
+
trunc,
|
|
46
|
+
} from '../../stdlib/index.js';
|
|
47
|
+
import { isNumber } from '../values/index.js';
|
|
48
|
+
import { entry, numberAt, valueAt, wholeAt } from './binding.js';
|
|
49
|
+
import type { ManifestEntry } from './binding.js';
|
|
50
|
+
|
|
51
|
+
/** A one argument numeric call. */
|
|
52
|
+
function one(name: string, param: string, of: (x: number | null) => number | null): ManifestEntry {
|
|
53
|
+
return entry(name, param, (_ctx, args) => of(numberAt(args, 0)));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** A two argument numeric call. */
|
|
57
|
+
function two(
|
|
58
|
+
name: string,
|
|
59
|
+
params: string,
|
|
60
|
+
of: (a: number | null, b: number | null) => number | null,
|
|
61
|
+
): ManifestEntry {
|
|
62
|
+
return entry(name, params, (_ctx, args) => of(numberAt(args, 0), numberAt(args, 1)));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** A constant read bare, which the format still compiles to a call of no arguments. */
|
|
66
|
+
function constant(name: string, value: number): ManifestEntry {
|
|
67
|
+
return entry(name, '', () => value);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const MATHS_ENTRIES: readonly ManifestEntry[] = [
|
|
71
|
+
one('abs', 'x', abs),
|
|
72
|
+
one('sign', 'x', sign),
|
|
73
|
+
one('sqrt', 'x', sqrt),
|
|
74
|
+
one('exp', 'x', exp),
|
|
75
|
+
one('log', 'x', log),
|
|
76
|
+
one('log10', 'x', log10),
|
|
77
|
+
one('floor', 'x', floor),
|
|
78
|
+
one('ceil', 'x', ceil),
|
|
79
|
+
one('trunc', 'x', trunc),
|
|
80
|
+
one('round', 'x', round),
|
|
81
|
+
two('min', 'a b', min),
|
|
82
|
+
two('max', 'a b', max),
|
|
83
|
+
two('mod', 'a b', mod),
|
|
84
|
+
two('pow', 'x y', pow),
|
|
85
|
+
two('roundToStep', 'x step', roundToStep),
|
|
86
|
+
|
|
87
|
+
entry('clamp', 'x lo hi', (_ctx, args) =>
|
|
88
|
+
clamp(numberAt(args, 0), numberAt(args, 1), numberAt(args, 2)),
|
|
89
|
+
),
|
|
90
|
+
|
|
91
|
+
// The digit count is a whole number of zero or more. A fractional one is a
|
|
92
|
+
// bug in the script rather than a value to round on the script's behalf.
|
|
93
|
+
entry('round', 'x decimals', (ctx, args) => {
|
|
94
|
+
const decimals = wholeAt(ctx, 'round', 'decimals', args, 1);
|
|
95
|
+
return decimals === null ? null : roundTo(numberAt(args, 0), decimals);
|
|
96
|
+
}),
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* `roundToTick(price)`: to the instrument's tick.
|
|
100
|
+
*
|
|
101
|
+
* Absent when the host states no tick size, rather than the price unrounded.
|
|
102
|
+
* An order at a price that is not on a tick is refused by a venue, so a
|
|
103
|
+
* script that cannot round has to be able to see that it cannot.
|
|
104
|
+
*/
|
|
105
|
+
entry('roundToTick', 'price', (ctx, args) => {
|
|
106
|
+
const tick = ctx.host.tickSize();
|
|
107
|
+
if (!isNumber(tick)) return null;
|
|
108
|
+
return roundToStep(numberAt(args, 0), tick);
|
|
109
|
+
}),
|
|
110
|
+
|
|
111
|
+
constant('math.pi', PI),
|
|
112
|
+
constant('math.e', E),
|
|
113
|
+
one('math.log2', 'x', log2),
|
|
114
|
+
one('math.sin', 'x', sin),
|
|
115
|
+
one('math.cos', 'x', cos),
|
|
116
|
+
one('math.tan', 'x', tan),
|
|
117
|
+
one('math.asin', 'x', asin),
|
|
118
|
+
one('math.acos', 'x', acos),
|
|
119
|
+
one('math.atan', 'x', atan),
|
|
120
|
+
one('math.toDegrees', 'x', toDegrees),
|
|
121
|
+
one('math.toRadians', 'x', toRadians),
|
|
122
|
+
two('math.hypot', 'x y', hypot),
|
|
123
|
+
two('math.atan2', 'y x', atan2),
|
|
124
|
+
|
|
125
|
+
entry('isNone', 'x', (_ctx, args) => valueAt(args, 0) === null),
|
|
126
|
+
entry('orElse', 'x fallback', (_ctx, args) => {
|
|
127
|
+
const value = valueAt(args, 0);
|
|
128
|
+
return value === null ? valueAt(args, 1) : value;
|
|
129
|
+
}),
|
|
130
|
+
// `toBool(x)`: absence to false, a bool to itself. A number is a type error
|
|
131
|
+
// the checker refuses, so an engine that reaches one is looking at a program
|
|
132
|
+
// its verifier should not have accepted, and absence is the safe reading.
|
|
133
|
+
entry('toBool', 'x', (_ctx, args) => valueAt(args, 0) === true),
|
|
134
|
+
];
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drawing objects and grid cells, `stdlib.md` section 14.
|
|
3
|
+
*
|
|
4
|
+
* Neither goes through a channel, and `compiled-program.md` 4.11 says why: both
|
|
5
|
+
* would need an unbounded number of them, and a channel is by definition one
|
|
6
|
+
* value per bar. A line, label or box is an object in the heap that a script
|
|
7
|
+
* creates once and mutates over many bars; a grid is a handle the engine puts
|
|
8
|
+
* in a slot and its cells are a per-bar buffer.
|
|
9
|
+
*
|
|
10
|
+
* **A drawing object rolls back with everything else.** A moving bar that
|
|
11
|
+
* re-executes ten times must leave one box behind rather than ten, and the
|
|
12
|
+
* object is in the heap, so the heap's undo journal already carries it. Section
|
|
13
|
+
* 6.1's list of what a checkpoint holds does not name the drawing roster
|
|
14
|
+
* separately, and it has to be part of it: without that, creation would survive
|
|
15
|
+
* a rollback and the chart would accumulate a copy per tick.
|
|
16
|
+
*
|
|
17
|
+
* **A deleted object stays deleted rather than becoming absent.** OS4005 names
|
|
18
|
+
* the bar it was deleted on, because a script that mutates a stale handle is
|
|
19
|
+
* holding a name for something it already threw away, and answering "absent"
|
|
20
|
+
* would hide that behind a drawing that quietly stopped moving. An *absent*
|
|
21
|
+
* handle is a different fact and does nothing: a setter given `none` is a gap
|
|
22
|
+
* like every other absence reaching a drawing surface (`language.md` 6.7), and
|
|
23
|
+
* it is what the fix for OS4005 asks a script to produce.
|
|
24
|
+
*
|
|
25
|
+
* **An object is anchored to a time and a price and to nothing else.** Neither
|
|
26
|
+
* anchor is read against the bars: an anchor past the newest bar is kept as it
|
|
27
|
+
* was given, so a projected line reaches into the margin, and an anchor inside
|
|
28
|
+
* the history does not move when more history loads and every bar index
|
|
29
|
+
* shifts. A bar index is a position in the data the engine was given
|
|
30
|
+
* (`language.md` 7.2), and an object that stored one would be somewhere else
|
|
31
|
+
* on the same chart tomorrow.
|
|
32
|
+
*
|
|
33
|
+
* **A polyline holds its own path.** The two arrays it is given are read once,
|
|
34
|
+
* at the call, and the points are the object's from then on; `draw.setPoints`
|
|
35
|
+
* is how a path changes. The alternative, keeping the arrays and reading them
|
|
36
|
+
* when the host draws, would mean a `push` to an array the script kept for its
|
|
37
|
+
* own bookkeeping silently redrawing a shape, and two engines could then
|
|
38
|
+
* disagree about when the path was read.
|
|
39
|
+
*/
|
|
40
|
+
import type { DrawingObject, GridCell, Value } from '../values/index.js';
|
|
41
|
+
import { isDrawing, isNumber, reference } from '../values/index.js';
|
|
42
|
+
import { entry, refAt, valueAt, wholeAt } from './binding.js';
|
|
43
|
+
import type { CallContext, ManifestEntry } from './binding.js';
|
|
44
|
+
import { clearArray } from './arrays.js';
|
|
45
|
+
|
|
46
|
+
/** The drawing object a handle names, refusing one the script already deleted. */
|
|
47
|
+
function drawing(ctx: CallContext, args: readonly Value[], index: number): DrawingObject | undefined {
|
|
48
|
+
const handle = refAt(args, index);
|
|
49
|
+
if (handle === null) return undefined;
|
|
50
|
+
const object = ctx.heap.get(handle.id);
|
|
51
|
+
if (object === undefined || !isDrawing(object)) return undefined;
|
|
52
|
+
if (object.deleted) ctx.guard.deleted(ctx.span, object.kind, object.deletedAt);
|
|
53
|
+
ctx.heap.touch(handle.id);
|
|
54
|
+
return object;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Creates one object, once the ceiling has been asked.
|
|
59
|
+
*
|
|
60
|
+
* The properties arrive as a function rather than as a record so that the
|
|
61
|
+
* ceiling is charged before any of the work: a polyline copies its whole path
|
|
62
|
+
* into the heap, and an engine that built that and then refused to keep it
|
|
63
|
+
* would have spent the memory it was refusing to spend.
|
|
64
|
+
*/
|
|
65
|
+
function make(
|
|
66
|
+
ctx: CallContext,
|
|
67
|
+
kind: DrawingObject['kind'],
|
|
68
|
+
props: () => Record<string, Value>,
|
|
69
|
+
): Value {
|
|
70
|
+
ctx.guard.drawing(ctx.span, ctx.heap.drawingCount());
|
|
71
|
+
const id = ctx.heap.allocate({ kind, props: props(), deleted: false, deletedAt: -1 });
|
|
72
|
+
return reference(id);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** The numbers one path argument holds, or an empty path when it holds none. */
|
|
76
|
+
function pointsIn(ctx: CallContext, args: readonly Value[], index: number): readonly Value[] {
|
|
77
|
+
const held = ctx.heap.deref(valueAt(args, index));
|
|
78
|
+
return held !== undefined && held.kind === 'array' ? held.items : [];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A polyline's path, copied out of the two arrays that describe it.
|
|
83
|
+
*
|
|
84
|
+
* The arrays are paired by index over the longer of them, so a script that
|
|
85
|
+
* supplies more times than prices gets a point with no price rather than a
|
|
86
|
+
* shorter path: absence reaching a drawing surface is a gap the host draws as a
|
|
87
|
+
* break (`language.md` 6.7), and dropping the odd points instead would quietly
|
|
88
|
+
* redraw the shape. A value that is not a number is absent for the same reason.
|
|
89
|
+
*
|
|
90
|
+
* The copies are heap arrays, so they are rolled back, swept and counted like
|
|
91
|
+
* every other object rather than being a second kind of storage.
|
|
92
|
+
*/
|
|
93
|
+
function path(ctx: CallContext, args: readonly Value[], first: number): Record<string, Value> {
|
|
94
|
+
const times = pointsIn(ctx, args, first);
|
|
95
|
+
const prices = pointsIn(ctx, args, first + 1);
|
|
96
|
+
const length = Math.max(times.length, prices.length);
|
|
97
|
+
const copy = (source: readonly Value[]): Value => {
|
|
98
|
+
const items: Value[] = [];
|
|
99
|
+
for (let i = 0; i < length; i += 1) {
|
|
100
|
+
const one = source[i];
|
|
101
|
+
items.push(one !== undefined && isNumber(one) ? one : null);
|
|
102
|
+
}
|
|
103
|
+
return reference(ctx.heap.allocate({ kind: 'array', items }));
|
|
104
|
+
};
|
|
105
|
+
return { times: copy(times), prices: copy(prices) };
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** A mutator that writes named fields onto an existing object. */
|
|
109
|
+
function setter(
|
|
110
|
+
name: string,
|
|
111
|
+
params: string,
|
|
112
|
+
fields: (args: readonly Value[]) => Record<string, Value>,
|
|
113
|
+
): ManifestEntry {
|
|
114
|
+
return entry(name, params, (ctx, args) => {
|
|
115
|
+
const object = drawing(ctx, args, 0);
|
|
116
|
+
if (object === undefined) return null;
|
|
117
|
+
object.props = { ...object.props, ...fields(args) };
|
|
118
|
+
return null;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export const OBJECT_ENTRIES: readonly ManifestEntry[] = [
|
|
123
|
+
entry('draw.line', 't1 p1 t2 p2 color width style extendLeft extendRight', (ctx, args) =>
|
|
124
|
+
make(ctx, 'line', () => ({
|
|
125
|
+
t1: valueAt(args, 0),
|
|
126
|
+
p1: valueAt(args, 1),
|
|
127
|
+
t2: valueAt(args, 2),
|
|
128
|
+
p2: valueAt(args, 3),
|
|
129
|
+
color: valueAt(args, 4),
|
|
130
|
+
width: valueAt(args, 5),
|
|
131
|
+
style: valueAt(args, 6),
|
|
132
|
+
extendLeft: valueAt(args, 7),
|
|
133
|
+
extendRight: valueAt(args, 8),
|
|
134
|
+
})),
|
|
135
|
+
),
|
|
136
|
+
|
|
137
|
+
entry('draw.label', 't p text color textColor align tooltip', (ctx, args) =>
|
|
138
|
+
make(ctx, 'label', () => ({
|
|
139
|
+
t: valueAt(args, 0),
|
|
140
|
+
p: valueAt(args, 1),
|
|
141
|
+
text: valueAt(args, 2),
|
|
142
|
+
color: valueAt(args, 3),
|
|
143
|
+
textColor: valueAt(args, 4),
|
|
144
|
+
align: valueAt(args, 5),
|
|
145
|
+
tooltip: valueAt(args, 6),
|
|
146
|
+
})),
|
|
147
|
+
),
|
|
148
|
+
|
|
149
|
+
entry(
|
|
150
|
+
'draw.box',
|
|
151
|
+
't1 p1 t2 p2 color fillColor opacity width text textColor tooltip',
|
|
152
|
+
(ctx, args) =>
|
|
153
|
+
make(ctx, 'box', () => ({
|
|
154
|
+
t1: valueAt(args, 0),
|
|
155
|
+
p1: valueAt(args, 1),
|
|
156
|
+
t2: valueAt(args, 2),
|
|
157
|
+
p2: valueAt(args, 3),
|
|
158
|
+
color: valueAt(args, 4),
|
|
159
|
+
fillColor: valueAt(args, 5),
|
|
160
|
+
opacity: valueAt(args, 6),
|
|
161
|
+
width: valueAt(args, 7),
|
|
162
|
+
text: valueAt(args, 8),
|
|
163
|
+
textColor: valueAt(args, 9),
|
|
164
|
+
tooltip: valueAt(args, 10),
|
|
165
|
+
})),
|
|
166
|
+
),
|
|
167
|
+
|
|
168
|
+
entry('draw.polyline', 'times prices color width closed fillColor opacity', (ctx, args) =>
|
|
169
|
+
make(ctx, 'polyline', () => ({
|
|
170
|
+
...path(ctx, args, 0),
|
|
171
|
+
color: valueAt(args, 2),
|
|
172
|
+
width: valueAt(args, 3),
|
|
173
|
+
closed: valueAt(args, 4),
|
|
174
|
+
fillColor: valueAt(args, 5),
|
|
175
|
+
opacity: valueAt(args, 6),
|
|
176
|
+
})),
|
|
177
|
+
),
|
|
178
|
+
|
|
179
|
+
setter('draw.setFrom', 'obj t p', (args) => ({ t1: valueAt(args, 1), p1: valueAt(args, 2) })),
|
|
180
|
+
setter('draw.setTo', 'obj t p', (args) => ({ t2: valueAt(args, 1), p2: valueAt(args, 2) })),
|
|
181
|
+
setter('draw.setAt', 'obj t p', (args) => ({ t: valueAt(args, 1), p: valueAt(args, 2) })),
|
|
182
|
+
setter('draw.setBounds', 'obj t1 p1 t2 p2', (args) => ({
|
|
183
|
+
t1: valueAt(args, 1),
|
|
184
|
+
p1: valueAt(args, 2),
|
|
185
|
+
t2: valueAt(args, 3),
|
|
186
|
+
p2: valueAt(args, 4),
|
|
187
|
+
})),
|
|
188
|
+
entry('draw.setPoints', 'obj times prices', (ctx, args) => {
|
|
189
|
+
const object = drawing(ctx, args, 0);
|
|
190
|
+
if (object === undefined) return null;
|
|
191
|
+
object.props = { ...object.props, ...path(ctx, args, 1) };
|
|
192
|
+
return null;
|
|
193
|
+
}),
|
|
194
|
+
setter('draw.setText', 'obj text', (args) => ({ text: valueAt(args, 1) })),
|
|
195
|
+
setter('draw.setColor', 'obj color', (args) => ({ color: valueAt(args, 1) })),
|
|
196
|
+
setter('draw.setTextColor', 'obj color', (args) => ({ textColor: valueAt(args, 1) })),
|
|
197
|
+
setter('draw.setFillColor', 'obj color', (args) => ({ fillColor: valueAt(args, 1) })),
|
|
198
|
+
setter('draw.setWidth', 'obj width', (args) => ({ width: valueAt(args, 1) })),
|
|
199
|
+
setter('draw.setStyle', 'obj style', (args) => ({ style: valueAt(args, 1) })),
|
|
200
|
+
setter('draw.setExtend', 'obj left right', (args) => ({
|
|
201
|
+
extendLeft: valueAt(args, 1),
|
|
202
|
+
extendRight: valueAt(args, 2),
|
|
203
|
+
})),
|
|
204
|
+
setter('draw.setTooltip', 'obj text', (args) => ({ tooltip: valueAt(args, 1) })),
|
|
205
|
+
|
|
206
|
+
// Deleting twice is not an error: the script asked for the object to be gone
|
|
207
|
+
// and it is gone. Only a change to a deleted object is OS4005.
|
|
208
|
+
entry('draw.delete', 'obj', (ctx, args) => {
|
|
209
|
+
const handle = refAt(args, 0);
|
|
210
|
+
if (handle !== null) ctx.heap.deleteDrawing(handle.id, ctx.bar.index);
|
|
211
|
+
return null;
|
|
212
|
+
}),
|
|
213
|
+
|
|
214
|
+
entry('draw.deleteAll', '', (ctx) => {
|
|
215
|
+
for (const { id } of ctx.heap.drawings()) ctx.heap.deleteDrawing(id, ctx.bar.index);
|
|
216
|
+
return null;
|
|
217
|
+
}),
|
|
218
|
+
|
|
219
|
+
entry('draw.count', '', (ctx) => ctx.heap.drawingCount()),
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* `cell(t, row, col, text, ...)`: one cell of a grid for this bar.
|
|
223
|
+
*
|
|
224
|
+
* The buffer is emptied at step 3 of every execution, so a re-executed bar
|
|
225
|
+
* rebuilds the whole grid and a checkpoint holds none of it. That is why a
|
|
226
|
+
* grid needs no rollback of its own while a drawing object does.
|
|
227
|
+
*/
|
|
228
|
+
entry('cell', 't row col text textColor bgColor align', (ctx, args) => {
|
|
229
|
+
const handle = refAt(args, 0);
|
|
230
|
+
if (handle === null) return null;
|
|
231
|
+
const object = ctx.heap.get(handle.id);
|
|
232
|
+
if (object === undefined || object.kind !== 'table') return null;
|
|
233
|
+
const row = wholeAt(ctx, 'cell', 'row', args, 1);
|
|
234
|
+
const col = wholeAt(ctx, 'cell', 'col', args, 2);
|
|
235
|
+
if (row === null || col === null) return null;
|
|
236
|
+
if (row >= object.rows || col >= object.cols) {
|
|
237
|
+
ctx.guard.badIndex(
|
|
238
|
+
ctx.span,
|
|
239
|
+
ctx.nameOf(valueAt(args, 0)),
|
|
240
|
+
`${row}, ${col}`,
|
|
241
|
+
object.rows * object.cols,
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
const written: GridCell = {
|
|
245
|
+
row,
|
|
246
|
+
col,
|
|
247
|
+
text: valueAt(args, 3),
|
|
248
|
+
textColor: valueAt(args, 4),
|
|
249
|
+
bgColor: valueAt(args, 5),
|
|
250
|
+
align: valueAt(args, 6),
|
|
251
|
+
};
|
|
252
|
+
object.cells.push(written);
|
|
253
|
+
return null;
|
|
254
|
+
}),
|
|
255
|
+
|
|
256
|
+
entry('clear', 'handle', (ctx, args) => {
|
|
257
|
+
if (clearArray(ctx, args)) return null;
|
|
258
|
+
const handle = refAt(args, 0);
|
|
259
|
+
if (handle === null) return null;
|
|
260
|
+
const object = ctx.heap.get(handle.id);
|
|
261
|
+
if (object === undefined || object.kind !== 'table') return null;
|
|
262
|
+
object.cells = [];
|
|
263
|
+
return null;
|
|
264
|
+
}),
|
|
265
|
+
];
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The momentum readings of `stdlib.md` section 5 that are not already wired
|
|
3
|
+
* beside the studies they share a file with.
|
|
4
|
+
*
|
|
5
|
+
* **Every number here is the numeric library's**, for the reason `series.ts`
|
|
6
|
+
* sets out beside the same wiring. Each entry is a call site and nothing more.
|
|
7
|
+
*
|
|
8
|
+
* Five of them read the bar rather than a source, and `stdlib.md` writes them
|
|
9
|
+
* without one for that reason: `stoch`, `cci`, `williamsR`, `ultimateOsc` and
|
|
10
|
+
* `awesomeOsc` are readings about the whole bar, so there is no source argument
|
|
11
|
+
* for a script to pass and none is invented here.
|
|
12
|
+
*/
|
|
13
|
+
import {
|
|
14
|
+
awesomeOscStep,
|
|
15
|
+
cciStep,
|
|
16
|
+
cmoStep,
|
|
17
|
+
dpoStep,
|
|
18
|
+
ppoStep,
|
|
19
|
+
stochRsiStep,
|
|
20
|
+
stochStep,
|
|
21
|
+
trixStep,
|
|
22
|
+
tsiStep,
|
|
23
|
+
ultimateOscStep,
|
|
24
|
+
williamsRStep,
|
|
25
|
+
} from '../../stdlib/index.js';
|
|
26
|
+
import { lengthAt, multi, numberAt } from './binding.js';
|
|
27
|
+
import type { ManifestEntry } from './binding.js';
|
|
28
|
+
import { stateful } from './state.js';
|
|
29
|
+
|
|
30
|
+
export const OSCILLATOR_ENTRIES: readonly ManifestEntry[] = [
|
|
31
|
+
stateful('stoch', 'len smoothK smoothD', (ctx, args) =>
|
|
32
|
+
multi(
|
|
33
|
+
ctx,
|
|
34
|
+
stochStep(
|
|
35
|
+
ctx.state,
|
|
36
|
+
'',
|
|
37
|
+
ctx.bar,
|
|
38
|
+
lengthAt(ctx, 'stoch', 'len', args, 0),
|
|
39
|
+
lengthAt(ctx, 'stoch', 'smoothK', args, 1),
|
|
40
|
+
lengthAt(ctx, 'stoch', 'smoothD', args, 2),
|
|
41
|
+
),
|
|
42
|
+
),
|
|
43
|
+
),
|
|
44
|
+
|
|
45
|
+
stateful('stochRsi', 'src rsiLen stochLen smoothK smoothD', (ctx, args) =>
|
|
46
|
+
multi(
|
|
47
|
+
ctx,
|
|
48
|
+
stochRsiStep(
|
|
49
|
+
ctx.state,
|
|
50
|
+
'',
|
|
51
|
+
numberAt(args, 0),
|
|
52
|
+
lengthAt(ctx, 'stochRsi', 'rsiLen', args, 1),
|
|
53
|
+
lengthAt(ctx, 'stochRsi', 'stochLen', args, 2),
|
|
54
|
+
lengthAt(ctx, 'stochRsi', 'smoothK', args, 3),
|
|
55
|
+
lengthAt(ctx, 'stochRsi', 'smoothD', args, 4),
|
|
56
|
+
),
|
|
57
|
+
),
|
|
58
|
+
),
|
|
59
|
+
|
|
60
|
+
stateful('ppo', 'src fast slow signal', (ctx, args) =>
|
|
61
|
+
multi(
|
|
62
|
+
ctx,
|
|
63
|
+
ppoStep(
|
|
64
|
+
ctx.state,
|
|
65
|
+
'',
|
|
66
|
+
numberAt(args, 0),
|
|
67
|
+
lengthAt(ctx, 'ppo', 'fast', args, 1),
|
|
68
|
+
lengthAt(ctx, 'ppo', 'slow', args, 2),
|
|
69
|
+
lengthAt(ctx, 'ppo', 'signal', args, 3),
|
|
70
|
+
),
|
|
71
|
+
),
|
|
72
|
+
),
|
|
73
|
+
|
|
74
|
+
stateful('cci', 'len', (ctx, args) =>
|
|
75
|
+
cciStep(ctx.state, '', ctx.bar, lengthAt(ctx, 'cci', 'len', args, 0)),
|
|
76
|
+
),
|
|
77
|
+
|
|
78
|
+
stateful('williamsR', 'len', (ctx, args) =>
|
|
79
|
+
williamsRStep(ctx.state, '', ctx.bar, lengthAt(ctx, 'williamsR', 'len', args, 0)),
|
|
80
|
+
),
|
|
81
|
+
|
|
82
|
+
stateful('tsi', 'src longLen shortLen', (ctx, args) =>
|
|
83
|
+
tsiStep(
|
|
84
|
+
ctx.state,
|
|
85
|
+
'',
|
|
86
|
+
numberAt(args, 0),
|
|
87
|
+
lengthAt(ctx, 'tsi', 'longLen', args, 1),
|
|
88
|
+
lengthAt(ctx, 'tsi', 'shortLen', args, 2),
|
|
89
|
+
),
|
|
90
|
+
),
|
|
91
|
+
|
|
92
|
+
stateful('trix', 'src len', (ctx, args) =>
|
|
93
|
+
trixStep(ctx.state, '', numberAt(args, 0), lengthAt(ctx, 'trix', 'len', args, 1)),
|
|
94
|
+
),
|
|
95
|
+
|
|
96
|
+
stateful('cmo', 'src len', (ctx, args) =>
|
|
97
|
+
cmoStep(ctx.state, '', numberAt(args, 0), lengthAt(ctx, 'cmo', 'len', args, 1)),
|
|
98
|
+
),
|
|
99
|
+
|
|
100
|
+
stateful('dpo', 'src len', (ctx, args) =>
|
|
101
|
+
dpoStep(ctx.state, '', numberAt(args, 0), lengthAt(ctx, 'dpo', 'len', args, 1)),
|
|
102
|
+
),
|
|
103
|
+
|
|
104
|
+
stateful('ultimateOsc', 'len1 len2 len3', (ctx, args) =>
|
|
105
|
+
ultimateOscStep(
|
|
106
|
+
ctx.state,
|
|
107
|
+
'',
|
|
108
|
+
ctx.bar,
|
|
109
|
+
lengthAt(ctx, 'ultimateOsc', 'len1', args, 0),
|
|
110
|
+
lengthAt(ctx, 'ultimateOsc', 'len2', args, 1),
|
|
111
|
+
lengthAt(ctx, 'ultimateOsc', 'len3', args, 2),
|
|
112
|
+
),
|
|
113
|
+
),
|
|
114
|
+
|
|
115
|
+
stateful('awesomeOsc', 'fast slow', (ctx, args) =>
|
|
116
|
+
awesomeOscStep(
|
|
117
|
+
ctx.state,
|
|
118
|
+
'',
|
|
119
|
+
ctx.bar,
|
|
120
|
+
lengthAt(ctx, 'awesomeOsc', 'fast', args, 0),
|
|
121
|
+
lengthAt(ctx, 'awesomeOsc', 'slow', args, 1),
|
|
122
|
+
),
|
|
123
|
+
),
|
|
124
|
+
];
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The three readings of `stdlib.md` section 6 that are not wired beside the
|
|
3
|
+
* bands they share a file with: `keltner`, `chop` and `hv`.
|
|
4
|
+
*
|
|
5
|
+
* **Every number here is the numeric library's**, for the reason `series.ts`
|
|
6
|
+
* sets out beside the same wiring.
|
|
7
|
+
*
|
|
8
|
+
* `keltner` and `chop` take the gap rather than the bar, because both are built
|
|
9
|
+
* on a true range and the previous close in one is the host's rather than one
|
|
10
|
+
* remembered at the call site: `range.ts` gives the reason. `keltner` is also
|
|
11
|
+
* handed the close and the volume, because its basis is `ma` over the close and
|
|
12
|
+
* that call can be switched to the volume weighted average.
|
|
13
|
+
*/
|
|
14
|
+
import { chopStep, hvStep, keltnerStep } from '../../stdlib/index.js';
|
|
15
|
+
import { lengthAt, multi, numberAt } from './binding.js';
|
|
16
|
+
import type { ManifestEntry } from './binding.js';
|
|
17
|
+
import { typeAt } from './averages.js';
|
|
18
|
+
import { gapAt, stateful } from './state.js';
|
|
19
|
+
|
|
20
|
+
export const RANGE_ENTRIES: readonly ManifestEntry[] = [
|
|
21
|
+
stateful('keltner', 'len mult atrLen maType', (ctx, args) =>
|
|
22
|
+
multi(
|
|
23
|
+
ctx,
|
|
24
|
+
keltnerStep(
|
|
25
|
+
ctx.state,
|
|
26
|
+
'',
|
|
27
|
+
gapAt(ctx),
|
|
28
|
+
ctx.bar.close,
|
|
29
|
+
ctx.bar.volume,
|
|
30
|
+
lengthAt(ctx, 'keltner', 'len', args, 0),
|
|
31
|
+
numberAt(args, 1),
|
|
32
|
+
lengthAt(ctx, 'keltner', 'atrLen', args, 2),
|
|
33
|
+
typeAt(args, 3),
|
|
34
|
+
),
|
|
35
|
+
),
|
|
36
|
+
),
|
|
37
|
+
|
|
38
|
+
stateful('chop', 'len', (ctx, args) =>
|
|
39
|
+
chopStep(ctx.state, '', gapAt(ctx), lengthAt(ctx, 'chop', 'len', args, 0)),
|
|
40
|
+
),
|
|
41
|
+
|
|
42
|
+
stateful('hv', 'src len periodsPerYear', (ctx, args) =>
|
|
43
|
+
hvStep(
|
|
44
|
+
ctx.state,
|
|
45
|
+
'',
|
|
46
|
+
numberAt(args, 0),
|
|
47
|
+
lengthAt(ctx, 'hv', 'len', args, 1),
|
|
48
|
+
numberAt(args, 2),
|
|
49
|
+
),
|
|
50
|
+
),
|
|
51
|
+
];
|