openalgo-script 0.1.0-alpha.1 → 0.4.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 +1469 -0
- package/README.md +85 -30
- 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 +221 -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 +166 -0
- package/dist/adapters/charts/tables.js.map +1 -0
- package/dist/adapters/codemirror/commands.d.ts +14 -0
- package/dist/adapters/codemirror/commands.d.ts.map +1 -0
- package/dist/adapters/codemirror/commands.js +52 -0
- package/dist/adapters/codemirror/commands.js.map +1 -0
- package/dist/adapters/codemirror/completion.d.ts +15 -0
- package/dist/adapters/codemirror/completion.d.ts.map +1 -0
- package/dist/adapters/codemirror/completion.js +64 -0
- package/dist/adapters/codemirror/completion.js.map +1 -0
- package/dist/adapters/codemirror/contract.d.ts +156 -0
- package/dist/adapters/codemirror/contract.d.ts.map +1 -0
- package/dist/adapters/codemirror/contract.js +42 -0
- package/dist/adapters/codemirror/contract.js.map +1 -0
- package/dist/adapters/codemirror/index.d.ts +43 -0
- package/dist/adapters/codemirror/index.d.ts.map +1 -0
- package/dist/adapters/codemirror/index.js +8 -0
- package/dist/adapters/codemirror/index.js.map +1 -0
- package/dist/adapters/codemirror/lint.d.ts +17 -0
- package/dist/adapters/codemirror/lint.d.ts.map +1 -0
- package/dist/adapters/codemirror/lint.js +62 -0
- package/dist/adapters/codemirror/lint.js.map +1 -0
- package/dist/adapters/codemirror/positions.d.ts +16 -0
- package/dist/adapters/codemirror/positions.d.ts.map +1 -0
- package/dist/adapters/codemirror/positions.js +65 -0
- package/dist/adapters/codemirror/positions.js.map +1 -0
- package/dist/adapters/codemirror/stream.d.ts +23 -0
- package/dist/adapters/codemirror/stream.d.ts.map +1 -0
- package/dist/adapters/codemirror/stream.js +70 -0
- package/dist/adapters/codemirror/stream.js.map +1 -0
- package/dist/adapters/codemirror/tokens.d.ts +44 -0
- package/dist/adapters/codemirror/tokens.d.ts.map +1 -0
- package/dist/adapters/codemirror/tokens.js +34 -0
- package/dist/adapters/codemirror/tokens.js.map +1 -0
- package/dist/adapters/codemirror/tooltips.d.ts +35 -0
- package/dist/adapters/codemirror/tooltips.d.ts.map +1 -0
- package/dist/adapters/codemirror/tooltips.js +108 -0
- package/dist/adapters/codemirror/tooltips.js.map +1 -0
- package/dist/core/accounting/charges.d.ts +136 -0
- package/dist/core/accounting/charges.d.ts.map +1 -0
- package/dist/core/accounting/charges.js +362 -0
- package/dist/core/accounting/charges.js.map +1 -0
- package/dist/core/accounting/equity.d.ts +158 -0
- package/dist/core/accounting/equity.d.ts.map +1 -0
- package/dist/core/accounting/equity.js +155 -0
- package/dist/core/accounting/equity.js.map +1 -0
- package/dist/core/accounting/index.d.ts +44 -0
- package/dist/core/accounting/index.d.ts.map +1 -0
- package/dist/core/accounting/index.js +36 -0
- package/dist/core/accounting/index.js.map +1 -0
- package/dist/core/accounting/markers.d.ts +43 -0
- package/dist/core/accounting/markers.d.ts.map +1 -0
- package/dist/core/accounting/markers.js +64 -0
- package/dist/core/accounting/markers.js.map +1 -0
- package/dist/core/accounting/monthly.d.ts +52 -0
- package/dist/core/accounting/monthly.d.ts.map +1 -0
- package/dist/core/accounting/monthly.js +99 -0
- package/dist/core/accounting/monthly.js.map +1 -0
- package/dist/core/accounting/report.d.ts +38 -0
- package/dist/core/accounting/report.d.ts.map +1 -0
- package/dist/core/accounting/report.js +63 -0
- package/dist/core/accounting/report.js.map +1 -0
- package/dist/core/accounting/shapes.d.ts +70 -0
- package/dist/core/accounting/shapes.d.ts.map +1 -0
- package/dist/core/accounting/shapes.js +21 -0
- package/dist/core/accounting/shapes.js.map +1 -0
- package/dist/core/accounting/statistics.d.ts +75 -0
- package/dist/core/accounting/statistics.d.ts.map +1 -0
- package/dist/core/accounting/statistics.js +246 -0
- package/dist/core/accounting/statistics.js.map +1 -0
- package/dist/core/accounting/trades.d.ts +118 -0
- package/dist/core/accounting/trades.d.ts.map +1 -0
- package/dist/core/accounting/trades.js +186 -0
- package/dist/core/accounting/trades.js.map +1 -0
- package/dist/core/backtest/compare.d.ts +38 -0
- package/dist/core/backtest/compare.d.ts.map +1 -0
- package/dist/core/backtest/compare.js +189 -0
- package/dist/core/backtest/compare.js.map +1 -0
- package/dist/core/backtest/declaration.d.ts +52 -0
- package/dist/core/backtest/declaration.d.ts.map +1 -0
- package/dist/core/backtest/declaration.js +48 -0
- package/dist/core/backtest/declaration.js.map +1 -0
- package/dist/core/backtest/drive.d.ts +29 -0
- package/dist/core/backtest/drive.d.ts.map +1 -0
- package/dist/core/backtest/drive.js +262 -0
- package/dist/core/backtest/drive.js.map +1 -0
- package/dist/core/backtest/index.d.ts +46 -0
- package/dist/core/backtest/index.d.ts.map +1 -0
- package/dist/core/backtest/index.js +36 -0
- package/dist/core/backtest/index.js.map +1 -0
- package/dist/core/backtest/range.d.ts +84 -0
- package/dist/core/backtest/range.d.ts.map +1 -0
- package/dist/core/backtest/range.js +90 -0
- package/dist/core/backtest/range.js.map +1 -0
- package/dist/core/backtest/record.d.ts +238 -0
- package/dist/core/backtest/record.d.ts.map +1 -0
- package/dist/core/backtest/record.js +176 -0
- package/dist/core/backtest/record.js.map +1 -0
- package/dist/core/backtest/replay.d.ts +48 -0
- package/dist/core/backtest/replay.d.ts.map +1 -0
- package/dist/core/backtest/replay.js +127 -0
- package/dist/core/backtest/replay.js.map +1 -0
- package/dist/core/backtest/resting.d.ts +62 -0
- package/dist/core/backtest/resting.d.ts.map +1 -0
- package/dist/core/backtest/resting.js +59 -0
- package/dist/core/backtest/resting.js.map +1 -0
- package/dist/core/backtest/settings.d.ts +117 -0
- package/dist/core/backtest/settings.d.ts.map +1 -0
- package/dist/core/backtest/settings.js +207 -0
- package/dist/core/backtest/settings.js.map +1 -0
- package/dist/core/backtest/simulate.d.ts +146 -0
- package/dist/core/backtest/simulate.d.ts.map +1 -0
- package/dist/core/backtest/simulate.js +217 -0
- package/dist/core/backtest/simulate.js.map +1 -0
- package/dist/core/catalogue/catalogue.generated.d.ts +164 -10
- package/dist/core/catalogue/catalogue.generated.d.ts.map +1 -1
- package/dist/core/catalogue/catalogue.generated.js +23 -9
- package/dist/core/catalogue/catalogue.generated.js.map +1 -1
- package/dist/core/catalogue/values.generated.d.ts +49 -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 +31 -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-prose.generated.d.ts +16 -0
- package/dist/core/check/library-prose.generated.d.ts.map +1 -0
- package/dist/core/check/library-prose.generated.js +353 -0
- package/dist/core/check/library-prose.generated.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 +62 -0
- package/dist/core/check/surface.d.ts.map +1 -0
- package/dist/core/check/surface.js +129 -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 +64 -0
- package/dist/core/emit/defaults.d.ts.map +1 -0
- package/dist/core/emit/defaults.js +182 -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 +31 -0
- package/dist/core/emit/index.d.ts.map +1 -0
- package/dist/core/emit/index.js +25 -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 +59 -0
- package/dist/core/engine/load.d.ts.map +1 -0
- package/dist/core/engine/load.js +61 -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 +95 -6
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +64 -6
- package/dist/core/index.js.map +1 -1
- package/dist/core/parse/expressions.js +1 -1
- package/dist/core/parse/expressions.js.map +1 -1
- package/dist/core/parse/names.d.ts +7 -1
- package/dist/core/parse/names.d.ts.map +1 -1
- package/dist/core/parse/names.js +28 -2
- package/dist/core/parse/names.js.map +1 -1
- package/dist/core/stdlib/averages/exponential.d.ts +51 -0
- package/dist/core/stdlib/averages/exponential.d.ts.map +1 -0
- package/dist/core/stdlib/averages/exponential.js +72 -0
- package/dist/core/stdlib/averages/exponential.js.map +1 -0
- package/dist/core/stdlib/averages/index.d.ts +7 -0
- package/dist/core/stdlib/averages/index.d.ts.map +1 -0
- package/dist/core/stdlib/averages/index.js +5 -0
- package/dist/core/stdlib/averages/index.js.map +1 -0
- package/dist/core/stdlib/averages/select.d.ts +35 -0
- package/dist/core/stdlib/averages/select.d.ts.map +1 -0
- package/dist/core/stdlib/averages/select.js +43 -0
- package/dist/core/stdlib/averages/select.js.map +1 -0
- package/dist/core/stdlib/averages/shaped.d.ts +61 -0
- package/dist/core/stdlib/averages/shaped.d.ts.map +1 -0
- package/dist/core/stdlib/averages/shaped.js +126 -0
- package/dist/core/stdlib/averages/shaped.js.map +1 -0
- package/dist/core/stdlib/averages/simple.d.ts +58 -0
- package/dist/core/stdlib/averages/simple.d.ts.map +1 -0
- package/dist/core/stdlib/averages/simple.js +92 -0
- package/dist/core/stdlib/averages/simple.js.map +1 -0
- package/dist/core/stdlib/calendar/civil.d.ts +56 -0
- package/dist/core/stdlib/calendar/civil.d.ts.map +1 -0
- package/dist/core/stdlib/calendar/civil.js +70 -0
- package/dist/core/stdlib/calendar/civil.js.map +1 -0
- package/dist/core/stdlib/calendar/fields.d.ts +36 -0
- package/dist/core/stdlib/calendar/fields.d.ts.map +1 -0
- package/dist/core/stdlib/calendar/fields.js +93 -0
- package/dist/core/stdlib/calendar/fields.js.map +1 -0
- package/dist/core/stdlib/calendar/format.d.ts +19 -0
- package/dist/core/stdlib/calendar/format.d.ts.map +1 -0
- package/dist/core/stdlib/calendar/format.js +51 -0
- package/dist/core/stdlib/calendar/format.js.map +1 -0
- package/dist/core/stdlib/calendar/index.d.ts +7 -0
- package/dist/core/stdlib/calendar/index.d.ts.map +1 -0
- package/dist/core/stdlib/calendar/index.js +5 -0
- package/dist/core/stdlib/calendar/index.js.map +1 -0
- package/dist/core/stdlib/calendar/zone.d.ts +53 -0
- package/dist/core/stdlib/calendar/zone.d.ts.map +1 -0
- package/dist/core/stdlib/calendar/zone.js +138 -0
- package/dist/core/stdlib/calendar/zone.js.map +1 -0
- package/dist/core/stdlib/index.d.ts +57 -0
- package/dist/core/stdlib/index.d.ts.map +1 -0
- package/dist/core/stdlib/index.js +51 -0
- package/dist/core/stdlib/index.js.map +1 -0
- package/dist/core/stdlib/maths/arithmetic.d.ts +38 -0
- package/dist/core/stdlib/maths/arithmetic.d.ts.map +1 -0
- package/dist/core/stdlib/maths/arithmetic.js +66 -0
- package/dist/core/stdlib/maths/arithmetic.js.map +1 -0
- package/dist/core/stdlib/maths/elementary.d.ts +65 -0
- package/dist/core/stdlib/maths/elementary.d.ts.map +1 -0
- package/dist/core/stdlib/maths/elementary.js +93 -0
- package/dist/core/stdlib/maths/elementary.js.map +1 -0
- package/dist/core/stdlib/maths/index.d.ts +4 -0
- package/dist/core/stdlib/maths/index.d.ts.map +1 -0
- package/dist/core/stdlib/maths/index.js +4 -0
- package/dist/core/stdlib/maths/index.js.map +1 -0
- package/dist/core/stdlib/maths/rounding.d.ts +43 -0
- package/dist/core/stdlib/maths/rounding.d.ts.map +1 -0
- package/dist/core/stdlib/maths/rounding.js +62 -0
- package/dist/core/stdlib/maths/rounding.js.map +1 -0
- package/dist/core/stdlib/momentum/convergence.d.ts +36 -0
- package/dist/core/stdlib/momentum/convergence.d.ts.map +1 -0
- package/dist/core/stdlib/momentum/convergence.js +48 -0
- package/dist/core/stdlib/momentum/convergence.js.map +1 -0
- package/dist/core/stdlib/momentum/index.d.ts +6 -0
- package/dist/core/stdlib/momentum/index.d.ts.map +1 -0
- package/dist/core/stdlib/momentum/index.js +6 -0
- package/dist/core/stdlib/momentum/index.js.map +1 -0
- package/dist/core/stdlib/momentum/pressure.d.ts +43 -0
- package/dist/core/stdlib/momentum/pressure.d.ts.map +1 -0
- package/dist/core/stdlib/momentum/pressure.js +103 -0
- package/dist/core/stdlib/momentum/pressure.js.map +1 -0
- package/dist/core/stdlib/momentum/rates.d.ts +74 -0
- package/dist/core/stdlib/momentum/rates.d.ts.map +1 -0
- package/dist/core/stdlib/momentum/rates.js +134 -0
- package/dist/core/stdlib/momentum/rates.js.map +1 -0
- package/dist/core/stdlib/momentum/rsi.d.ts +21 -0
- package/dist/core/stdlib/momentum/rsi.d.ts.map +1 -0
- package/dist/core/stdlib/momentum/rsi.js +30 -0
- package/dist/core/stdlib/momentum/rsi.js.map +1 -0
- package/dist/core/stdlib/momentum/stochastic.d.ts +44 -0
- package/dist/core/stdlib/momentum/stochastic.d.ts.map +1 -0
- package/dist/core/stdlib/momentum/stochastic.js +97 -0
- package/dist/core/stdlib/momentum/stochastic.js.map +1 -0
- package/dist/core/stdlib/series/changes.d.ts +59 -0
- package/dist/core/stdlib/series/changes.d.ts.map +1 -0
- package/dist/core/stdlib/series/changes.js +129 -0
- package/dist/core/stdlib/series/changes.js.map +1 -0
- package/dist/core/stdlib/series/conditions.d.ts +34 -0
- package/dist/core/stdlib/series/conditions.d.ts.map +1 -0
- package/dist/core/stdlib/series/conditions.js +52 -0
- package/dist/core/stdlib/series/conditions.js.map +1 -0
- package/dist/core/stdlib/series/extremes.d.ts +29 -0
- package/dist/core/stdlib/series/extremes.d.ts.map +1 -0
- package/dist/core/stdlib/series/extremes.js +62 -0
- package/dist/core/stdlib/series/extremes.js.map +1 -0
- package/dist/core/stdlib/series/index.d.ts +9 -0
- package/dist/core/stdlib/series/index.d.ts.map +1 -0
- package/dist/core/stdlib/series/index.js +7 -0
- package/dist/core/stdlib/series/index.js.map +1 -0
- package/dist/core/stdlib/series/pivots.d.ts +25 -0
- package/dist/core/stdlib/series/pivots.d.ts.map +1 -0
- package/dist/core/stdlib/series/pivots.js +42 -0
- package/dist/core/stdlib/series/pivots.js.map +1 -0
- package/dist/core/stdlib/series/statistics.d.ts +64 -0
- package/dist/core/stdlib/series/statistics.d.ts.map +1 -0
- package/dist/core/stdlib/series/statistics.js +148 -0
- package/dist/core/stdlib/series/statistics.js.map +1 -0
- package/dist/core/stdlib/series/totals.d.ts +68 -0
- package/dist/core/stdlib/series/totals.d.ts.map +1 -0
- package/dist/core/stdlib/series/totals.js +115 -0
- package/dist/core/stdlib/series/totals.js.map +1 -0
- package/dist/core/stdlib/trend/directional.d.ts +69 -0
- package/dist/core/stdlib/trend/directional.d.ts.map +1 -0
- package/dist/core/stdlib/trend/directional.js +151 -0
- package/dist/core/stdlib/trend/directional.js.map +1 -0
- package/dist/core/stdlib/trend/index.d.ts +4 -0
- package/dist/core/stdlib/trend/index.d.ts.map +1 -0
- package/dist/core/stdlib/trend/index.js +4 -0
- package/dist/core/stdlib/trend/index.js.map +1 -0
- package/dist/core/stdlib/trend/psar.d.ts +33 -0
- package/dist/core/stdlib/trend/psar.d.ts.map +1 -0
- package/dist/core/stdlib/trend/psar.js +86 -0
- package/dist/core/stdlib/trend/psar.js.map +1 -0
- package/dist/core/stdlib/trend/supertrend.d.ts +30 -0
- package/dist/core/stdlib/trend/supertrend.d.ts.map +1 -0
- package/dist/core/stdlib/trend/supertrend.js +65 -0
- package/dist/core/stdlib/trend/supertrend.js.map +1 -0
- package/dist/core/stdlib/values/bar.d.ts +39 -0
- package/dist/core/stdlib/values/bar.d.ts.map +1 -0
- package/dist/core/stdlib/values/bar.js +33 -0
- package/dist/core/stdlib/values/bar.js.map +1 -0
- package/dist/core/stdlib/values/index.d.ts +11 -0
- package/dist/core/stdlib/values/index.d.ts.map +1 -0
- package/dist/core/stdlib/values/index.js +6 -0
- package/dist/core/stdlib/values/index.js.map +1 -0
- package/dist/core/stdlib/values/lookback.d.ts +83 -0
- package/dist/core/stdlib/values/lookback.d.ts.map +1 -0
- package/dist/core/stdlib/values/lookback.js +134 -0
- package/dist/core/stdlib/values/lookback.js.map +1 -0
- package/dist/core/stdlib/values/region.d.ts +55 -0
- package/dist/core/stdlib/values/region.d.ts.map +1 -0
- package/dist/core/stdlib/values/region.js +73 -0
- package/dist/core/stdlib/values/region.js.map +1 -0
- package/dist/core/stdlib/values/tail.d.ts +44 -0
- package/dist/core/stdlib/values/tail.d.ts.map +1 -0
- package/dist/core/stdlib/values/tail.js +23 -0
- package/dist/core/stdlib/values/tail.js.map +1 -0
- package/dist/core/stdlib/values/value.d.ts +64 -0
- package/dist/core/stdlib/values/value.d.ts.map +1 -0
- package/dist/core/stdlib/values/value.js +61 -0
- package/dist/core/stdlib/values/value.js.map +1 -0
- package/dist/core/stdlib/volatility/bands.d.ts +50 -0
- package/dist/core/stdlib/volatility/bands.d.ts.map +1 -0
- package/dist/core/stdlib/volatility/bands.js +101 -0
- package/dist/core/stdlib/volatility/bands.js.map +1 -0
- package/dist/core/stdlib/volatility/deviation.d.ts +43 -0
- package/dist/core/stdlib/volatility/deviation.d.ts.map +1 -0
- package/dist/core/stdlib/volatility/deviation.js +75 -0
- package/dist/core/stdlib/volatility/deviation.js.map +1 -0
- package/dist/core/stdlib/volatility/index.d.ts +6 -0
- package/dist/core/stdlib/volatility/index.d.ts.map +1 -0
- package/dist/core/stdlib/volatility/index.js +5 -0
- package/dist/core/stdlib/volatility/index.js.map +1 -0
- package/dist/core/stdlib/volatility/measures.d.ts +48 -0
- package/dist/core/stdlib/volatility/measures.d.ts.map +1 -0
- package/dist/core/stdlib/volatility/measures.js +73 -0
- package/dist/core/stdlib/volatility/measures.js.map +1 -0
- package/dist/core/stdlib/volatility/range.d.ts +69 -0
- package/dist/core/stdlib/volatility/range.d.ts.map +1 -0
- package/dist/core/stdlib/volatility/range.js +86 -0
- package/dist/core/stdlib/volatility/range.js.map +1 -0
- package/dist/core/stdlib/volume/accumulation.d.ts +61 -0
- package/dist/core/stdlib/volume/accumulation.d.ts.map +1 -0
- package/dist/core/stdlib/volume/accumulation.js +127 -0
- package/dist/core/stdlib/volume/accumulation.js.map +1 -0
- package/dist/core/stdlib/volume/flow.d.ts +60 -0
- package/dist/core/stdlib/volume/flow.d.ts.map +1 -0
- package/dist/core/stdlib/volume/flow.js +125 -0
- package/dist/core/stdlib/volume/flow.js.map +1 -0
- package/dist/core/stdlib/volume/index.d.ts +5 -0
- package/dist/core/stdlib/volume/index.d.ts.map +1 -0
- package/dist/core/stdlib/volume/index.js +4 -0
- package/dist/core/stdlib/volume/index.js.map +1 -0
- package/dist/core/stdlib/volume/weighted.d.ts +52 -0
- package/dist/core/stdlib/volume/weighted.d.ts.map +1 -0
- package/dist/core/stdlib/volume/weighted.js +64 -0
- package/dist/core/stdlib/volume/weighted.js.map +1 -0
- package/dist/core/version/version.generated.d.ts +2 -2
- package/dist/core/version/version.generated.d.ts.map +1 -1
- package/dist/core/version/version.generated.js +2 -2
- package/dist/core/version/version.generated.js.map +1 -1
- package/dist/editor/complete.d.ts +40 -0
- package/dist/editor/complete.d.ts.map +1 -0
- package/dist/editor/complete.js +206 -0
- package/dist/editor/complete.js.map +1 -0
- package/dist/editor/diagnose.d.ts +18 -0
- package/dist/editor/diagnose.d.ts.map +1 -0
- package/dist/editor/diagnose.js +70 -0
- package/dist/editor/diagnose.js.map +1 -0
- package/dist/editor/format.d.ts +11 -0
- package/dist/editor/format.d.ts.map +1 -0
- package/dist/editor/format.js +50 -0
- package/dist/editor/format.js.map +1 -0
- package/dist/editor/highlight.d.ts +28 -0
- package/dist/editor/highlight.d.ts.map +1 -0
- package/dist/editor/highlight.js +65 -0
- package/dist/editor/highlight.js.map +1 -0
- package/dist/editor/hover.d.ts +40 -0
- package/dist/editor/hover.d.ts.map +1 -0
- package/dist/editor/hover.js +147 -0
- package/dist/editor/hover.js.map +1 -0
- package/dist/editor/index.d.ts +60 -0
- package/dist/editor/index.d.ts.map +1 -0
- package/dist/editor/index.js +7 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/editor/kinds.d.ts +27 -0
- package/dist/editor/kinds.d.ts.map +1 -0
- package/dist/editor/kinds.js +118 -0
- package/dist/editor/kinds.js.map +1 -0
- package/dist/editor/layout.d.ts +47 -0
- package/dist/editor/layout.d.ts.map +1 -0
- package/dist/editor/layout.js +135 -0
- package/dist/editor/layout.js.map +1 -0
- package/dist/editor/manifest.d.ts +47 -0
- package/dist/editor/manifest.d.ts.map +1 -0
- package/dist/editor/manifest.js +93 -0
- package/dist/editor/manifest.js.map +1 -0
- package/dist/editor/reading.d.ts +41 -0
- package/dist/editor/reading.d.ts.map +1 -0
- package/dist/editor/reading.js +51 -0
- package/dist/editor/reading.js.map +1 -0
- package/dist/editor/scan.d.ts +26 -0
- package/dist/editor/scan.d.ts.map +1 -0
- package/dist/editor/scan.js +139 -0
- package/dist/editor/scan.js.map +1 -0
- package/dist/editor/scope.d.ts +19 -0
- package/dist/editor/scope.d.ts.map +1 -0
- package/dist/editor/scope.js +99 -0
- package/dist/editor/scope.js.map +1 -0
- package/dist/editor/signature.d.ts +38 -0
- package/dist/editor/signature.d.ts.map +1 -0
- package/dist/editor/signature.js +112 -0
- package/dist/editor/signature.js.map +1 -0
- package/dist/editor/site.d.ts +46 -0
- package/dist/editor/site.d.ts.map +1 -0
- package/dist/editor/site.js +184 -0
- package/dist/editor/site.js.map +1 -0
- package/dist/editor/spacing.d.ts +29 -0
- package/dist/editor/spacing.d.ts.map +1 -0
- package/dist/editor/spacing.js +116 -0
- package/dist/editor/spacing.js.map +1 -0
- package/package.json +66 -15
- package/spec/errors.json +522 -183
- package/src/adapters/charts/alerts.ts +116 -0
- package/src/adapters/charts/bars.ts +63 -0
- package/src/adapters/charts/candles.ts +137 -0
- package/src/adapters/charts/colours.ts +113 -0
- package/src/adapters/charts/columns.ts +99 -0
- package/src/adapters/charts/contract.ts +320 -0
- package/src/adapters/charts/descriptor.ts +199 -0
- package/src/adapters/charts/drawings.ts +213 -0
- package/src/adapters/charts/errors.ts +45 -0
- package/src/adapters/charts/fields.ts +74 -0
- package/src/adapters/charts/fills.ts +71 -0
- package/src/adapters/charts/index.ts +78 -0
- package/src/adapters/charts/levels.ts +92 -0
- package/src/adapters/charts/markers.ts +119 -0
- package/src/adapters/charts/paint.ts +101 -0
- package/src/adapters/charts/plots.ts +185 -0
- package/src/adapters/charts/produced.ts +68 -0
- package/src/adapters/charts/requests.ts +357 -0
- package/src/adapters/charts/run.ts +327 -0
- package/src/adapters/charts/settings.ts +273 -0
- package/src/adapters/charts/surfaces.ts +255 -0
- package/src/adapters/charts/tables.ts +243 -0
- package/src/adapters/codemirror/commands.ts +53 -0
- package/src/adapters/codemirror/completion.ts +74 -0
- package/src/adapters/codemirror/contract.ts +156 -0
- package/src/adapters/codemirror/index.ts +66 -0
- package/src/adapters/codemirror/lint.ts +66 -0
- package/src/adapters/codemirror/positions.ts +79 -0
- package/src/adapters/codemirror/stream.ts +87 -0
- package/src/adapters/codemirror/tokens.ts +64 -0
- package/src/adapters/codemirror/tooltips.ts +113 -0
- package/src/core/accounting/charges.ts +452 -0
- package/src/core/accounting/equity.ts +276 -0
- package/src/core/accounting/index.ts +49 -0
- package/src/core/accounting/markers.ts +95 -0
- package/src/core/accounting/monthly.ts +137 -0
- package/src/core/accounting/report.ts +89 -0
- package/src/core/accounting/shapes.ts +73 -0
- package/src/core/accounting/statistics.ts +350 -0
- package/src/core/accounting/trades.ts +313 -0
- package/src/core/backtest/compare.ts +244 -0
- package/src/core/backtest/declaration.ts +97 -0
- package/src/core/backtest/drive.ts +364 -0
- package/src/core/backtest/index.ts +52 -0
- package/src/core/backtest/range.ts +137 -0
- package/src/core/backtest/record.ts +341 -0
- package/src/core/backtest/replay.ts +158 -0
- package/src/core/backtest/resting.ts +125 -0
- package/src/core/backtest/settings.ts +280 -0
- package/src/core/backtest/simulate.ts +304 -0
- package/src/core/catalogue/catalogue.generated.ts +23 -9
- package/src/core/catalogue/values.generated.ts +14 -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 +70 -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-prose.generated.ts +367 -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 +149 -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 +220 -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 +76 -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 +118 -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 +212 -6
- package/src/core/parse/expressions.ts +1 -1
- package/src/core/parse/names.ts +29 -2
- package/src/core/stdlib/averages/exponential.ts +119 -0
- package/src/core/stdlib/averages/index.ts +45 -0
- package/src/core/stdlib/averages/select.ts +71 -0
- package/src/core/stdlib/averages/shaped.ts +161 -0
- package/src/core/stdlib/averages/simple.ts +139 -0
- package/src/core/stdlib/calendar/civil.ts +89 -0
- package/src/core/stdlib/calendar/fields.ts +124 -0
- package/src/core/stdlib/calendar/format.ts +71 -0
- package/src/core/stdlib/calendar/index.ts +15 -0
- package/src/core/stdlib/calendar/zone.ts +161 -0
- package/src/core/stdlib/index.ts +400 -0
- package/src/core/stdlib/maths/arithmetic.ts +74 -0
- package/src/core/stdlib/maths/elementary.ts +124 -0
- package/src/core/stdlib/maths/index.ts +43 -0
- package/src/core/stdlib/maths/rounding.ts +78 -0
- package/src/core/stdlib/momentum/convergence.ts +82 -0
- package/src/core/stdlib/momentum/index.ts +47 -0
- package/src/core/stdlib/momentum/pressure.ts +141 -0
- package/src/core/stdlib/momentum/rates.ts +188 -0
- package/src/core/stdlib/momentum/rsi.ts +49 -0
- package/src/core/stdlib/momentum/stochastic.ts +147 -0
- package/src/core/stdlib/series/changes.ts +177 -0
- package/src/core/stdlib/series/conditions.ts +74 -0
- package/src/core/stdlib/series/extremes.ts +92 -0
- package/src/core/stdlib/series/index.ts +83 -0
- package/src/core/stdlib/series/pivots.ts +63 -0
- package/src/core/stdlib/series/statistics.ts +207 -0
- package/src/core/stdlib/series/totals.ts +164 -0
- package/src/core/stdlib/trend/directional.ts +196 -0
- package/src/core/stdlib/trend/index.ts +13 -0
- package/src/core/stdlib/trend/psar.ts +131 -0
- package/src/core/stdlib/trend/supertrend.ts +100 -0
- package/src/core/stdlib/values/bar.ts +54 -0
- package/src/core/stdlib/values/index.ts +14 -0
- package/src/core/stdlib/values/lookback.ts +198 -0
- package/src/core/stdlib/values/region.ts +86 -0
- package/src/core/stdlib/values/tail.ts +58 -0
- package/src/core/stdlib/values/value.ts +82 -0
- package/src/core/stdlib/volatility/bands.ts +178 -0
- package/src/core/stdlib/volatility/deviation.ts +111 -0
- package/src/core/stdlib/volatility/index.ts +48 -0
- package/src/core/stdlib/volatility/measures.ts +96 -0
- package/src/core/stdlib/volatility/range.ts +143 -0
- package/src/core/stdlib/volume/accumulation.ts +152 -0
- package/src/core/stdlib/volume/flow.ts +173 -0
- package/src/core/stdlib/volume/index.ts +43 -0
- package/src/core/stdlib/volume/weighted.ts +101 -0
- package/src/core/version/version.generated.ts +2 -2
- package/src/editor/complete.ts +266 -0
- package/src/editor/diagnose.ts +71 -0
- package/src/editor/format.ts +85 -0
- package/src/editor/highlight.ts +110 -0
- package/src/editor/hover.ts +199 -0
- package/src/editor/index.ts +65 -0
- package/src/editor/kinds.ts +157 -0
- package/src/editor/layout.ts +189 -0
- package/src/editor/manifest.ts +119 -0
- package/src/editor/reading.ts +69 -0
- package/src/editor/scan.ts +162 -0
- package/src/editor/scope.ts +122 -0
- package/src/editor/signature.ts +150 -0
- package/src/editor/site.ts +233 -0
- package/src/editor/spacing.ts +132 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What is left to reduce and which side reduces it, `stdlib.md` 17.1 and 17.2.
|
|
3
|
+
*
|
|
4
|
+
* **Both questions are about a part rather than about the leg**, and the leg is
|
|
5
|
+
* the case of a part that no tag names. A leg can be long under one tag and
|
|
6
|
+
* short under another, and then its net answers neither question for either of
|
|
7
|
+
* them: `close(tag)` taking its side from the net sent an order that added to
|
|
8
|
+
* the part it was told to flatten, and a count taken from the net did not see
|
|
9
|
+
* the close already on its way to that part.
|
|
10
|
+
*
|
|
11
|
+
* **What is available to reduce is the settled position less everything already
|
|
12
|
+
* working against it.** A position is folded from settled fills and from
|
|
13
|
+
* nothing else (17.8), which is right and is what makes this file necessary: an
|
|
14
|
+
* order the destination has not answered has filled nothing, so the leg still
|
|
15
|
+
* reads what it held before that order left. Measured against that alone, every
|
|
16
|
+
* reducing order sends the whole position again.
|
|
17
|
+
*
|
|
18
|
+
* **The scope is the run and the position, not the bar.** That correction is
|
|
19
|
+
* the whole of this file's history and it was arrived at twice. The first
|
|
20
|
+
* reading counted the orders of one call, and `close()` twice on one bar took a
|
|
21
|
+
* leg holding three long to three short. The second counted the orders of one
|
|
22
|
+
* bar, and the same two closes one bar apart did the same thing: the bar's own
|
|
23
|
+
* record was emptied when the bar index changed, so bar three asked what the leg
|
|
24
|
+
* held, was told three, and sent three. With a destination slower than the chart
|
|
25
|
+
* the plainest exit a strategy can write,
|
|
26
|
+
*
|
|
27
|
+
* if bar.index > 0 and pos.size > 0
|
|
28
|
+
* close()
|
|
29
|
+
*
|
|
30
|
+
* sent one close per bar for the length of the run, and a flat exit became a
|
|
31
|
+
* short position that grew without limit. The script was not wrong: `pos.size`
|
|
32
|
+
* is folded from settled fills and correctly still read three.
|
|
33
|
+
*
|
|
34
|
+
* So the record is not the call's and not the bar's. It is the ledger's, which
|
|
35
|
+
* is the run's, and the ledger already holds it: a row carries a status and a
|
|
36
|
+
* filled quantity, and an order the destination still has is exactly a row that
|
|
37
|
+
* is neither terminal nor fully filled (`row.ts`, `workingUnits`). A bar-scoped
|
|
38
|
+
* rule is the special case of this one where nothing has been answered yet, so
|
|
39
|
+
* this subsumes it rather than sitting beside it, and the bar keeps no record of
|
|
40
|
+
* its own.
|
|
41
|
+
*
|
|
42
|
+
* Four cases decide the shape, and each is a case a strategy meets:
|
|
43
|
+
*
|
|
44
|
+
* - **A partial fill.** Three sold with one filled leaves two working, not
|
|
45
|
+
* three and not none, because the one that filled has already moved the leg.
|
|
46
|
+
* - **A rejection.** The row ends, the working quantity is released, and the
|
|
47
|
+
* script may close again. That is correct, and it is why a frame matters.
|
|
48
|
+
* - **A destination that never answers.** The strategy cannot close again,
|
|
49
|
+
* which is right: it already has a close working, and a second one would sell
|
|
50
|
+
* a position it is already selling. `cancel` is the way out, and it works
|
|
51
|
+
* because the cancellation comes back as a frame that ends the row.
|
|
52
|
+
* - **An entry working against the same leg.** An unsettled `buy` adds nothing
|
|
53
|
+
* to what a close may reduce. Nothing has settled, so there is nothing extra
|
|
54
|
+
* to close, and counting it would send a close for a position that may never
|
|
55
|
+
* exist.
|
|
56
|
+
*
|
|
57
|
+
* **In units, because a position is.** A quantity the script stated is in the
|
|
58
|
+
* declaration's own unit (`host-interface.md` 7.1), so it is a number this file
|
|
59
|
+
* can read only where that unit is units. In lots, cash or an equity percent
|
|
60
|
+
* the two are different kinds of number and the lot size that would join them
|
|
61
|
+
* is the fact OS7005 is deferred on.
|
|
62
|
+
*
|
|
63
|
+
* **What is done with an order it cannot read is the only reading that cannot
|
|
64
|
+
* cross zero: that the order took the whole of the part.** Counted as nothing,
|
|
65
|
+
* `close(qty = 1)` in lots followed by a bare close on the same bar sent the
|
|
66
|
+
* position a second time and the leg ended short, which is the defect this file
|
|
67
|
+
* exists for wearing a different unit. Counted as everything, the second close
|
|
68
|
+
* sends nothing, which leaves the strategy holding a position it may believe it
|
|
69
|
+
* closed. That is the worse-of-two choice `stdlib.md` 17.1 already makes: an
|
|
70
|
+
* order that crosses zero is the failure the sentence is unconditional about,
|
|
71
|
+
* and a close that sends nothing is the idempotence the same section describes.
|
|
72
|
+
*
|
|
73
|
+
* So what is left carries whether it was counted or assumed. The mapping reads
|
|
74
|
+
* the number, because sending nothing is safe either way. The refusal reads
|
|
75
|
+
* both, because a refusal may only name a number it measured: an assumed zero
|
|
76
|
+
* is not a fact about the leg and OS7017 is not raised on one.
|
|
77
|
+
*/
|
|
78
|
+
import type { OrderSide } from './intent.js';
|
|
79
|
+
import type { LedgerRow } from './row.js';
|
|
80
|
+
/**
|
|
81
|
+
* The side that reduces a position, or nothing when there is none to reduce.
|
|
82
|
+
*
|
|
83
|
+
* One fact with two readers. The mapping uses it to give a close its direction,
|
|
84
|
+
* and the arithmetic below uses it to tell an order that is on its way out of
|
|
85
|
+
* the position from one that is on its way in, which is the difference between
|
|
86
|
+
* a reduction that is still working and an entry that holds nothing.
|
|
87
|
+
*/
|
|
88
|
+
export declare function closingSide(size: number): OrderSide | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* What the arithmetic below needs: the leg and the rows of its own ledger.
|
|
91
|
+
*
|
|
92
|
+
* Narrower than the context the mapping is given, so that this file states what
|
|
93
|
+
* it reads rather than importing the whole of it.
|
|
94
|
+
*/
|
|
95
|
+
export interface Closing {
|
|
96
|
+
/** The leg's net position in units, folded from settled fills. */
|
|
97
|
+
size(): number;
|
|
98
|
+
/** The rows this strategy placed, newest last. */
|
|
99
|
+
rows(): readonly LedgerRow[];
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The side that reduces the part a call names, or nothing where it holds none.
|
|
103
|
+
*
|
|
104
|
+
* **The direction of a close comes from the part it was told to flatten**, and
|
|
105
|
+
* taking it from the leg is how a call named `close` opened a position: a leg
|
|
106
|
+
* holding ten long under one tag and four short under another is a net six
|
|
107
|
+
* long, so `close(tag)` on the short part was answered with a sell, which took
|
|
108
|
+
* that part to eight short and cut the other one to six. `stdlib.md` 17.2 says
|
|
109
|
+
* the call flattens the part of the position carrying one tag, and says of the
|
|
110
|
+
* reading that takes the leg's net that it would let close open a position.
|
|
111
|
+
*
|
|
112
|
+
* A part whose own rows have netted to nothing has no side and the call sends
|
|
113
|
+
* nothing, which is 17.2's idempotence and the same answer a flat leg gives a
|
|
114
|
+
* bare close.
|
|
115
|
+
*/
|
|
116
|
+
export declare function closingFor(ctx: Closing, tag: string | null): OrderSide | undefined;
|
|
117
|
+
/** What one part of the leg can still close, and whether that was measured. */
|
|
118
|
+
export interface Closable {
|
|
119
|
+
/** The units a close may still send against it. */
|
|
120
|
+
readonly units: number;
|
|
121
|
+
/** Whether every order counted against it stated a quantity in units. */
|
|
122
|
+
readonly counted: boolean;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* What a `close` can still close, in units, whether or not it names a quantity.
|
|
126
|
+
*
|
|
127
|
+
* The whole leg where the call names no tag, and the part that tag entered
|
|
128
|
+
* where it names one, less what is already working against it. Zero while the
|
|
129
|
+
* leg is flat, zero for a tag whose rows have netted to nothing, and zero once
|
|
130
|
+
* the orders already sent have the whole of it going.
|
|
131
|
+
*
|
|
132
|
+
* **A part on the leg's own side is bounded by the leg**, so that closing a
|
|
133
|
+
* part can never take the leg through zero: the part is what the call names,
|
|
134
|
+
* and the leg is what the order comes out of.
|
|
135
|
+
*
|
|
136
|
+
* **A part on the other side is not**, and bounding it there was the second
|
|
137
|
+
* half of taking a direction from the net. Closing a short part under a long
|
|
138
|
+
* leg is a buy, which moves the leg away from zero rather than towards it, so
|
|
139
|
+
* there is nothing for the leg's own number to bound: measured against it, a
|
|
140
|
+
* part holding ten short on a leg netting two long was offered two, and on a
|
|
141
|
+
* leg netting nothing at all it was offered nothing. What that order may
|
|
142
|
+
* actually send is still bounded per position by what has settled there
|
|
143
|
+
* (`holdings.ts`), so a part whose reference has already returned to zero sends
|
|
144
|
+
* nothing rather than opening it again.
|
|
145
|
+
*
|
|
146
|
+
* Both readers ask this one question. The quantity a script states is refused
|
|
147
|
+
* against this number (OS7017) and the quantity the engine works out for itself
|
|
148
|
+
* is this number. Two readings of what a part holds would be one fact in two
|
|
149
|
+
* files, and the refusal would be about a quantity the mapping was not going to
|
|
150
|
+
* send.
|
|
151
|
+
*/
|
|
152
|
+
export declare function closable(ctx: Closing, tag: string | null): Closable;
|
|
153
|
+
/** What a close can still close, for the mapping, which sends a number. */
|
|
154
|
+
export declare function closableUnits(ctx: Closing, tag: string | null): number;
|
|
155
|
+
//# sourceMappingURL=closable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closable.d.ts","sourceRoot":"","sources":["../../../../src/core/engine/ledger/closable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAI/D;AAED;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,kEAAkE;IAClE,IAAI,IAAI,MAAM,CAAC;IACf,kDAAkD;IAClD,IAAI,IAAI,SAAS,SAAS,EAAE,CAAC;CAC9B;AAyBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,CAElF;AAED,+EAA+E;AAC/E,MAAM,WAAW,QAAQ;IACvB,mDAAmD;IACnD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAoED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAWnE;AAED,2EAA2E;AAC3E,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAEtE"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { isTerminal, workingUnits } from './row.js';
|
|
2
|
+
/**
|
|
3
|
+
* The side that reduces a position, or nothing when there is none to reduce.
|
|
4
|
+
*
|
|
5
|
+
* One fact with two readers. The mapping uses it to give a close its direction,
|
|
6
|
+
* and the arithmetic below uses it to tell an order that is on its way out of
|
|
7
|
+
* the position from one that is on its way in, which is the difference between
|
|
8
|
+
* a reduction that is still working and an entry that holds nothing.
|
|
9
|
+
*/
|
|
10
|
+
export function closingSide(size) {
|
|
11
|
+
if (size > 0)
|
|
12
|
+
return 'sell';
|
|
13
|
+
if (size < 0)
|
|
14
|
+
return 'buy';
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
/** The settled units held under one tag, signed the way a position is. */
|
|
18
|
+
function heldUnder(ctx, tag) {
|
|
19
|
+
let held = 0;
|
|
20
|
+
for (const row of ctx.rows()) {
|
|
21
|
+
if (row.tag !== tag)
|
|
22
|
+
continue;
|
|
23
|
+
held += row.side === 'buy' ? row.filledQty : -row.filledQty;
|
|
24
|
+
}
|
|
25
|
+
return held;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* What the part a call names holds, signed the way a position is.
|
|
29
|
+
*
|
|
30
|
+
* The leg where the call names no tag, and the settled quantity of that tag's
|
|
31
|
+
* own rows where it names one. **One function because it is one question**, and
|
|
32
|
+
* every number this file produces about a part is taken from it: how much is
|
|
33
|
+
* there to close, which side reduces it, and how much of it an order the engine
|
|
34
|
+
* cannot read is assumed to have taken.
|
|
35
|
+
*/
|
|
36
|
+
function holdingOf(ctx, tag) {
|
|
37
|
+
return tag === null ? ctx.size() : heldUnder(ctx, tag);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The side that reduces the part a call names, or nothing where it holds none.
|
|
41
|
+
*
|
|
42
|
+
* **The direction of a close comes from the part it was told to flatten**, and
|
|
43
|
+
* taking it from the leg is how a call named `close` opened a position: a leg
|
|
44
|
+
* holding ten long under one tag and four short under another is a net six
|
|
45
|
+
* long, so `close(tag)` on the short part was answered with a sell, which took
|
|
46
|
+
* that part to eight short and cut the other one to six. `stdlib.md` 17.2 says
|
|
47
|
+
* the call flattens the part of the position carrying one tag, and says of the
|
|
48
|
+
* reading that takes the leg's net that it would let close open a position.
|
|
49
|
+
*
|
|
50
|
+
* A part whose own rows have netted to nothing has no side and the call sends
|
|
51
|
+
* nothing, which is 17.2's idempotence and the same answer a flat leg gives a
|
|
52
|
+
* bare close.
|
|
53
|
+
*/
|
|
54
|
+
export function closingFor(ctx, tag) {
|
|
55
|
+
return closingSide(holdingOf(ctx, tag));
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The units already working against the position, across the whole run.
|
|
59
|
+
*
|
|
60
|
+
* Every reduction comes out of the leg, and a reduction naming a tag comes out
|
|
61
|
+
* of that tag as well, so the leg is asked with no tag and a part is asked with
|
|
62
|
+
* its own.
|
|
63
|
+
*
|
|
64
|
+
* **Only an order on the side that reduces what the leg holds now**, and
|
|
65
|
+
* **every** order on that side. A row records what it reduced at the moment it
|
|
66
|
+
* was sent, and a leg that has changed sign since is being reduced from the
|
|
67
|
+
* other side: an order still working on the old side is adding to the leg
|
|
68
|
+
* rather than taking from it, and subtracting it would leave a close sending
|
|
69
|
+
* less than there is to close. The same sentence read the other way is the
|
|
70
|
+
* half that was missing. An order recorded as adding to a position, on a leg
|
|
71
|
+
* that has since gone the other way, is a reduction now whatever it was then,
|
|
72
|
+
* and leaving it out let a close be sized against a position an entry was
|
|
73
|
+
* already coming to take off: `buy(qty = 5)` unanswered on a leg the sells
|
|
74
|
+
* after it took short offered a close the whole twelve, five of which were
|
|
75
|
+
* already on their way.
|
|
76
|
+
*
|
|
77
|
+
* **The side is the part's own**, which is the leg's where no tag names one. A
|
|
78
|
+
* part can sit on the side its leg is not on, and then the orders that reduce
|
|
79
|
+
* it are the ones the leg's net calls additions: measured from the leg, the
|
|
80
|
+
* count for a short part under a long leg counted the sells that were adding to
|
|
81
|
+
* it and missed the buys that were taking it off.
|
|
82
|
+
*
|
|
83
|
+
* `holdings.ts` makes the same reading per position reference, and the two
|
|
84
|
+
* agree by construction: what a close may send across the leg is never more
|
|
85
|
+
* than the positions on that side can give it.
|
|
86
|
+
*/
|
|
87
|
+
function committed(ctx, tag) {
|
|
88
|
+
const held = holdingOf(ctx, tag);
|
|
89
|
+
const side = closingSide(held);
|
|
90
|
+
if (side === undefined)
|
|
91
|
+
return { units: 0, counted: true };
|
|
92
|
+
let units = 0;
|
|
93
|
+
let counted = true;
|
|
94
|
+
for (const row of ctx.rows()) {
|
|
95
|
+
if (row.side !== side || isTerminal(row.status))
|
|
96
|
+
continue;
|
|
97
|
+
const reduces = row.reduces;
|
|
98
|
+
if (reduces !== null) {
|
|
99
|
+
if (tag !== null && reduces.part !== tag)
|
|
100
|
+
continue;
|
|
101
|
+
const working = workingUnits(row);
|
|
102
|
+
if (working === 0)
|
|
103
|
+
continue;
|
|
104
|
+
units += working;
|
|
105
|
+
counted = counted && reduces.counted;
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
// An order that was an entry when it left. Its own tag is what names it,
|
|
109
|
+
// because a reduction's `part` is the tag a close named and an entry named
|
|
110
|
+
// no part of anything.
|
|
111
|
+
if (tag !== null && row.tag !== tag)
|
|
112
|
+
continue;
|
|
113
|
+
if (row.units === null) {
|
|
114
|
+
// A quantity in the declaration's own unit, working against this part and
|
|
115
|
+
// unreadable as a number of units. Taken to cover the whole of what is
|
|
116
|
+
// there, which is the reading `stdlib.md` 17.1 already makes for the
|
|
117
|
+
// other order it cannot read: a close that sends nothing over an order
|
|
118
|
+
// that crosses zero.
|
|
119
|
+
units += Math.abs(held);
|
|
120
|
+
counted = false;
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
units += Math.max(0, row.units - row.filledQty);
|
|
124
|
+
}
|
|
125
|
+
return { units, counted };
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* What a `close` can still close, in units, whether or not it names a quantity.
|
|
129
|
+
*
|
|
130
|
+
* The whole leg where the call names no tag, and the part that tag entered
|
|
131
|
+
* where it names one, less what is already working against it. Zero while the
|
|
132
|
+
* leg is flat, zero for a tag whose rows have netted to nothing, and zero once
|
|
133
|
+
* the orders already sent have the whole of it going.
|
|
134
|
+
*
|
|
135
|
+
* **A part on the leg's own side is bounded by the leg**, so that closing a
|
|
136
|
+
* part can never take the leg through zero: the part is what the call names,
|
|
137
|
+
* and the leg is what the order comes out of.
|
|
138
|
+
*
|
|
139
|
+
* **A part on the other side is not**, and bounding it there was the second
|
|
140
|
+
* half of taking a direction from the net. Closing a short part under a long
|
|
141
|
+
* leg is a buy, which moves the leg away from zero rather than towards it, so
|
|
142
|
+
* there is nothing for the leg's own number to bound: measured against it, a
|
|
143
|
+
* part holding ten short on a leg netting two long was offered two, and on a
|
|
144
|
+
* leg netting nothing at all it was offered nothing. What that order may
|
|
145
|
+
* actually send is still bounded per position by what has settled there
|
|
146
|
+
* (`holdings.ts`), so a part whose reference has already returned to zero sends
|
|
147
|
+
* nothing rather than opening it again.
|
|
148
|
+
*
|
|
149
|
+
* Both readers ask this one question. The quantity a script states is refused
|
|
150
|
+
* against this number (OS7017) and the quantity the engine works out for itself
|
|
151
|
+
* is this number. Two readings of what a part holds would be one fact in two
|
|
152
|
+
* files, and the refusal would be about a quantity the mapping was not going to
|
|
153
|
+
* send.
|
|
154
|
+
*/
|
|
155
|
+
export function closable(ctx, tag) {
|
|
156
|
+
const spent = committed(ctx, null);
|
|
157
|
+
const leg = Math.max(0, Math.abs(ctx.size()) - spent.units);
|
|
158
|
+
if (tag === null)
|
|
159
|
+
return { units: leg, counted: spent.counted };
|
|
160
|
+
const held = heldUnder(ctx, tag);
|
|
161
|
+
const own = committed(ctx, tag);
|
|
162
|
+
const part = Math.max(0, Math.abs(held) - own.units);
|
|
163
|
+
if (Math.sign(held) !== Math.sign(ctx.size()))
|
|
164
|
+
return { units: part, counted: own.counted };
|
|
165
|
+
return part <= leg
|
|
166
|
+
? { units: part, counted: own.counted }
|
|
167
|
+
: { units: leg, counted: spent.counted };
|
|
168
|
+
}
|
|
169
|
+
/** What a close can still close, for the mapping, which sends a number. */
|
|
170
|
+
export function closableUnits(ctx, tag) {
|
|
171
|
+
return closable(ctx, tag).units;
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=closable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closable.js","sourceRoot":"","sources":["../../../../src/core/engine/ledger/closable.ts"],"names":[],"mappings":"AA8EA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGpD;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,IAAI,IAAI,GAAG,CAAC;QAAE,OAAO,MAAM,CAAC;IAC5B,IAAI,IAAI,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAC3B,OAAO,SAAS,CAAC;AACnB,CAAC;AAeD,0EAA0E;AAC1E,SAAS,SAAS,CAAC,GAAY,EAAE,GAAW;IAC1C,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;QAC7B,IAAI,GAAG,CAAC,GAAG,KAAK,GAAG;YAAE,SAAS;QAC9B,IAAI,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC;IAC9D,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,SAAS,CAAC,GAAY,EAAE,GAAkB;IACjD,OAAO,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,UAAU,CAAC,GAAY,EAAE,GAAkB;IACzD,OAAO,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAC1C,CAAC;AAUD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,SAAS,SAAS,CAAC,GAAY,EAAE,GAAkB;IACjD,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACjC,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3D,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,KAAK,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;QAC7B,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,SAAS;QAC1D,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;QAC5B,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,GAAG;gBAAE,SAAS;YACnD,MAAM,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;YAClC,IAAI,OAAO,KAAK,CAAC;gBAAE,SAAS;YAC5B,KAAK,IAAI,OAAO,CAAC;YACjB,OAAO,GAAG,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;YACrC,SAAS;QACX,CAAC;QACD,yEAAyE;QACzE,2EAA2E;QAC3E,uBAAuB;QACvB,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,CAAC,GAAG,KAAK,GAAG;YAAE,SAAS;QAC9C,IAAI,GAAG,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACvB,0EAA0E;YAC1E,uEAAuE;YACvE,qEAAqE;YACrE,uEAAuE;YACvE,qBAAqB;YACrB,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACxB,OAAO,GAAG,KAAK,CAAC;YAChB,SAAS;QACX,CAAC;QACD,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC5B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAY,EAAE,GAAkB;IACvD,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACnC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IAC5D,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;IAChE,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACjC,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAChC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;IACrD,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;IAC5F,OAAO,IAAI,IAAI,GAAG;QAChB,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE;QACvC,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;AAC7C,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,aAAa,CAAC,GAAY,EAAE,GAAkB;IAC5D,OAAO,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a leg holds, one entry per position reference, including what is still
|
|
3
|
+
* working, `stdlib.md` 17.1 and 17.7.
|
|
4
|
+
*
|
|
5
|
+
* **This file answers which position an order is sent against.** Three rounds
|
|
6
|
+
* corrected how much a reducing order may send, against the call, against the
|
|
7
|
+
* bar and then against the run. None of them asked which position reference an
|
|
8
|
+
* order carries, and the mapping was still deciding it from `ctx.size()`, which
|
|
9
|
+
* is the leg's net folded from settled fills. That number cannot answer the
|
|
10
|
+
* question, and the plainest script there is shows why:
|
|
11
|
+
*
|
|
12
|
+
* if bar.index == 0
|
|
13
|
+
* buy(qty = 6)
|
|
14
|
+
* if bar.index == 1
|
|
15
|
+
* sell(qty = 9)
|
|
16
|
+
*
|
|
17
|
+
* With the destination silent the leg's settled net is zero on bar one, so the
|
|
18
|
+
* sell was not seen as opposing anything and went on the reference the buy was
|
|
19
|
+
* already on. Both filled, and reference 1 opened six long and settled three
|
|
20
|
+
* short: one reference holding both signs, which is the one failure 17.1 names,
|
|
21
|
+
* because a fill arriving late can no longer say which position it settled.
|
|
22
|
+
*
|
|
23
|
+
* **So a reference is measured by what is on it, settled and working
|
|
24
|
+
* together.** An order the destination has not answered has moved no position
|
|
25
|
+
* figure, and the ledger's rows are where it is visible (`row.ts`). A reference
|
|
26
|
+
* with six units of buy still to come is a long position whether or not any of
|
|
27
|
+
* it has settled, and an opposing order has to take those six off it before it
|
|
28
|
+
* opens anything new: otherwise nothing can ever bring that reference back to
|
|
29
|
+
* zero, which is 17.7's sentence about how a position ends.
|
|
30
|
+
*
|
|
31
|
+
* **Two numbers, because two questions are asked and they are not the same
|
|
32
|
+
* question.**
|
|
33
|
+
*
|
|
34
|
+
* - `units` is what an opposing order may take, and it counts what is working.
|
|
35
|
+
* The order is being sent either way, at the size the script wrote; the only
|
|
36
|
+
* thing being decided is which reference each unit lands on, and the answer
|
|
37
|
+
* that lets every reference return to zero is the one that puts the units
|
|
38
|
+
* where the quantity they cancel is.
|
|
39
|
+
* - `settled` is what a close may send, and it counts only what has settled,
|
|
40
|
+
* less what is already working against it. A close chooses its own quantity,
|
|
41
|
+
* so a close counting a working entry would sell units that may never exist.
|
|
42
|
+
* That is `closable.ts`'s rule, and this is the same rule read per reference
|
|
43
|
+
* instead of per leg.
|
|
44
|
+
*
|
|
45
|
+
* **What this costs, stated rather than discovered.** An entry that opposes an
|
|
46
|
+
* unanswered entry is sent against it, so if the first order is rejected and
|
|
47
|
+
* the second fills, that reference settles on the side it did not open on. No
|
|
48
|
+
* engine avoids that without holding an order back until the destination
|
|
49
|
+
* answers, which is an engine that stops trading when a destination is slow.
|
|
50
|
+
* What 17.1 asks for is kept either way: every order names exactly one
|
|
51
|
+
* position, so every fill, however late, says which position it settled.
|
|
52
|
+
*/
|
|
53
|
+
import type { OrderSide } from './intent.js';
|
|
54
|
+
import type { LedgerRow } from './row.js';
|
|
55
|
+
/** One position reference a leg holds, and what may still be done to it. */
|
|
56
|
+
export interface Holding {
|
|
57
|
+
readonly ref: number;
|
|
58
|
+
/** The side it is on: `buy` for a long position, `sell` for a short one. */
|
|
59
|
+
readonly side: OrderSide;
|
|
60
|
+
/**
|
|
61
|
+
* The units an opposing order may take from it, settled and working
|
|
62
|
+
* together, or absent where the engine cannot read one of its quantities.
|
|
63
|
+
*
|
|
64
|
+
* Absent is not zero. It means the reference holds something on `side` whose
|
|
65
|
+
* size is stated in the declaration's own unit, which is the fact OS7005 is
|
|
66
|
+
* deferred on, so an opposing order cannot be divided against it.
|
|
67
|
+
*/
|
|
68
|
+
readonly units: number | null;
|
|
69
|
+
/** The settled units nothing is working against, which is what a close sends. */
|
|
70
|
+
readonly settled: number;
|
|
71
|
+
}
|
|
72
|
+
/** What this file reads: the rows of the ledger and the position book. */
|
|
73
|
+
export interface Book {
|
|
74
|
+
/** The rows this strategy placed, newest last. */
|
|
75
|
+
rows(): readonly LedgerRow[];
|
|
76
|
+
/** The settled size of one position reference, signed the way a position is. */
|
|
77
|
+
sizeOf(ref: number): number;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Every position reference this leg holds, oldest first.
|
|
81
|
+
*
|
|
82
|
+
* Oldest first is the order the references were minted in, which is the order
|
|
83
|
+
* the rows first name them in, and it is the order a reducing order takes them
|
|
84
|
+
* in: the position opened first is the position closed first.
|
|
85
|
+
*
|
|
86
|
+
* A reference with nothing left on it is not here. It has no room for an
|
|
87
|
+
* opposing order and nothing for a close to send, and it is either already back
|
|
88
|
+
* at zero or has its whole quantity spoken for by orders that are still going.
|
|
89
|
+
*/
|
|
90
|
+
export declare function holdings(ctx: Book): readonly Holding[];
|
|
91
|
+
/**
|
|
92
|
+
* The references an order of this side reduces, oldest first.
|
|
93
|
+
*
|
|
94
|
+
* A reference is reduced by the side it is not on, which is the same test a
|
|
95
|
+
* close makes on the leg as a whole and is why `closingSide` and this agree.
|
|
96
|
+
*/
|
|
97
|
+
export declare function opposing(book: readonly Holding[], side: OrderSide): readonly Holding[];
|
|
98
|
+
/**
|
|
99
|
+
* The position an order the engine cannot size is sent against, `stdlib.md`
|
|
100
|
+
* 17.1, or none where the leg names no position at all.
|
|
101
|
+
*
|
|
102
|
+
* **A close is never minted a position of its own.** It is named for reducing,
|
|
103
|
+
* so it goes on the position it is closing, and where the engine cannot read
|
|
104
|
+
* the quantity it states, that position is the one the order may take past
|
|
105
|
+
* zero: the one shape of 17.1 an engine does not keep, waiting on the lot size
|
|
106
|
+
* OS7005 is deferred on.
|
|
107
|
+
*
|
|
108
|
+
* **What has settled comes first, and the book's own list second.** A reference
|
|
109
|
+
* whose settled quantity is entirely spoken for by orders that are still going
|
|
110
|
+
* is not in the book above, because it has nothing left for an engine-sized
|
|
111
|
+
* close to send. An order the engine cannot size is not choosing a quantity, so
|
|
112
|
+
* that exclusion does not apply to it: the position it is closing is still that
|
|
113
|
+
* one. Taking the book's answer alone sent a close on a reference an entry was
|
|
114
|
+
* opening on the other side, which is an order named close adding to a
|
|
115
|
+
* position: with the leg's whole long inside a close the destination still had,
|
|
116
|
+
* `close(qty = 1)` in cash was handed the reference a short entry had just
|
|
117
|
+
* opened, and was a sell on it.
|
|
118
|
+
*
|
|
119
|
+
* A reference with nothing settled either way is the second answer rather than
|
|
120
|
+
* the first, because a position being opened is a position under 17.1 and an
|
|
121
|
+
* order that reduces the leg has to name one of them.
|
|
122
|
+
*/
|
|
123
|
+
export declare function outgoingFor(ctx: Book, book: readonly Holding[], side: OrderSide): number | null;
|
|
124
|
+
/**
|
|
125
|
+
* The position a bracket protects, or none where the leg holds none,
|
|
126
|
+
* `stdlib.md` 17.7 and `host-interface.md` 7.1.
|
|
127
|
+
*
|
|
128
|
+
* **Holding first, opening second, which is the order 17.7 states them in.** A
|
|
129
|
+
* bracket appends no row and moves no position, so it has nothing of its own to
|
|
130
|
+
* name: it names what the leg has, and what the leg has is what its own fills
|
|
131
|
+
* settled. Only where nothing has settled at all is the answer the position the
|
|
132
|
+
* leg is opening, which is the ordinary shape of an `exit()` written beside the
|
|
133
|
+
* entry it protects.
|
|
134
|
+
*
|
|
135
|
+
* **The newest of them where the leg holds more than one**, which it does
|
|
136
|
+
* whenever an order that opposes it is outstanding. The newest is the one an
|
|
137
|
+
* entry on that side would join (`joining`), so a bracket set after an entry
|
|
138
|
+
* names the position that entry is in.
|
|
139
|
+
*
|
|
140
|
+
* **Derived here rather than kept as the last reference minted.** A stored slot
|
|
141
|
+
* answered neither question: it was set by the mint and cleared when that one
|
|
142
|
+
* reference returned to zero, so a leg whose newer position closed while an
|
|
143
|
+
* older one was still held was reported as holding none, and `exit()` handed a
|
|
144
|
+
* host `0` with ten units on the books. The mirror of it is the same slot read
|
|
145
|
+
* the other way: a reference minted for an order the destination then refused
|
|
146
|
+
* stayed the answer, and the bracket named a position that never opened while
|
|
147
|
+
* the leg's own sat on another reference. Neither needs a slot to answer, and
|
|
148
|
+
* both are wrong in the direction a host cannot check: `0` says the leg holds
|
|
149
|
+
* nothing, and 7.1 tells a host to look a reference up only when it is not `0`.
|
|
150
|
+
*/
|
|
151
|
+
export declare function protecting(ctx: Book): number | null;
|
|
152
|
+
/**
|
|
153
|
+
* The reference an order that adds to a position joins, or none to mint one.
|
|
154
|
+
*
|
|
155
|
+
* The newest open reference on that side, so that two entries sent on two bars
|
|
156
|
+
* before either fills belong to one position rather than to two, which is what
|
|
157
|
+
* `stdlib.md` 17.7 means by a reference being kept while a position is being
|
|
158
|
+
* opened.
|
|
159
|
+
*
|
|
160
|
+
* **A reference whose whole quantity is already going is not open to join.** A
|
|
161
|
+
* leg long ten with a close of ten working is on its way out: an entry joining
|
|
162
|
+
* it would settle into a position that reaches zero and ends, and 17.7's
|
|
163
|
+
* sentence would then have to happen twice for one reference. The entry takes a
|
|
164
|
+
* reference of its own, and if the close is rejected the leg simply holds two
|
|
165
|
+
* positions on one side, each of which a close can still send.
|
|
166
|
+
*/
|
|
167
|
+
export declare function joining(book: readonly Holding[], side: OrderSide): number | null;
|
|
168
|
+
/** One order of a call: the units it sends and the reference it sends them on. */
|
|
169
|
+
export interface Share {
|
|
170
|
+
readonly ref: number;
|
|
171
|
+
readonly units: number;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* How a quantity is divided across the references it reduces, oldest first.
|
|
175
|
+
*
|
|
176
|
+
* **A reducing order that spans two positions is two orders**, for the reason
|
|
177
|
+
* 17.1 already gives for a flip: one order against two positions would leave a
|
|
178
|
+
* late fill with no way to say which of them it settled. A leg holds more than
|
|
179
|
+
* one position whenever an order that opposes it is outstanding, and before
|
|
180
|
+
* this the whole of a leg's closable quantity was attached to a single
|
|
181
|
+
* reference with nothing asking whether that reference could absorb it.
|
|
182
|
+
*
|
|
183
|
+
* `room` is which of the two numbers a holding offers is the ceiling here: what
|
|
184
|
+
* an opposing order may take, or what has settled. The caller chooses, because
|
|
185
|
+
* the caller knows whether the quantity is the script's or the engine's.
|
|
186
|
+
*
|
|
187
|
+
* What is left over when every reference is full is the caller's to open or to
|
|
188
|
+
* drop. Nothing is ever sent past a reference's own ceiling.
|
|
189
|
+
*/
|
|
190
|
+
export declare function divide(book: readonly Holding[], side: OrderSide, units: number, room: (one: Holding) => number | null): {
|
|
191
|
+
readonly shares: readonly Share[];
|
|
192
|
+
readonly left: number;
|
|
193
|
+
};
|
|
194
|
+
//# sourceMappingURL=holdings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"holdings.d.ts","sourceRoot":"","sources":["../../../../src/core/engine/ledger/holdings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,4EAA4E;AAC5E,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,iFAAiF;IACjF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,0EAA0E;AAC1E,MAAM,WAAW,IAAI;IACnB,kDAAkD;IAClD,IAAI,IAAI,SAAS,SAAS,EAAE,CAAC;IAC7B,gFAAgF;IAChF,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7B;AA+BD;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,IAAI,GAAG,SAAS,OAAO,EAAE,CA0EtD;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS,OAAO,EAAE,CAEtF;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,IAAI,EACT,IAAI,EAAE,SAAS,OAAO,EAAE,EACxB,IAAI,EAAE,SAAS,GACd,MAAM,GAAG,IAAI,CASf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAanD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAMhF;AAED,kFAAkF;AAClF,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,SAAS,OAAO,EAAE,EACxB,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,MAAM,GAAG,IAAI,GACpC;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAY9D"}
|