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,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `macd` and `ppo`: the gap between a fast and a slow exponential mean, once as
|
|
3
|
+
* a difference and once as a percentage.
|
|
4
|
+
*
|
|
5
|
+
* Both return an array holding this bar's outputs, per `stdlib.md` section 2.3.
|
|
6
|
+
* One call, one state region: the alternative of three named functions would be
|
|
7
|
+
* three call sites and therefore three independent states, and the shared
|
|
8
|
+
* smoothing would be computed three times per bar.
|
|
9
|
+
*
|
|
10
|
+
* The signal average is fed the difference series, absences and all, so it
|
|
11
|
+
* seeds on the first `signal` values the difference produced. That is where the
|
|
12
|
+
* declared warmup of bar `slow + signal - 2` comes from.
|
|
13
|
+
*/
|
|
14
|
+
import type { Series, StateRecord, Tail, Value } from '../values/index.js';
|
|
15
|
+
import { NONE, fold, isPresent, result, tailOf } from '../values/index.js';
|
|
16
|
+
import { emaStep } from '../averages/index.js';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* `macd(src, fast, slow, signal)`: `[macd, signal, histogram]`, element 0 from
|
|
20
|
+
* bar `slow - 1` and the other two from bar `slow + signal - 2`.
|
|
21
|
+
*/
|
|
22
|
+
export function macdStep(
|
|
23
|
+
state: StateRecord,
|
|
24
|
+
key: string,
|
|
25
|
+
value: Value,
|
|
26
|
+
fast: number | null,
|
|
27
|
+
slow: number | null,
|
|
28
|
+
signal: number | null,
|
|
29
|
+
): Value[] {
|
|
30
|
+
const near = emaStep(state, `${key}e`, value, fast);
|
|
31
|
+
const far = emaStep(state, `${key}g`, value, slow);
|
|
32
|
+
const line = isPresent(near) && isPresent(far) ? result(near - far) : NONE;
|
|
33
|
+
const trigger = emaStep(state, `${key}i`, line, signal);
|
|
34
|
+
const histogram = isPresent(line) && isPresent(trigger) ? result(line - trigger) : NONE;
|
|
35
|
+
return [line, trigger, histogram];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** `macd(src, fast, slow, signal)` as a tail. */
|
|
39
|
+
export function macdTail(fast = 12, slow = 26, signal = 9): Tail<Value, Value[]> {
|
|
40
|
+
return tailOf((state, value: Value) => macdStep(state, '', value, fast, slow, signal));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** `macd(src, fast, slow, signal)` over a whole series. */
|
|
44
|
+
export function macd(src: Series, fast = 12, slow = 26, signal = 9): Value[][] {
|
|
45
|
+
return fold(macdTail(fast, slow, signal), src);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* `ppo(src, fast, slow, signal)`: `[ppo, signal, histogram]`, on the same
|
|
50
|
+
* warmups as `macd`.
|
|
51
|
+
*
|
|
52
|
+
* The same gap divided by the slow average, so the reading is a percentage and
|
|
53
|
+
* two instruments at different price levels can be compared.
|
|
54
|
+
*/
|
|
55
|
+
export function ppoStep(
|
|
56
|
+
state: StateRecord,
|
|
57
|
+
key: string,
|
|
58
|
+
value: Value,
|
|
59
|
+
fast: number | null,
|
|
60
|
+
slow: number | null,
|
|
61
|
+
signal: number | null,
|
|
62
|
+
): Value[] {
|
|
63
|
+
const near = emaStep(state, `${key}e`, value, fast);
|
|
64
|
+
const far = emaStep(state, `${key}g`, value, slow);
|
|
65
|
+
const line =
|
|
66
|
+
isPresent(near) && isPresent(far) && far !== 0
|
|
67
|
+
? result((100 * (near - far)) / far)
|
|
68
|
+
: NONE;
|
|
69
|
+
const trigger = emaStep(state, `${key}i`, line, signal);
|
|
70
|
+
const histogram = isPresent(line) && isPresent(trigger) ? result(line - trigger) : NONE;
|
|
71
|
+
return [line, trigger, histogram];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** `ppo(src, fast, slow, signal)` as a tail. */
|
|
75
|
+
export function ppoTail(fast = 12, slow = 26, signal = 9): Tail<Value, Value[]> {
|
|
76
|
+
return tailOf((state, value: Value) => ppoStep(state, '', value, fast, slow, signal));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** `ppo(src, fast, slow, signal)` over a whole series. */
|
|
80
|
+
export function ppo(src: Series, fast = 12, slow = 26, signal = 9): Value[][] {
|
|
81
|
+
return fold(ppoTail(fast, slow, signal), src);
|
|
82
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export { rsi, rsiStep, rsiTail } from './rsi.js';
|
|
2
|
+
|
|
3
|
+
export { macd, macdStep, macdTail, ppo, ppoStep, ppoTail } from './convergence.js';
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
stoch,
|
|
7
|
+
stochRsi,
|
|
8
|
+
stochRsiStep,
|
|
9
|
+
stochRsiTail,
|
|
10
|
+
stochStep,
|
|
11
|
+
stochTail,
|
|
12
|
+
williamsR,
|
|
13
|
+
williamsRStep,
|
|
14
|
+
williamsRTail,
|
|
15
|
+
} from './stochastic.js';
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
cmo,
|
|
19
|
+
cmoStep,
|
|
20
|
+
cmoTail,
|
|
21
|
+
dpo,
|
|
22
|
+
dpoStep,
|
|
23
|
+
dpoTail,
|
|
24
|
+
mom,
|
|
25
|
+
momTail,
|
|
26
|
+
roc,
|
|
27
|
+
rocStep,
|
|
28
|
+
rocTail,
|
|
29
|
+
trix,
|
|
30
|
+
trixStep,
|
|
31
|
+
trixTail,
|
|
32
|
+
tsi,
|
|
33
|
+
tsiStep,
|
|
34
|
+
tsiTail,
|
|
35
|
+
} from './rates.js';
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
awesomeOsc,
|
|
39
|
+
awesomeOscStep,
|
|
40
|
+
awesomeOscTail,
|
|
41
|
+
cci,
|
|
42
|
+
cciStep,
|
|
43
|
+
cciTail,
|
|
44
|
+
ultimateOsc,
|
|
45
|
+
ultimateOscStep,
|
|
46
|
+
ultimateOscTail,
|
|
47
|
+
} from './pressure.js';
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The readings taken from the whole bar rather than from one price: `cci`,
|
|
3
|
+
* `ultimateOsc` and `awesomeOsc`.
|
|
4
|
+
*/
|
|
5
|
+
import type { Bar, StateRecord, Tail, Value } from '../values/index.js';
|
|
6
|
+
import { NONE, at, fold, held, hl2, hlc3, isPresent, result, tailOf } from '../values/index.js';
|
|
7
|
+
import { smaStep } from '../averages/index.js';
|
|
8
|
+
import { sumStep } from '../series/index.js';
|
|
9
|
+
import { meanDeviationStep } from '../volatility/index.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* `cci(len)`: how far the typical price sits from its mean in mean-deviation
|
|
13
|
+
* units, from bar `len - 1`.
|
|
14
|
+
*
|
|
15
|
+
* The divisor is the **mean absolute deviation**, not the standard deviation.
|
|
16
|
+
* The 0.015 constant is calibrated against that quantity, and substituting a
|
|
17
|
+
* standard deviation changes every reading while still producing a plausible
|
|
18
|
+
* looking line.
|
|
19
|
+
*/
|
|
20
|
+
export function cciStep(
|
|
21
|
+
state: StateRecord,
|
|
22
|
+
key: string,
|
|
23
|
+
bar: Bar,
|
|
24
|
+
len: number | null,
|
|
25
|
+
): Value {
|
|
26
|
+
const typical = hlc3(bar);
|
|
27
|
+
const mean = smaStep(state, `${key}q`, typical, len);
|
|
28
|
+
const deviation = meanDeviationStep(state, `${key}v`, typical, len);
|
|
29
|
+
if (!isPresent(typical) || !isPresent(mean) || !isPresent(deviation)) return NONE;
|
|
30
|
+
if (deviation === 0) return NONE;
|
|
31
|
+
return result((typical - mean) / (0.015 * deviation));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** `cci(len)` as a tail. */
|
|
35
|
+
export function cciTail(len = 20): Tail<Bar, Value> {
|
|
36
|
+
return tailOf((state, bar: Bar) => cciStep(state, '', bar, len));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** `cci(len)` over a run of bars. */
|
|
40
|
+
export function cci(bars: readonly Bar[], len = 20): Value[] {
|
|
41
|
+
return fold(cciTail(len), bars);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* `ultimateOsc(len1, len2, len3)`: buying pressure blended over three lookbacks,
|
|
46
|
+
* from bar `max(len1, len2, len3)`.
|
|
47
|
+
*
|
|
48
|
+
* Buying pressure is the close above the lower of this bar's low and the
|
|
49
|
+
* previous close, over the range between the higher of this bar's high and that
|
|
50
|
+
* close and the same lower bound. Both need the previous close, so the sums
|
|
51
|
+
* start at bar 1 and the first reading is at bar `max`, not `max - 1`.
|
|
52
|
+
*
|
|
53
|
+
* The weights are 4, 2 and 1 over 7, shortest lookback heaviest, which is what
|
|
54
|
+
* stops any single length dominating the reading.
|
|
55
|
+
*/
|
|
56
|
+
export function ultimateOscStep(
|
|
57
|
+
state: StateRecord,
|
|
58
|
+
key: string,
|
|
59
|
+
bar: Bar,
|
|
60
|
+
len1: number | null,
|
|
61
|
+
len2: number | null,
|
|
62
|
+
len3: number | null,
|
|
63
|
+
): Value {
|
|
64
|
+
const closeKey = `${key}p`;
|
|
65
|
+
const seenKey = `${key}k`;
|
|
66
|
+
const previousClose = held(state, closeKey);
|
|
67
|
+
const started = state[seenKey] === true;
|
|
68
|
+
|
|
69
|
+
let pressure: Value = NONE;
|
|
70
|
+
let range: Value = NONE;
|
|
71
|
+
if (
|
|
72
|
+
started &&
|
|
73
|
+
isPresent(previousClose) &&
|
|
74
|
+
isPresent(bar.high) &&
|
|
75
|
+
isPresent(bar.low) &&
|
|
76
|
+
isPresent(bar.close)
|
|
77
|
+
) {
|
|
78
|
+
const floorOf = Math.min(bar.low, previousClose);
|
|
79
|
+
const ceilingOf = Math.max(bar.high, previousClose);
|
|
80
|
+
pressure = result(bar.close - floorOf);
|
|
81
|
+
range = result(ceilingOf - floorOf);
|
|
82
|
+
}
|
|
83
|
+
state[seenKey] = true;
|
|
84
|
+
state[closeKey] = bar.close;
|
|
85
|
+
|
|
86
|
+
const lengths = [len1, len2, len3];
|
|
87
|
+
const averages: Value[] = [];
|
|
88
|
+
for (let index = 0; index < 3; index += 1) {
|
|
89
|
+
const len = lengths[index] ?? null;
|
|
90
|
+
const top = sumStep(state, `${key}t${index}`, pressure, len);
|
|
91
|
+
const bottom = sumStep(state, `${key}b${index}`, range, len);
|
|
92
|
+
averages.push(
|
|
93
|
+
isPresent(top) && isPresent(bottom) && bottom !== 0 ? result(top / bottom) : NONE,
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
const fast = at(averages, 0);
|
|
97
|
+
const middle = at(averages, 1);
|
|
98
|
+
const slow = at(averages, 2);
|
|
99
|
+
if (!isPresent(fast) || !isPresent(middle) || !isPresent(slow)) return NONE;
|
|
100
|
+
return result((100 * (4 * fast + 2 * middle + slow)) / 7);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** `ultimateOsc(len1, len2, len3)` as a tail. */
|
|
104
|
+
export function ultimateOscTail(len1 = 7, len2 = 14, len3 = 28): Tail<Bar, Value> {
|
|
105
|
+
return tailOf((state, bar: Bar) => ultimateOscStep(state, '', bar, len1, len2, len3));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** `ultimateOsc(len1, len2, len3)` over a run of bars. */
|
|
109
|
+
export function ultimateOsc(
|
|
110
|
+
bars: readonly Bar[],
|
|
111
|
+
len1 = 7,
|
|
112
|
+
len2 = 14,
|
|
113
|
+
len3 = 28,
|
|
114
|
+
): Value[] {
|
|
115
|
+
return fold(ultimateOscTail(len1, len2, len3), bars);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** `awesomeOsc(fast, slow)`: the difference of two simple means of `hl2`, from bar `slow - 1`. */
|
|
119
|
+
export function awesomeOscStep(
|
|
120
|
+
state: StateRecord,
|
|
121
|
+
key: string,
|
|
122
|
+
bar: Bar,
|
|
123
|
+
fast: number | null,
|
|
124
|
+
slow: number | null,
|
|
125
|
+
): Value {
|
|
126
|
+
const midpoint = hl2(bar);
|
|
127
|
+
const near = smaStep(state, `${key}f`, midpoint, fast);
|
|
128
|
+
const far = smaStep(state, `${key}s`, midpoint, slow);
|
|
129
|
+
if (!isPresent(near) || !isPresent(far)) return NONE;
|
|
130
|
+
return result(near - far);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** `awesomeOsc(fast, slow)` as a tail. */
|
|
134
|
+
export function awesomeOscTail(fast = 5, slow = 34): Tail<Bar, Value> {
|
|
135
|
+
return tailOf((state, bar: Bar) => awesomeOscStep(state, '', bar, fast, slow));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** `awesomeOsc(fast, slow)` over a run of bars. */
|
|
139
|
+
export function awesomeOsc(bars: readonly Bar[], fast = 5, slow = 34): Value[] {
|
|
140
|
+
return fold(awesomeOscTail(fast, slow), bars);
|
|
141
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The readings taken from change rather than from level: `mom`, `roc`, `cmo`,
|
|
3
|
+
* `trix`, `tsi` and `dpo`.
|
|
4
|
+
*
|
|
5
|
+
* Each one's warmup carries the extra bar a change costs, and `stdlib.md`
|
|
6
|
+
* section 5 states it in the entry rather than leaving it to be derived.
|
|
7
|
+
*/
|
|
8
|
+
import type { Series, StateRecord, Tail, Value } from '../values/index.js';
|
|
9
|
+
import { NONE, fold, isPresent, result, tailOf } from '../values/index.js';
|
|
10
|
+
import { emaStep, smaStep } from '../averages/index.js';
|
|
11
|
+
import { changeStep, changeTail, historyStep, sumStep } from '../series/index.js';
|
|
12
|
+
|
|
13
|
+
/** `mom(src, len)`: `src - src[len]`, from bar `len`. */
|
|
14
|
+
export function momTail(len = 10): Tail<Value, Value> {
|
|
15
|
+
return changeTail(len);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** `mom(src, len)` over a whole series. */
|
|
19
|
+
export function mom(src: Series, len = 10): Value[] {
|
|
20
|
+
return fold(momTail(len), src);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** `roc(src, len)`: the same change as a percentage of the older value, from bar `len`. */
|
|
24
|
+
export function rocStep(
|
|
25
|
+
state: StateRecord,
|
|
26
|
+
key: string,
|
|
27
|
+
value: Value,
|
|
28
|
+
len: number | null,
|
|
29
|
+
): Value {
|
|
30
|
+
const then = historyStep(state, `${key}h`, value, len);
|
|
31
|
+
const delta = changeStep(state, `${key}c`, value, len);
|
|
32
|
+
if (!isPresent(then) || !isPresent(delta) || then === 0) return NONE;
|
|
33
|
+
return result((100 * delta) / then);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** `roc(src, len)` as a tail. */
|
|
37
|
+
export function rocTail(len = 9): Tail<Value, Value> {
|
|
38
|
+
return tailOf((state, value: Value) => rocStep(state, '', value, len));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** `roc(src, len)` over a whole series. */
|
|
42
|
+
export function roc(src: Series, len = 9): Value[] {
|
|
43
|
+
return fold(rocTail(len), src);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* `cmo(src, len)`: up sum less down sum over their total, -100 to 100, from bar
|
|
48
|
+
* `len`.
|
|
49
|
+
*
|
|
50
|
+
* Unsmoothed, which is the whole point of it: the sums are taken over the
|
|
51
|
+
* lookback outright rather than through an average, so a turn shows on the bar it
|
|
52
|
+
* happens.
|
|
53
|
+
*/
|
|
54
|
+
export function cmoStep(
|
|
55
|
+
state: StateRecord,
|
|
56
|
+
key: string,
|
|
57
|
+
value: Value,
|
|
58
|
+
len: number | null,
|
|
59
|
+
): Value {
|
|
60
|
+
const delta = changeStep(state, `${key}c`, value, 1);
|
|
61
|
+
const up = isPresent(delta) ? result(Math.max(delta, 0)) : NONE;
|
|
62
|
+
const down = isPresent(delta) ? result(Math.max(-delta, 0)) : NONE;
|
|
63
|
+
const rise = sumStep(state, `${key}u`, up, len);
|
|
64
|
+
const fall = sumStep(state, `${key}d`, down, len);
|
|
65
|
+
if (!isPresent(rise) || !isPresent(fall)) return NONE;
|
|
66
|
+
const total = rise + fall;
|
|
67
|
+
if (total === 0) return NONE;
|
|
68
|
+
return result((100 * (rise - fall)) / total);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** `cmo(src, len)` as a tail. */
|
|
72
|
+
export function cmoTail(len = 9): Tail<Value, Value> {
|
|
73
|
+
return tailOf((state, value: Value) => cmoStep(state, '', value, len));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** `cmo(src, len)` over a whole series. */
|
|
77
|
+
export function cmo(src: Series, len = 9): Value[] {
|
|
78
|
+
return fold(cmoTail(len), src);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* `trix(src, len)`: the rate of change of a triple exponential mean, from bar
|
|
83
|
+
* `3 * len - 2`.
|
|
84
|
+
*
|
|
85
|
+
* `stdlib.md` section 5 says rate of change, so this is the percentage change
|
|
86
|
+
* of the smoothed series over one bar. The other reading in circulation takes
|
|
87
|
+
* the change of the logarithm of the average instead; it is a different number
|
|
88
|
+
* and it is not what the entry describes.
|
|
89
|
+
*/
|
|
90
|
+
export function trixStep(
|
|
91
|
+
state: StateRecord,
|
|
92
|
+
key: string,
|
|
93
|
+
value: Value,
|
|
94
|
+
len: number | null,
|
|
95
|
+
): Value {
|
|
96
|
+
const once = emaStep(state, `${key}a`, value, len);
|
|
97
|
+
const twice = emaStep(state, `${key}b`, once, len);
|
|
98
|
+
const smoothed = emaStep(state, `${key}c`, twice, len);
|
|
99
|
+
const before = historyStep(state, `${key}h`, smoothed, 1);
|
|
100
|
+
if (!isPresent(smoothed) || !isPresent(before) || before === 0) return NONE;
|
|
101
|
+
return result((100 * (smoothed - before)) / before);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** `trix(src, len)` as a tail. */
|
|
105
|
+
export function trixTail(len = 18): Tail<Value, Value> {
|
|
106
|
+
return tailOf((state, value: Value) => trixStep(state, '', value, len));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** `trix(src, len)` over a whole series. */
|
|
110
|
+
export function trix(src: Series, len = 18): Value[] {
|
|
111
|
+
return fold(trixTail(len), src);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* `tsi(src, longLen, shortLen)`: double smoothed momentum, from bar
|
|
116
|
+
* `longLen + shortLen - 1`.
|
|
117
|
+
*
|
|
118
|
+
* The change smoothed twice, over the size of the change smoothed the same way
|
|
119
|
+
* twice, so the result is a direction rather than a magnitude and the noise
|
|
120
|
+
* `mom` carries is gone.
|
|
121
|
+
*/
|
|
122
|
+
export function tsiStep(
|
|
123
|
+
state: StateRecord,
|
|
124
|
+
key: string,
|
|
125
|
+
value: Value,
|
|
126
|
+
longLen: number | null,
|
|
127
|
+
shortLen: number | null,
|
|
128
|
+
): Value {
|
|
129
|
+
const delta = changeStep(state, `${key}c`, value, 1);
|
|
130
|
+
const size = isPresent(delta) ? result(Math.abs(delta)) : NONE;
|
|
131
|
+
const direction = emaStep(
|
|
132
|
+
state,
|
|
133
|
+
`${key}n`,
|
|
134
|
+
emaStep(state, `${key}m`, delta, longLen),
|
|
135
|
+
shortLen,
|
|
136
|
+
);
|
|
137
|
+
const magnitude = emaStep(
|
|
138
|
+
state,
|
|
139
|
+
`${key}z`,
|
|
140
|
+
emaStep(state, `${key}y`, size, longLen),
|
|
141
|
+
shortLen,
|
|
142
|
+
);
|
|
143
|
+
if (!isPresent(direction) || !isPresent(magnitude) || magnitude === 0) return NONE;
|
|
144
|
+
return result((100 * direction) / magnitude);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** `tsi(src, longLen, shortLen)` as a tail. */
|
|
148
|
+
export function tsiTail(longLen = 25, shortLen = 13): Tail<Value, Value> {
|
|
149
|
+
return tailOf((state, value: Value) => tsiStep(state, '', value, longLen, shortLen));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** `tsi(src, longLen, shortLen)` over a whole series. */
|
|
153
|
+
export function tsi(src: Series, longLen = 25, shortLen = 13): Value[] {
|
|
154
|
+
return fold(tsiTail(longLen, shortLen), src);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* `dpo(src, len)`: price with its displaced mean removed, from bar
|
|
159
|
+
* `len + floor(len / 2)`.
|
|
160
|
+
*
|
|
161
|
+
* The mean is read `floor(len / 2) + 1` bars back rather than at this bar,
|
|
162
|
+
* which is what "displaced" means here and what the declared warmup requires:
|
|
163
|
+
* the average's own first value at bar `len - 1`, plus the displacement, is
|
|
164
|
+
* exactly `len + floor(len / 2)`. Removing an undisplaced mean would be a
|
|
165
|
+
* different study with a warmup of `len - 1`.
|
|
166
|
+
*/
|
|
167
|
+
export function dpoStep(
|
|
168
|
+
state: StateRecord,
|
|
169
|
+
key: string,
|
|
170
|
+
value: Value,
|
|
171
|
+
len: number | null,
|
|
172
|
+
): Value {
|
|
173
|
+
const average = smaStep(state, `${key}q`, value, len);
|
|
174
|
+
const back = len === null ? null : Math.floor(len / 2) + 1;
|
|
175
|
+
const mean = historyStep(state, `${key}h`, average, back);
|
|
176
|
+
if (!isPresent(value) || !isPresent(mean)) return NONE;
|
|
177
|
+
return result(value - mean);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** `dpo(src, len)` as a tail. */
|
|
181
|
+
export function dpoTail(len = 21): Tail<Value, Value> {
|
|
182
|
+
return tailOf((state, value: Value) => dpoStep(state, '', value, len));
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** `dpo(src, len)` over a whole series. */
|
|
186
|
+
export function dpo(src: Series, len = 21): Value[] {
|
|
187
|
+
return fold(dpoTail(len), src);
|
|
188
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `rsi(src, len)`.
|
|
3
|
+
*
|
|
4
|
+
* **The first value is at bar `len`, not at bar `len - 1`.** `rsi` needs `len`
|
|
5
|
+
* changes and a change needs two bars, so the smoothing's lookback is bars 1 to
|
|
6
|
+
* `len`. `stdlib.md` section 5 states this warmup rather than leaving a reader
|
|
7
|
+
* to work it out, and every entry in that section which consumes changes rather
|
|
8
|
+
* than levels carries the same extra bar.
|
|
9
|
+
*
|
|
10
|
+
* The smoothing is `rma`, seeded with the simple average of the first `len`
|
|
11
|
+
* changes, which is what makes this the classic reading rather than one of the
|
|
12
|
+
* several averages that also produce a number between 0 and 100.
|
|
13
|
+
*/
|
|
14
|
+
import type { Series, StateRecord, Tail, Value } from '../values/index.js';
|
|
15
|
+
import { NONE, fold, isPresent, result, tailOf } from '../values/index.js';
|
|
16
|
+
import { rmaStep } from '../averages/index.js';
|
|
17
|
+
import { changeStep } from '../series/index.js';
|
|
18
|
+
|
|
19
|
+
/** `rsi(src, len)`: from bar `len`. */
|
|
20
|
+
export function rsiStep(
|
|
21
|
+
state: StateRecord,
|
|
22
|
+
key: string,
|
|
23
|
+
value: Value,
|
|
24
|
+
len: number | null,
|
|
25
|
+
): Value {
|
|
26
|
+
const delta = changeStep(state, `${key}c`, value, 1);
|
|
27
|
+
const up = isPresent(delta) ? result(Math.max(delta, 0)) : NONE;
|
|
28
|
+
const down = isPresent(delta) ? result(Math.max(-delta, 0)) : NONE;
|
|
29
|
+
const averageUp = rmaStep(state, `${key}u`, up, len);
|
|
30
|
+
const averageDown = rmaStep(state, `${key}d`, down, len);
|
|
31
|
+
if (!isPresent(averageUp) || !isPresent(averageDown)) return NONE;
|
|
32
|
+
// No down bar in the lookback is the top of the scale. This also catches a
|
|
33
|
+
// lookback that never moved at all, where both averages are zero and the
|
|
34
|
+
// ratio has no value; every reference implementation reads 100 there, and
|
|
35
|
+
// disagreeing with all of them on a flat lookback would be a worse answer
|
|
36
|
+
// than the one they give.
|
|
37
|
+
if (averageDown === 0) return 100;
|
|
38
|
+
return result(100 - 100 / (1 + averageUp / averageDown));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** `rsi(src, len)` as a tail. */
|
|
42
|
+
export function rsiTail(len = 14): Tail<Value, Value> {
|
|
43
|
+
return tailOf((state, value: Value) => rsiStep(state, '', value, len));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** `rsi(src, len)` over a whole series. */
|
|
47
|
+
export function rsi(src: Series, len = 14): Value[] {
|
|
48
|
+
return fold(rsiTail(len), src);
|
|
49
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a value sits inside a lookback's range: `stoch`, `stochRsi` and
|
|
3
|
+
* `williamsR`.
|
|
4
|
+
*
|
|
5
|
+
* All three are the same test with different sources and different scales.
|
|
6
|
+
* They are written once, as `position`, so the three cannot drift apart.
|
|
7
|
+
*/
|
|
8
|
+
import type { Bar, Series, StateRecord, Tail, Value } from '../values/index.js';
|
|
9
|
+
import { NONE, fold, isPresent, result, tailOf } from '../values/index.js';
|
|
10
|
+
import { smaStep } from '../averages/index.js';
|
|
11
|
+
import { extremeStep } from '../series/index.js';
|
|
12
|
+
|
|
13
|
+
import { rsiStep } from './rsi.js';
|
|
14
|
+
|
|
15
|
+
/** Where `value` sits between `low` and `high`, as 0 to 100. Absent on a flat range. */
|
|
16
|
+
function position(value: Value, high: Value, low: Value): Value {
|
|
17
|
+
if (!isPresent(value) || !isPresent(high) || !isPresent(low)) return NONE;
|
|
18
|
+
const span = high - low;
|
|
19
|
+
if (span === 0) return NONE;
|
|
20
|
+
return result((100 * (value - low)) / span);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** The largest value in the last `len` bars, as the three studies here read it. */
|
|
24
|
+
function topStep(state: StateRecord, key: string, value: Value, len: number | null): Value {
|
|
25
|
+
return extremeStep(state, key, value, len, true, false);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** The smallest value in the last `len` bars. */
|
|
29
|
+
function bottomStep(state: StateRecord, key: string, value: Value, len: number | null): Value {
|
|
30
|
+
return extremeStep(state, key, value, len, false, false);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The raw range position of a series against its own lookback. */
|
|
34
|
+
function rawStep(state: StateRecord, key: string, value: Value, len: number | null): Value {
|
|
35
|
+
const high = topStep(state, `${key}t`, value, len);
|
|
36
|
+
const low = bottomStep(state, `${key}b`, value, len);
|
|
37
|
+
return position(value, high, low);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* `stoch(len, smoothK, smoothD)`: `[k, d]`, element 0 from bar
|
|
42
|
+
* `len + smoothK - 2` and element 1 from bar `len + smoothK + smoothD - 3`.
|
|
43
|
+
*
|
|
44
|
+
* The close against the lookback's outright high and low, which are the bars'
|
|
45
|
+
* highs and lows and not the close's own extremes.
|
|
46
|
+
*/
|
|
47
|
+
export function stochStep(
|
|
48
|
+
state: StateRecord,
|
|
49
|
+
key: string,
|
|
50
|
+
bar: Bar,
|
|
51
|
+
len: number | null,
|
|
52
|
+
smoothK: number | null,
|
|
53
|
+
smoothD: number | null,
|
|
54
|
+
): Value[] {
|
|
55
|
+
const high = topStep(state, `${key}t`, bar.high, len);
|
|
56
|
+
const low = bottomStep(state, `${key}b`, bar.low, len);
|
|
57
|
+
const raw = position(bar.close, high, low);
|
|
58
|
+
const k = smaStep(state, `${key}k`, raw, smoothK);
|
|
59
|
+
const d = smaStep(state, `${key}d`, k, smoothD);
|
|
60
|
+
return [k, d];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** `stoch(len, smoothK, smoothD)` as a tail. */
|
|
64
|
+
export function stochTail(len = 14, smoothK = 1, smoothD = 3): Tail<Bar, Value[]> {
|
|
65
|
+
return tailOf((state, bar: Bar) => stochStep(state, '', bar, len, smoothK, smoothD));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** `stoch(len, smoothK, smoothD)` over a run of bars. */
|
|
69
|
+
export function stoch(bars: readonly Bar[], len = 14, smoothK = 1, smoothD = 3): Value[][] {
|
|
70
|
+
return fold(stochTail(len, smoothK, smoothD), bars);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* `stochRsi(src, rsiLen, stochLen, smoothK, smoothD)`: `[k, d]`, element 0 from
|
|
75
|
+
* bar `rsiLen + stochLen + smoothK - 2`.
|
|
76
|
+
*
|
|
77
|
+
* The same position test applied to `rsi` rather than to price, so the lookback
|
|
78
|
+
* is the range the strength reading itself covered.
|
|
79
|
+
*/
|
|
80
|
+
export function stochRsiStep(
|
|
81
|
+
state: StateRecord,
|
|
82
|
+
key: string,
|
|
83
|
+
value: Value,
|
|
84
|
+
rsiLen: number | null,
|
|
85
|
+
stochLen: number | null,
|
|
86
|
+
smoothK: number | null,
|
|
87
|
+
smoothD: number | null,
|
|
88
|
+
): Value[] {
|
|
89
|
+
const strength = rsiStep(state, `${key}r`, value, rsiLen);
|
|
90
|
+
const raw = rawStep(state, `${key}p`, strength, stochLen);
|
|
91
|
+
const k = smaStep(state, `${key}k`, raw, smoothK);
|
|
92
|
+
const d = smaStep(state, `${key}d`, k, smoothD);
|
|
93
|
+
return [k, d];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** `stochRsi(src, rsiLen, stochLen, smoothK, smoothD)` as a tail. */
|
|
97
|
+
export function stochRsiTail(
|
|
98
|
+
rsiLen = 14,
|
|
99
|
+
stochLen = 14,
|
|
100
|
+
smoothK = 3,
|
|
101
|
+
smoothD = 3,
|
|
102
|
+
): Tail<Value, Value[]> {
|
|
103
|
+
return tailOf((state, value: Value) =>
|
|
104
|
+
stochRsiStep(state, '', value, rsiLen, stochLen, smoothK, smoothD),
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** `stochRsi(src, rsiLen, stochLen, smoothK, smoothD)` over a whole series. */
|
|
109
|
+
export function stochRsi(
|
|
110
|
+
src: Series,
|
|
111
|
+
rsiLen = 14,
|
|
112
|
+
stochLen = 14,
|
|
113
|
+
smoothK = 3,
|
|
114
|
+
smoothD = 3,
|
|
115
|
+
): Value[][] {
|
|
116
|
+
return fold(stochRsiTail(rsiLen, stochLen, smoothK, smoothD), src);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* `williamsR(len)`: the same position scaled 0 to -100, from bar `len - 1`.
|
|
121
|
+
*
|
|
122
|
+
* Zero at the top of the range and -100 at the bottom, which is the sign
|
|
123
|
+
* convention the reading has always carried.
|
|
124
|
+
*/
|
|
125
|
+
export function williamsRStep(
|
|
126
|
+
state: StateRecord,
|
|
127
|
+
key: string,
|
|
128
|
+
bar: Bar,
|
|
129
|
+
len: number | null,
|
|
130
|
+
): Value {
|
|
131
|
+
const high = topStep(state, `${key}t`, bar.high, len);
|
|
132
|
+
const low = bottomStep(state, `${key}b`, bar.low, len);
|
|
133
|
+
if (!isPresent(bar.close) || !isPresent(high) || !isPresent(low)) return NONE;
|
|
134
|
+
const span = high - low;
|
|
135
|
+
if (span === 0) return NONE;
|
|
136
|
+
return result((-100 * (high - bar.close)) / span);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** `williamsR(len)` as a tail. */
|
|
140
|
+
export function williamsRTail(len = 14): Tail<Bar, Value> {
|
|
141
|
+
return tailOf((state, bar: Bar) => williamsRStep(state, '', bar, len));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** `williamsR(len)` over a run of bars. */
|
|
145
|
+
export function williamsR(bars: readonly Bar[], len = 14): Value[] {
|
|
146
|
+
return fold(williamsRTail(len), bars);
|
|
147
|
+
}
|