oakscriptjs 0.9.5 → 0.10.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/README.md +1 -1
- package/dist/cjs/array/index.d.ts +93 -50
- package/dist/cjs/array/index.d.ts.map +1 -1
- package/dist/cjs/array/index.js +239 -78
- package/dist/cjs/array/index.js.map +3 -3
- package/dist/cjs/callsite/index.d.ts +81 -2
- package/dist/cjs/callsite/index.d.ts.map +1 -1
- package/dist/cjs/callsite/index.js +62 -1
- package/dist/cjs/callsite/index.js.map +2 -2
- package/dist/cjs/color/index.d.ts +7 -3
- package/dist/cjs/color/index.d.ts.map +1 -1
- package/dist/cjs/color/index.js +6 -1
- package/dist/cjs/color/index.js.map +2 -2
- package/dist/cjs/drawing/bar-time.d.ts +24 -0
- package/dist/cjs/drawing/bar-time.d.ts.map +1 -0
- package/dist/cjs/drawing/bar-time.js +47 -0
- package/dist/cjs/drawing/bar-time.js.map +7 -0
- package/dist/cjs/drawing/output.d.ts +32 -0
- package/dist/cjs/drawing/output.d.ts.map +1 -0
- package/dist/cjs/drawing/output.js +184 -0
- package/dist/cjs/drawing/output.js.map +7 -0
- package/dist/cjs/drawing/registry.d.ts +5 -4
- package/dist/cjs/drawing/registry.d.ts.map +1 -1
- package/dist/cjs/drawing/registry.js +11 -2
- package/dist/cjs/drawing/registry.js.map +2 -2
- package/dist/cjs/index.d.ts +6 -3
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +9 -2
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/label/index.d.ts.map +1 -1
- package/dist/cjs/label/index.js +2 -1
- package/dist/cjs/label/index.js.map +2 -2
- package/dist/cjs/linefill/index.d.ts.map +1 -1
- package/dist/cjs/linefill/index.js +1 -0
- package/dist/cjs/linefill/index.js.map +2 -2
- package/dist/cjs/math/index.d.ts +76 -21
- package/dist/cjs/math/index.d.ts.map +1 -1
- package/dist/cjs/math/index.js +155 -41
- package/dist/cjs/math/index.js.map +3 -3
- package/dist/cjs/matrix/index.d.ts.map +1 -1
- package/dist/cjs/matrix/index.js +42 -36
- package/dist/cjs/matrix/index.js.map +2 -2
- package/dist/cjs/polyline/index.d.ts +3 -5
- package/dist/cjs/polyline/index.d.ts.map +1 -1
- package/dist/cjs/polyline/index.js +0 -5
- package/dist/cjs/polyline/index.js.map +2 -2
- package/dist/cjs/runtime/series.d.ts +9 -0
- package/dist/cjs/runtime/series.d.ts.map +1 -1
- package/dist/cjs/runtime/series.js +16 -2
- package/dist/cjs/runtime/series.js.map +2 -2
- package/dist/cjs/runtime/types.d.ts +22 -0
- package/dist/cjs/runtime/types.d.ts.map +1 -1
- package/dist/cjs/runtime/types.js.map +1 -1
- package/dist/cjs/script/index.d.ts +97 -36
- package/dist/cjs/script/index.d.ts.map +1 -1
- package/dist/cjs/script/index.js +173 -26
- package/dist/cjs/script/index.js.map +3 -3
- package/dist/cjs/session/calendar.d.ts.map +1 -1
- package/dist/cjs/session/calendar.js +15 -2
- package/dist/cjs/session/calendar.js.map +2 -2
- package/dist/cjs/str/index.d.ts +50 -38
- package/dist/cjs/str/index.d.ts.map +1 -1
- package/dist/cjs/str/index.js +43 -15
- package/dist/cjs/str/index.js.map +2 -2
- package/dist/cjs/str/messageformat.d.ts +2 -1
- package/dist/cjs/str/messageformat.d.ts.map +1 -1
- package/dist/cjs/str/messageformat.js +4 -1
- package/dist/cjs/str/messageformat.js.map +2 -2
- package/dist/cjs/str/numberformat.d.ts +4 -0
- package/dist/cjs/str/numberformat.d.ts.map +1 -1
- package/dist/cjs/str/numberformat.js +26 -4
- package/dist/cjs/str/numberformat.js.map +3 -3
- package/dist/cjs/ta/index.d.ts +86 -43
- package/dist/cjs/ta/index.d.ts.map +1 -1
- package/dist/cjs/ta/index.js +173 -267
- package/dist/cjs/ta/index.js.map +3 -3
- package/dist/cjs/ta/running-sum.d.ts +54 -2
- package/dist/cjs/ta/running-sum.d.ts.map +1 -1
- package/dist/cjs/ta/running-sum.js +132 -52
- package/dist/cjs/ta/running-sum.js.map +2 -2
- package/dist/cjs/ta-series.d.ts +4 -4
- package/dist/cjs/ta-series.d.ts.map +1 -1
- package/dist/cjs/ta-series.js +4 -3
- package/dist/cjs/ta-series.js.map +2 -2
- package/dist/cjs/table/index.d.ts +87 -0
- package/dist/cjs/table/index.d.ts.map +1 -0
- package/dist/cjs/table/index.js +150 -0
- package/dist/cjs/table/index.js.map +7 -0
- package/dist/cjs/text/index.d.ts +17 -2
- package/dist/cjs/text/index.d.ts.map +1 -1
- package/dist/cjs/text/index.js +15 -1
- package/dist/cjs/text/index.js.map +2 -2
- package/dist/cjs/time/datestring.d.ts +1 -0
- package/dist/cjs/time/datestring.d.ts.map +1 -1
- package/dist/cjs/time/datestring.js +7 -0
- package/dist/cjs/time/datestring.js.map +2 -2
- package/dist/cjs/time/index.d.ts.map +1 -1
- package/dist/cjs/time/index.js +2 -1
- package/dist/cjs/time/index.js.map +2 -2
- package/dist/cjs/time/session.d.ts +28 -9
- package/dist/cjs/time/session.d.ts.map +1 -1
- package/dist/cjs/time/session.js +74 -28
- package/dist/cjs/time/session.js.map +2 -2
- package/dist/cjs/time/timezone.d.ts +5 -0
- package/dist/cjs/time/timezone.d.ts.map +1 -1
- package/dist/cjs/time/timezone.js +15 -1
- package/dist/cjs/time/timezone.js.map +2 -2
- package/dist/cjs/types/index.d.ts +30 -1
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +12 -0
- package/dist/cjs/types/index.js.map +2 -2
- package/dist/cjs/types/metadata.d.ts +258 -26
- package/dist/cjs/types/metadata.d.ts.map +1 -1
- package/dist/cjs/types/metadata.js.map +1 -1
- package/dist/esm/array/index.d.ts +93 -50
- package/dist/esm/array/index.d.ts.map +1 -1
- package/dist/esm/array/index.js +383 -133
- package/dist/esm/array/index.js.map +1 -1
- package/dist/esm/callsite/index.d.ts +81 -2
- package/dist/esm/callsite/index.d.ts.map +1 -1
- package/dist/esm/callsite/index.js +145 -3
- package/dist/esm/callsite/index.js.map +1 -1
- package/dist/esm/color/index.d.ts +7 -3
- package/dist/esm/color/index.d.ts.map +1 -1
- package/dist/esm/color/index.js +15 -3
- package/dist/esm/color/index.js.map +1 -1
- package/dist/esm/drawing/bar-time.d.ts +24 -0
- package/dist/esm/drawing/bar-time.d.ts.map +1 -0
- package/dist/esm/drawing/bar-time.js +44 -0
- package/dist/esm/drawing/bar-time.js.map +1 -0
- package/dist/esm/drawing/output.d.ts +32 -0
- package/dist/esm/drawing/output.d.ts.map +1 -0
- package/dist/esm/drawing/output.js +190 -0
- package/dist/esm/drawing/output.js.map +1 -0
- package/dist/esm/drawing/registry.d.ts +5 -4
- package/dist/esm/drawing/registry.d.ts.map +1 -1
- package/dist/esm/drawing/registry.js +12 -2
- package/dist/esm/drawing/registry.js.map +1 -1
- package/dist/esm/index.d.ts +6 -3
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +7 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/label/index.d.ts.map +1 -1
- package/dist/esm/label/index.js +2 -1
- package/dist/esm/label/index.js.map +1 -1
- package/dist/esm/linefill/index.d.ts.map +1 -1
- package/dist/esm/linefill/index.js +3 -0
- package/dist/esm/linefill/index.js.map +1 -1
- package/dist/esm/math/index.d.ts +76 -21
- package/dist/esm/math/index.d.ts.map +1 -1
- package/dist/esm/math/index.js +227 -61
- package/dist/esm/math/index.js.map +1 -1
- package/dist/esm/matrix/index.d.ts.map +1 -1
- package/dist/esm/matrix/index.js +57 -43
- package/dist/esm/matrix/index.js.map +1 -1
- package/dist/esm/polyline/index.d.ts +3 -5
- package/dist/esm/polyline/index.d.ts.map +1 -1
- package/dist/esm/polyline/index.js +3 -9
- package/dist/esm/polyline/index.js.map +1 -1
- package/dist/esm/runtime/series.d.ts +9 -0
- package/dist/esm/runtime/series.d.ts.map +1 -1
- package/dist/esm/runtime/series.js +18 -1
- package/dist/esm/runtime/series.js.map +1 -1
- package/dist/esm/runtime/types.d.ts +22 -0
- package/dist/esm/runtime/types.d.ts.map +1 -1
- package/dist/esm/script/index.d.ts +97 -36
- package/dist/esm/script/index.d.ts.map +1 -1
- package/dist/esm/script/index.js +211 -22
- package/dist/esm/script/index.js.map +1 -1
- package/dist/esm/session/calendar.d.ts.map +1 -1
- package/dist/esm/session/calendar.js +22 -2
- package/dist/esm/session/calendar.js.map +1 -1
- package/dist/esm/str/index.d.ts +50 -38
- package/dist/esm/str/index.d.ts.map +1 -1
- package/dist/esm/str/index.js +103 -52
- package/dist/esm/str/index.js.map +1 -1
- package/dist/esm/str/messageformat.d.ts +2 -1
- package/dist/esm/str/messageformat.d.ts.map +1 -1
- package/dist/esm/str/messageformat.js +7 -2
- package/dist/esm/str/messageformat.js.map +1 -1
- package/dist/esm/str/numberformat.d.ts +4 -0
- package/dist/esm/str/numberformat.d.ts.map +1 -1
- package/dist/esm/str/numberformat.js +38 -4
- package/dist/esm/str/numberformat.js.map +1 -1
- package/dist/esm/ta/index.d.ts +86 -43
- package/dist/esm/ta/index.d.ts.map +1 -1
- package/dist/esm/ta/index.js +296 -348
- package/dist/esm/ta/index.js.map +1 -1
- package/dist/esm/ta/running-sum.d.ts +54 -2
- package/dist/esm/ta/running-sum.d.ts.map +1 -1
- package/dist/esm/ta/running-sum.js +166 -71
- package/dist/esm/ta/running-sum.js.map +1 -1
- package/dist/esm/ta-series.d.ts +4 -4
- package/dist/esm/ta-series.d.ts.map +1 -1
- package/dist/esm/ta-series.js +5 -4
- package/dist/esm/ta-series.js.map +1 -1
- package/dist/esm/table/index.d.ts +87 -0
- package/dist/esm/table/index.d.ts.map +1 -0
- package/dist/esm/table/index.js +169 -0
- package/dist/esm/table/index.js.map +1 -0
- package/dist/esm/text/index.d.ts +17 -2
- package/dist/esm/text/index.d.ts.map +1 -1
- package/dist/esm/text/index.js +17 -2
- package/dist/esm/text/index.js.map +1 -1
- package/dist/esm/time/datestring.d.ts +1 -0
- package/dist/esm/time/datestring.d.ts.map +1 -1
- package/dist/esm/time/datestring.js +12 -0
- package/dist/esm/time/datestring.js.map +1 -1
- package/dist/esm/time/index.d.ts.map +1 -1
- package/dist/esm/time/index.js +3 -1
- package/dist/esm/time/index.js.map +1 -1
- package/dist/esm/time/session.d.ts +28 -9
- package/dist/esm/time/session.d.ts.map +1 -1
- package/dist/esm/time/session.js +113 -42
- package/dist/esm/time/session.js.map +1 -1
- package/dist/esm/time/timezone.d.ts +5 -0
- package/dist/esm/time/timezone.d.ts.map +1 -1
- package/dist/esm/time/timezone.js +21 -1
- package/dist/esm/time/timezone.js.map +1 -1
- package/dist/esm/types/index.d.ts +30 -1
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/esm/types/index.js +14 -0
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/types/metadata.d.ts +258 -26
- package/dist/esm/types/metadata.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/array/index.ts +364 -150
- package/src/callsite/index.ts +147 -3
- package/src/color/index.ts +15 -5
- package/src/drawing/bar-time.ts +42 -0
- package/src/drawing/output.ts +214 -0
- package/src/drawing/registry.ts +16 -6
- package/src/index.ts +9 -3
- package/src/label/index.ts +2 -1
- package/src/linefill/index.ts +2 -0
- package/src/math/index.ts +256 -74
- package/src/matrix/index.ts +52 -52
- package/src/polyline/index.ts +3 -12
- package/src/runtime/series.ts +22 -1
- package/src/runtime/types.ts +23 -0
- package/src/script/index.ts +307 -25
- package/src/session/calendar.ts +22 -2
- package/src/str/index.ts +95 -51
- package/src/str/messageformat.ts +7 -2
- package/src/str/numberformat.ts +39 -4
- package/src/ta/index.ts +306 -386
- package/src/ta/running-sum.ts +187 -74
- package/src/ta-series.ts +8 -7
- package/src/table/index.ts +221 -0
- package/src/text/index.ts +18 -2
- package/src/time/datestring.ts +10 -0
- package/src/time/index.ts +3 -1
- package/src/time/session.ts +97 -47
- package/src/time/timezone.ts +21 -1
- package/src/types/index.ts +32 -1
- package/src/types/metadata.ts +325 -26
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ta-series.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @fileoverview Technical analysis functions that work with Series\n * Fixed wrappers around core ta.* functions with O(n) performance\n * @module ta-series\n */\n\nimport * as taCore from './ta/index.js';\nimport { Series } from './runtime/series.js';\nimport type { Bar } from './types/index.js';\n\n/**\n * Simple Moving Average\n * @param source - Source series\n * @param length - Period length\n * @returns Series with SMA values\n */\nexport function sma(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.sma(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Exponential Moving Average\n * @param source - Source series\n * @param length - Period length\n * @returns Series with EMA values\n */\nexport function ema(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.ema(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Weighted Moving Average\n * @param source - Source series\n * @param length - Period length\n * @returns Series with WMA values\n */\nexport function wma(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.wma(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Relative Moving Average\n * @param source - Source series\n * @param length - Period length\n * @returns Series with RMA values\n */\nexport function rma(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.rma(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Relative Strength Index\n * @param source - Source series\n * @param length - Period length\n * @returns Series with RSI values\n */\nexport function rsi(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.rsi(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Moving Average Convergence Divergence\n * @param source - Source series\n * @param fastLength - Fast EMA period\n * @param slowLength - Slow EMA period\n * @param signalLength - Signal line period\n * @returns Tuple of [macdLine, signalLine, histogram] Series\n */\nexport function macd(\n source: Series,\n fastLength: number,\n slowLength: number,\n signalLength: number\n): [Series, Series, Series] {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const [macdVals, signalVals, histVals] = taCore.macd(sourceValues, fastLength, slowLength, signalLength);\n\n const macdSeries = Series.fromArray(bars, macdVals);\n const signalSeries = Series.fromArray(bars, signalVals);\n const histSeries = Series.fromArray(bars, histVals);\n\n return [macdSeries, signalSeries, histSeries];\n}\n\n/**\n * Bollinger Bands\n * @param source - Source series\n * @param length - Period length\n * @param mult - Standard deviation multiplier\n * @returns Tuple of [upper, basis, lower] Series\n */\nexport function bb(source: Series, length: number, mult: number): [Series, Series, Series] {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const [upperVals, basisVals, lowerVals] = taCore.bb(sourceValues, length, mult);\n\n const upperSeries = Series.fromArray(bars, upperVals);\n const basisSeries = Series.fromArray(bars, basisVals);\n const lowerSeries = Series.fromArray(bars, lowerVals);\n\n return [upperSeries, basisSeries, lowerSeries];\n}\n\n /**\n * Standard deviation (PineScript ta.stdev; biased by default)\n * @param source - Source series\n * @param length - Period length\n * @param biased - true (default): divide by length; false: by length - 1\n * @returns Series with standard deviation values\n */\n export function stdev(source: Series, length: number, biased: boolean = true): Series {\n const bars = source.bars as Bar[];\n return Series.fromArray(bars, taCore.stdev(source.toArray(), length, biased));\n }\n \n\n/**\n * Average True Range\n * @param bars - Bar data\n * @param length - Period length\n * @returns Series with ATR values\n */\nexport function atr(bars: Bar[], length: number): Series {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n const close = bars.map(b => b.close);\n const result = taCore.atr(length, high, low, close);\n return Series.fromArray(bars, result);\n}\n\n/**\n * True Range\n * @param bars - Bar data\n * @param handle_na - How NaN values are handled (default: false)\n * @returns Series with TR values\n */\nexport function tr(bars: Bar[], handle_na: boolean = false): Series {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n const close = bars.map(b => b.close);\n const result = taCore.tr(handle_na, high, low, close);\n return Series.fromArray(bars, result);\n}\n\n// Volume built-in variables. PineScript exposes them as variables of the chart bars\n// (`ta.obv`); here they take the bars.\n\nconst col = (bars: Bar[], f: 'open' | 'high' | 'low' | 'close' | 'volume'): number[] =>\n bars.map((b) => b[f] ?? NaN);\n\n/** On Balance Volume (PineScript `ta.obv`) */\nexport function obv(bars: Bar[]): Series {\n return Series.fromArray(bars, taCore.obv(col(bars, 'close'), col(bars, 'volume')));\n}\n\n/** Price-Volume Trend (PineScript `ta.pvt`) */\nexport function pvt(bars: Bar[]): Series {\n return Series.fromArray(bars, taCore.pvt(col(bars, 'close'), col(bars, 'volume')));\n}\n\n/** Accumulation/Distribution index (PineScript `ta.accdist`) */\nexport function accdist(bars: Bar[]): Series {\n return Series.fromArray(\n bars,\n taCore.accdist(col(bars, 'high'), col(bars, 'low'), col(bars, 'close'), col(bars, 'volume'))\n );\n}\n\n/** Negative Volume Index (PineScript `ta.nvi`) */\nexport function nvi(bars: Bar[]): Series {\n return Series.fromArray(bars, taCore.nvi(col(bars, 'close'), col(bars, 'volume')));\n}\n\n/** Positive Volume Index (PineScript `ta.pvi`) */\nexport function pvi(bars: Bar[]): Series {\n return Series.fromArray(bars, taCore.pvi(col(bars, 'close'), col(bars, 'volume')));\n}\n\n/** Intraday Intensity Index (PineScript `ta.iii`) */\nexport function iii(bars: Bar[]): Series {\n return Series.fromArray(\n bars,\n taCore.iii(col(bars, 'high'), col(bars, 'low'), col(bars, 'close'), col(bars, 'volume'))\n );\n}\n\n/** Williams Accumulation/Distribution (PineScript `ta.wad`) */\nexport function wad(bars: Bar[]): Series {\n return Series.fromArray(bars, taCore.wad(col(bars, 'high'), col(bars, 'low'), col(bars, 'close')));\n}\n\n/** Williams Variable Accumulation/Distribution (PineScript `ta.wvad`) */\nexport function wvad(bars: Bar[]): Series {\n return Series.fromArray(\n bars,\n taCore.wvad(col(bars, 'open'), col(bars, 'high'), col(bars, 'low'), col(bars, 'close'), col(bars, 'volume'))\n );\n}\n\n/**\n * Stochastic %K\n * @param source - Source series (typically close)\n * @param high - High series\n * @param low - Low series\n * @param length - Period length\n * @returns Series with stochastic values\n */\nexport function stoch(source: Series, high: Series, low: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const highValues = high.toArray();\n const lowValues = low.toArray();\n const result = taCore.stoch(sourceValues, highValues, lowValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Crossover detection\n * @param source1 - First series\n * @param source2 - Second series or number\n * @returns Series with 1 where crossover, 0 otherwise\n */\nexport function crossover(source1: Series, source2: Series | number): Series {\n const bars = source1.bars as Bar[];\n const vals1 = source1.toArray();\n const vals2 = typeof source2 === 'number'\n ? Array(bars.length).fill(source2)\n : source2.toArray();\n\n const result = taCore.crossover(vals1, vals2);\n // Convert boolean array to number array\n const numResult = result.map(b => b ? 1 : 0);\n return Series.fromArray(bars, numResult);\n}\n\n/**\n * Crossunder detection\n * @param source1 - First series\n * @param source2 - Second series or number\n * @returns Series with 1 where crossunder, 0 otherwise\n */\nexport function crossunder(source1: Series, source2: Series | number): Series {\n const bars = source1.bars as Bar[];\n const vals1 = source1.toArray();\n const vals2 = typeof source2 === 'number'\n ? Array(bars.length).fill(source2)\n : source2.toArray();\n\n const result = taCore.crossunder(vals1, vals2);\n // Convert boolean array to number array\n const numResult = result.map(b => b ? 1 : 0);\n return Series.fromArray(bars, numResult);\n}\n\n/**\n * Cross detection\n * @param source1 - First series\n * @param source2 - Second series or number\n * @returns Series with 1 where cross, 0 otherwise\n */\nexport function cross(source1: Series, source2: Series | number): Series {\n const bars = source1.bars as Bar[];\n const vals1 = source1.toArray();\n const vals2 = typeof source2 === 'number'\n ? Array(bars.length).fill(source2)\n : source2.toArray();\n\n const result = taCore.cross(vals1, vals2);\n // Convert boolean array to number array\n const numResult = result.map(b => b ? 1 : 0);\n return Series.fromArray(bars, numResult);\n}\n\n/**\n * Change (difference from previous value)\n * @param source - Source series\n * @param length - Lookback period\n * @returns Series with change values\n */\nexport function change(source: Series, length: number = 1): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.change(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Momentum\n * @param source - Source series\n * @param length - Lookback period\n * @returns Series with momentum values\n */\nexport function mom(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.mom(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Rate of Change\n * @param source - Source series\n * @param length - Lookback period\n * @returns Series with ROC values\n */\nexport function roc(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.roc(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Highest value in period\n * @param source - Source series\n * @param length - Period length\n * @returns Series with highest values\n */\nexport function highest(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.highest(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Lowest value in period\n * @param source - Source series\n * @param length - Period length\n * @returns Series with lowest values\n */\nexport function lowest(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.lowest(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Rising detection\n * @param source - Source series\n * @param length - Lookback period\n * @returns Series with 1 where rising, 0 otherwise\n */\nexport function rising(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.rising(sourceValues, length);\n // Convert boolean array to number array\n const numResult = result.map(b => b ? 1 : 0);\n return Series.fromArray(bars, numResult);\n}\n\n/**\n * Falling detection\n * @param source - Source series\n * @param length - Lookback period\n * @returns Series with 1 where falling, 0 otherwise\n */\nexport function falling(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.falling(sourceValues, length);\n // Convert boolean array to number array\n const numResult = result.map(b => b ? 1 : 0);\n return Series.fromArray(bars, numResult);\n}\n\n/**\n * Cumulative sum\n * @param source - Source series\n * @returns Series with cumulative sum values\n */\nexport function cum(source: Series): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.cum(sourceValues);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Supertrend indicator\n * @param bars - Bar data\n * @param factor - Multiplier factor\n * @param atrLength - ATR period length\n * @returns Tuple of [supertrend, direction] Series\n */\nexport function supertrend(bars: Bar[], factor: number, atrLength: number): [Series, Series] {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n const close = bars.map(b => b.close);\n const [trendVals, dirVals] = taCore.supertrend(factor, atrLength, high, low, close);\n\n const trendSeries = Series.fromArray(bars, trendVals);\n const dirSeries = Series.fromArray(bars, dirVals);\n\n return [trendSeries, dirSeries];\n}\n\n /**\n * Volume Weighted Average Price (PineScript ta.vwap)\n * @param source - Source series\n * @param volume - Volume series\n * @param anchor - Reset condition (non-zero = reset); without it the sums never restart\n * @returns Series with VWAP values\n */\n export function vwap(source: Series, volume: Series, anchor?: Series): Series {\n const bars = source.bars as Bar[];\n return Series.fromArray(bars, taCore.vwap(source.toArray(), volume.toArray(), anchor?.toArray()));\n }\n\n /**\n * VWAP with standard deviation bands (PineScript `[vwap, upper, lower] = ta.vwap(source, anchor, stdev_mult)`)\n * @returns [vwap, upper, lower] Series\n */\n export function vwapBands(source: Series, volume: Series, anchor: Series | undefined, stdev_mult: number): [Series, Series, Series] {\n const bars = source.bars as Bar[];\n const [m, u, l] = taCore.vwap(source.toArray(), volume.toArray(), anchor?.toArray(), stdev_mult);\n return [Series.fromArray(bars, m), Series.fromArray(bars, u), Series.fromArray(bars, l)];\n }\n \n\n/**\n * Ichimoku Kinko Hyo (Ichimoku Cloud)\n * @param bars - Bar data\n * @param conversionPeriods - Period for Tenkan-sen (default: 9)\n * @param basePeriods - Period for Kijun-sen (default: 26)\n * @param laggingSpan2Periods - Period for Senkou Span B (default: 52)\n * @param displacement - Displacement for Senkou Spans and Chikou Span (default: 26)\n * @returns Tuple of [tenkanSen, kijunSen, senkouSpanA, senkouSpanB, chikouSpan] Series\n */\nexport function ichimoku(\n bars: Bar[],\n conversionPeriods: number,\n basePeriods: number,\n laggingSpan2Periods: number,\n displacement: number\n): [Series, Series, Series, Series, Series] {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n const close = bars.map(b => b.close);\n const [tenkan, kijun, senkouA, senkouB, chikou] = taCore.ichimoku(\n conversionPeriods,\n basePeriods,\n laggingSpan2Periods,\n displacement,\n high,\n low,\n close\n );\n\n return [\n Series.fromArray(bars, tenkan),\n Series.fromArray(bars, kijun),\n Series.fromArray(bars, senkouA),\n Series.fromArray(bars, senkouB),\n Series.fromArray(bars, chikou),\n ];\n}\n\n/**\n * Volume Weighted Moving Average\n * @param source - Source series\n * @param length - Period length\n * @param volume - Volume series\n * @returns Series with VWMA values\n */\nexport function vwma(source: Series, length: number, volume: Series): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const volumeValues = volume.toArray();\n const result = taCore.vwma(sourceValues, length, volumeValues);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Linear Regression\n * @param source - Source series\n * @param length - Period length\n * @param offset - Offset (default: 0)\n * @returns Series with linear regression values\n */\nexport function linreg(source: Series, length: number, offset: number = 0): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.linreg(sourceValues, length, offset);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Arnaud Legoux Moving Average\n * @param source - Source series\n * @param length - Period length (default: 9)\n * @param offset - Controls tradeoff between smoothness and responsiveness (default: 0.85)\n * @param sigma - Standard deviation factor for sharpness (default: 6)\n * @param floor - Whether to floor the offset calculation (default: false)\n * @returns Series with ALMA values\n */\nexport function alma(source: Series, length: number = 9, offset: number = 0.85, sigma: number = 6, floor: boolean = false): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.alma(sourceValues, length, offset, sigma, floor);\n return Series.fromArray(bars, result);\n}\n\n/**\n * ZigZag indicator - identifies significant trend reversals\n * @param bars - Bar data\n * @param deviation - Minimum percentage price change to form a new pivot (default: 5.0)\n * @param depth - Minimum bars between pivots (default: 10)\n * @param backstep - Bars to look back for confirmation (default: 3)\n * @returns Tuple of [zigzag values, direction, isPivot flags] Series\n * @remarks\n * - The isPivot Series contains numeric values (1 for pivot, 0 for non-pivot)\n * converted from boolean for consistency with other Series-based functions\n * - The core ta.zigzag() function returns boolean isPivot values\n */\nexport function zigzag(\n bars: Bar[],\n deviation: number = 5,\n depth: number = 10,\n backstep: number = 3\n): [Series, Series, Series] {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n\n const [zigzagVals, dirVals, pivotVals] = taCore.zigzag(\n deviation, depth, backstep, undefined, high, low\n );\n\n // Convert boolean pivot flags to numbers (1/0) for Series compatibility\n return [\n Series.fromArray(bars, zigzagVals),\n Series.fromArray(bars, dirVals),\n Series.fromArray(bars, pivotVals.map(b => b ? 1 : 0)),\n ];\n}\n\n/**\n * Commodity Channel Index\n * @param source - Source series (typically hlc3)\n * @param length - Period length\n * @returns Series with CCI values\n */\nexport function cci(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.cci(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Parabolic SAR (Stop and Reverse)\n * @param bars - Bar data\n * @param start - Initial acceleration factor (default: 0.02)\n * @param inc - Acceleration factor increment (default: 0.02)\n * @param max - Maximum acceleration factor (default: 0.2)\n * @returns Series with SAR values\n */\nexport function sar(bars: Bar[], start: number = 0.02, inc: number = 0.02, max: number = 0.2): Series {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n const close = bars.map(b => b.close);\n const result = taCore.sar(start, inc, max, high, low, close);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Deviation\n * @param source - Source series\n * @param length - Period length\n * @returns Series with deviation values\n */\nexport function dev(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.dev(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Variance\n * @param source - Source series\n * @param length - Period length\n * @param biased - Use biased estimation (default: true)\n * @returns Series with variance values\n */\nexport function variance(source: Series, length: number, biased: boolean = true): Series {\n const bars = source.bars as Bar[];\n const result = taCore.variance(source.toArray(), length, biased);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Median\n * @param source - Source series\n * @param length - Period length\n * @returns Series with median values\n */\nexport function median(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.median(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Symmetrically Weighted Moving Average\n * @param source - Source series\n * @returns Series with SWMA values\n */\nexport function swma(source: Series): Series {\n const bars = source.bars as Bar[];\n const result = taCore.swma(source.toArray());\n return Series.fromArray(bars, result);\n}\n\n/**\n * Correlation\n * @param source1 - First source series\n * @param source2 - Second source series\n * @param length - Period length\n * @returns Series with correlation values\n */\nexport function correlation(source1: Series, source2: Series, length: number): Series {\n const bars = source1.bars as Bar[];\n const result = taCore.correlation(source1.toArray(), source2.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Percent Rank\n * @param source - Source series\n * @param length - Period length\n * @returns Series with percent rank values\n */\nexport function percentrank(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.percentrank(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Money Flow Index\n * @param source - Source series (typically hlc3)\n * @param length - Period length\n * @param volume - Volume series\n * @returns Series with MFI values\n */\nexport function mfi(source: Series, length: number, volume: Series): Series {\n const bars = source.bars as Bar[];\n const result = taCore.mfi(source.toArray(), length, volume.toArray());\n return Series.fromArray(bars, result);\n}\n\n/**\n * Hull Moving Average\n * @param source - Source series\n * @param length - Period length\n * @returns Series with HMA values\n */\nexport function hma(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.hma(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Pivot High\n * @param source - Source series\n * @param leftbars - Number of bars to the left of the pivot\n * @param rightbars - Number of bars to the right of the pivot\n * @returns Series with the pivot high value on the bar where the pivot is confirmed,\n * `rightbars` bars after the pivot bar (as in PineScript), NaN elsewhere\n */\nexport function pivothigh(source: Series, leftbars: number, rightbars: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.pivothigh(source.toArray(), leftbars, rightbars);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Pivot Low\n * @param source - Source series\n * @param leftbars - Number of bars to the left of the pivot\n * @param rightbars - Number of bars to the right of the pivot\n * @returns Series with the pivot low value on the bar where the pivot is confirmed,\n * `rightbars` bars after the pivot bar (as in PineScript), NaN elsewhere\n */\nexport function pivotlow(source: Series, leftbars: number, rightbars: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.pivotlow(source.toArray(), leftbars, rightbars);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Bars Since condition was true\n * @param condition - Boolean series (1/0 values)\n * @returns Series with bar count since condition was last true\n */\nexport function barssince(condition: Series): Series {\n const bars = condition.bars as Bar[];\n const boolValues = condition.toArray().map(v => v === 1);\n const result = taCore.barssince(boolValues);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Value When condition was true\n * @param condition - Boolean series (1/0 values)\n * @param source - Source series to extract values from\n * @param occurrence - Which occurrence to use (0 = most recent)\n * @returns Series with values from source when condition was true\n */\nexport function valuewhen(condition: Series, source: Series, occurrence: number): Series {\n const bars = condition.bars as Bar[];\n const boolValues = condition.toArray().map(v => v === 1);\n const result = taCore.valuewhen(boolValues, source.toArray(), occurrence);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Directional Movement Index\n * @param bars - Bar data\n * @param diLength - DI period length\n * @param adxSmoothing - ADX smoothing period\n * @returns Tuple of [plusDI, minusDI, adx] Series\n */\nexport function dmi(bars: Bar[], diLength: number, adxSmoothing: number): [Series, Series, Series] {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n const close = bars.map(b => b.close);\n const [plusDI, minusDI, adx] = taCore.dmi(diLength, adxSmoothing, high, low, close);\n return [\n Series.fromArray(bars, plusDI),\n Series.fromArray(bars, minusDI),\n Series.fromArray(bars, adx),\n ];\n}\n\n/**\n * True Strength Index\n * @param source - Source series\n * @param shortLength - Short smoothing period\n * @param longLength - Long smoothing period\n * @returns Series with TSI values\n */\nexport function tsi(source: Series, shortLength: number, longLength: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.tsi(source.toArray(), shortLength, longLength);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Chande Momentum Oscillator\n * @param source - Source series\n * @param length - Period length\n * @returns Series with CMO values\n */\nexport function cmo(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.cmo(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Keltner Channel\n * @param bars - Bar data\n * @param source - Source series\n * @param length - Period length\n * @param mult - Multiplier\n * @param useTrueRange - Use true range (default: true)\n * @returns Tuple of [middle, upper, lower] Series\n */\nexport function kc(bars: Bar[], source: Series, length: number, mult: number, useTrueRange: boolean = true): [Series, Series, Series] {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n const close = bars.map(b => b.close);\n const [middle, upper, lower] = taCore.kc(source.toArray(), length, mult, useTrueRange, high, low, close);\n return [\n Series.fromArray(bars, middle),\n Series.fromArray(bars, upper),\n Series.fromArray(bars, lower),\n ];\n}\n\n/**\n * Bollinger Bands Width\n * @param source - Source series\n * @param length - Period length\n * @param mult - Standard deviation multiplier\n * @returns Series with BBW values\n */\nexport function bbw(source: Series, length: number, mult: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.bbw(source.toArray(), length, mult);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Williams %R\n * @param bars - Bar data\n * @param length - Period length (default: 14)\n * @returns Series with Williams %R values\n */\nexport function wpr(bars: Bar[], length: number = 14): Series {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n const close = bars.map(b => b.close);\n const result = taCore.wpr(high, low, close, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Keltner Channel Width\n * @param bars - Bar data\n * @param source - Source series\n * @param length - Period length (default: 20)\n * @param mult - Multiplier (default: 2)\n * @param useTrueRange - Use true range (default: true)\n * @returns Series with KCW values\n */\nexport function kcw(bars: Bar[], source: Series, length: number = 20, mult: number = 2, useTrueRange: boolean = true): Series {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n const close = bars.map(b => b.close);\n const result = taCore.kcw(source.toArray(), length, mult, useTrueRange, high, low, close);\n return Series.fromArray(bars, result);\n}\n\n /**\n * Range: highest minus lowest value over the last `length` non-na values (PineScript ta.range)\n * @param source - Source series\n * @param length - Number of values\n * @returns Series with range values\n */\n export function range(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n return Series.fromArray(bars, taCore.range(source.toArray(), length));\n }\n \n\n/**\n * Highest Bars - offset to the highest value\n * @param source - Source series\n * @param length - Period length\n * @returns Series with bar offsets to highest value\n */\nexport function highestbars(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.highestbars(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Lowest Bars - offset to the lowest value\n * @param source - Source series\n * @param length - Period length\n * @returns Series with bar offsets to lowest value\n */\nexport function lowestbars(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.lowestbars(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n /**\n * All-time highest value (PineScript ta.max)\n * @param source - Source series\n * @returns Series with the highest value up to each bar\n */\n export function max(source: Series): Series {\n const bars = source.bars as Bar[];\n return Series.fromArray(bars, taCore.max(source.toArray()));\n }\n \n\n /**\n * All-time lowest value (PineScript ta.min)\n * @param source - Source series\n * @returns Series with the lowest value up to each bar\n */\n export function min(source: Series): Series {\n const bars = source.bars as Bar[];\n return Series.fromArray(bars, taCore.min(source.toArray()));\n }\n \n\n/**\n * Center of Gravity\n * @param source - Source series\n * @param length - Period length (default: 10)\n * @returns Series with COG values\n */\nexport function cog(source: Series, length: number = 10): Series {\n const bars = source.bars as Bar[];\n const result = taCore.cog(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Mode (most frequent value)\n * @param source - Source series\n * @param length - Period length\n * @returns Series with mode values\n */\nexport function mode(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.mode(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Percentile (linear interpolation)\n * @param source - Source series\n * @param length - Period length\n * @param percentage - Percentile percentage\n * @returns Series with percentile values\n */\nexport function percentile_linear_interpolation(source: Series, length: number, percentage: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.percentile_linear_interpolation(source.toArray(), length, percentage);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Percentile (nearest rank)\n * @param source - Source series\n * @param length - Period length\n * @param percentage - Percentile percentage\n * @returns Series with percentile values\n */\nexport function percentile_nearest_rank(source: Series, length: number, percentage: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.percentile_nearest_rank(source.toArray(), length, percentage);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Rank Correlation Index\n * @param source - Source series\n * @param length - Period length\n * @returns Series with RCI values\n */\nexport function rci(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.rci(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n// Export as namespace object to match PineScript ta.* syntax\nexport const ta = {\n sma,\n ema,\n wma,\n vwma,\n rma,\n rsi,\n macd,\n bb,\n stdev,\n atr,\n tr,\n stoch,\n crossover,\n crossunder,\n cross,\n change,\n mom,\n roc,\n highest,\n lowest,\n rising,\n falling,\n cum,\n supertrend,\n vwap,\n ichimoku,\n linreg,\n alma,\n zigzag,\n cci,\n sar,\n dev,\n variance,\n median,\n swma,\n correlation,\n percentrank,\n mfi,\n hma,\n pivothigh,\n pivotlow,\n barssince,\n valuewhen,\n dmi,\n tsi,\n cmo,\n kc,\n bbw,\n wpr,\n kcw,\n range,\n highestbars,\n lowestbars,\n max,\n min,\n vwapBands,\n obv,\n pvt,\n accdist,\n nvi,\n pvi,\n iii,\n wad,\n wvad,\n cog,\n mode,\n percentile_linear_interpolation,\n percentile_nearest_rank,\n rci,\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,aAAwB;AACxB,oBAAuB;AAShB,SAAS,IAAI,QAAgB,QAAwB;AAC1D,QAAM,OAAO,OAAO;AACpB,QAAM,eAAe,OAAO,QAAQ;AACpC,QAAM,SAAS,OAAO,IAAI,cAAc,MAAM;AAC9C,SAAO,qBAAO,UAAU,MAAM,MAAM;AACtC;AAQO,SAAS,IAAI,QAAgB,QAAwB;AAC1D,QAAM,OAAO,OAAO;AACpB,QAAM,eAAe,OAAO,QAAQ;AACpC,QAAM,SAAS,OAAO,IAAI,cAAc,MAAM;AAC9C,SAAO,qBAAO,UAAU,MAAM,MAAM;AACtC;AAQO,SAAS,IAAI,QAAgB,QAAwB;AAC1D,QAAM,OAAO,OAAO;AACpB,QAAM,eAAe,OAAO,QAAQ;AACpC,QAAM,SAAS,OAAO,IAAI,cAAc,MAAM;AAC9C,SAAO,qBAAO,UAAU,MAAM,MAAM;AACtC;AAQO,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;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
4
|
+
"sourcesContent": ["/**\n * @fileoverview Technical analysis functions that work with Series\n * Fixed wrappers around core ta.* functions with O(n) performance\n * @module ta-series\n */\n\nimport * as taCore from './ta/index.js';\nimport { Series } from './runtime/series.js';\nimport type { Bar } from './types/index.js';\n\n/**\n * Simple Moving Average\n * @param source - Source series\n * @param length - Period length\n * @returns Series with SMA values\n */\nexport function sma(source: Series, length: number | Series): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.sma(sourceValues, length instanceof Series ? length.toArray() : length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Exponential Moving Average\n * @param source - Source series\n * @param length - Period length\n * @returns Series with EMA values\n */\nexport function ema(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.ema(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Weighted Moving Average\n * @param source - Source series\n * @param length - Period length\n * @returns Series with WMA values\n */\nexport function wma(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.wma(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Relative Moving Average\n * @param source - Source series\n * @param length - Period length\n * @returns Series with RMA values\n */\nexport function rma(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.rma(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Relative Strength Index\n * @param source - Source series\n * @param length - Period length\n * @returns Series with RSI values\n */\nexport function rsi(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.rsi(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Moving Average Convergence Divergence\n * @param source - Source series\n * @param fastLength - Fast EMA period\n * @param slowLength - Slow EMA period\n * @param signalLength - Signal line period\n * @returns Tuple of [macdLine, signalLine, histogram] Series\n */\nexport function macd(\n source: Series,\n fastLength: number,\n slowLength: number,\n signalLength: number\n): [Series, Series, Series] {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const [macdVals, signalVals, histVals] = taCore.macd(sourceValues, fastLength, slowLength, signalLength);\n\n const macdSeries = Series.fromArray(bars, macdVals);\n const signalSeries = Series.fromArray(bars, signalVals);\n const histSeries = Series.fromArray(bars, histVals);\n\n return [macdSeries, signalSeries, histSeries];\n}\n\n/**\n * Bollinger Bands\n * @param source - Source series\n * @param length - Period length\n * @param mult - Standard deviation multiplier\n * @returns Tuple of [upper, basis, lower] Series\n */\nexport function bb(source: Series, length: number, mult: number): [Series, Series, Series] {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const [upperVals, basisVals, lowerVals] = taCore.bb(sourceValues, length, mult);\n\n const upperSeries = Series.fromArray(bars, upperVals);\n const basisSeries = Series.fromArray(bars, basisVals);\n const lowerSeries = Series.fromArray(bars, lowerVals);\n\n return [upperSeries, basisSeries, lowerSeries];\n}\n\n /**\n * Standard deviation (PineScript ta.stdev; biased by default)\n * @param source - Source series\n * @param length - Period length\n * @param biased - true (default): divide by length; false: by length - 1\n * @returns Series with standard deviation values\n */\n export function stdev(source: Series, length: number | Series, biased: boolean = true): Series {\n const bars = source.bars as Bar[];\n const len = length instanceof Series ? length.toArray() : length;\n return Series.fromArray(bars, taCore.stdev(source.toArray(), len, biased));\n }\n \n\n/**\n * Average True Range\n * @param bars - Bar data\n * @param length - Period length\n * @returns Series with ATR values\n */\nexport function atr(bars: Bar[], length: number): Series {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n const close = bars.map(b => b.close);\n const result = taCore.atr(length, high, low, close);\n return Series.fromArray(bars, result);\n}\n\n/**\n * True Range\n * @param bars - Bar data\n * @param handle_na - How NaN values are handled (default: false)\n * @returns Series with TR values\n */\nexport function tr(bars: Bar[], handle_na: boolean = false): Series {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n const close = bars.map(b => b.close);\n const result = taCore.tr(handle_na, high, low, close);\n return Series.fromArray(bars, result);\n}\n\n// Volume built-in variables. PineScript exposes them as variables of the chart bars\n// (`ta.obv`); here they take the bars.\n\nconst col = (bars: Bar[], f: 'open' | 'high' | 'low' | 'close' | 'volume'): number[] =>\n bars.map((b) => b[f] ?? NaN);\n\n/** On Balance Volume (PineScript `ta.obv`) */\nexport function obv(bars: Bar[]): Series {\n return Series.fromArray(bars, taCore.obv(col(bars, 'close'), col(bars, 'volume')));\n}\n\n/** Price-Volume Trend (PineScript `ta.pvt`) */\nexport function pvt(bars: Bar[]): Series {\n return Series.fromArray(bars, taCore.pvt(col(bars, 'close'), col(bars, 'volume')));\n}\n\n/** Accumulation/Distribution index (PineScript `ta.accdist`) */\nexport function accdist(bars: Bar[]): Series {\n return Series.fromArray(\n bars,\n taCore.accdist(col(bars, 'high'), col(bars, 'low'), col(bars, 'close'), col(bars, 'volume'))\n );\n}\n\n/** Negative Volume Index (PineScript `ta.nvi`) */\nexport function nvi(bars: Bar[]): Series {\n return Series.fromArray(bars, taCore.nvi(col(bars, 'close'), col(bars, 'volume')));\n}\n\n/** Positive Volume Index (PineScript `ta.pvi`) */\nexport function pvi(bars: Bar[]): Series {\n return Series.fromArray(bars, taCore.pvi(col(bars, 'close'), col(bars, 'volume')));\n}\n\n/** Intraday Intensity Index (PineScript `ta.iii`) */\nexport function iii(bars: Bar[]): Series {\n return Series.fromArray(\n bars,\n taCore.iii(col(bars, 'high'), col(bars, 'low'), col(bars, 'close'), col(bars, 'volume'))\n );\n}\n\n/** Williams Accumulation/Distribution (PineScript `ta.wad`) */\nexport function wad(bars: Bar[]): Series {\n return Series.fromArray(bars, taCore.wad(col(bars, 'high'), col(bars, 'low'), col(bars, 'close')));\n}\n\n/** Williams Variable Accumulation/Distribution (PineScript `ta.wvad`) */\nexport function wvad(bars: Bar[]): Series {\n return Series.fromArray(\n bars,\n taCore.wvad(col(bars, 'open'), col(bars, 'high'), col(bars, 'low'), col(bars, 'close'), col(bars, 'volume'))\n );\n}\n\n/**\n * Stochastic %K\n * @param source - Source series (typically close)\n * @param high - High series\n * @param low - Low series\n * @param length - Period length\n * @returns Series with stochastic values\n */\nexport function stoch(source: Series, high: Series, low: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const highValues = high.toArray();\n const lowValues = low.toArray();\n const result = taCore.stoch(sourceValues, highValues, lowValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Crossover detection\n * @param source1 - First series\n * @param source2 - Second series or number\n * @returns Series with 1 where crossover, 0 otherwise\n */\nexport function crossover(source1: Series, source2: Series | number): Series {\n const bars = source1.bars as Bar[];\n const vals1 = source1.toArray();\n const vals2 = typeof source2 === 'number'\n ? Array(bars.length).fill(source2)\n : source2.toArray();\n\n const result = taCore.crossover(vals1, vals2);\n // Convert boolean array to number array\n const numResult = result.map(b => b ? 1 : 0);\n return Series.fromArray(bars, numResult);\n}\n\n/**\n * Crossunder detection\n * @param source1 - First series\n * @param source2 - Second series or number\n * @returns Series with 1 where crossunder, 0 otherwise\n */\nexport function crossunder(source1: Series, source2: Series | number): Series {\n const bars = source1.bars as Bar[];\n const vals1 = source1.toArray();\n const vals2 = typeof source2 === 'number'\n ? Array(bars.length).fill(source2)\n : source2.toArray();\n\n const result = taCore.crossunder(vals1, vals2);\n // Convert boolean array to number array\n const numResult = result.map(b => b ? 1 : 0);\n return Series.fromArray(bars, numResult);\n}\n\n/**\n * Cross detection\n * @param source1 - First series\n * @param source2 - Second series or number\n * @returns Series with 1 where cross, 0 otherwise\n */\nexport function cross(source1: Series, source2: Series | number): Series {\n const bars = source1.bars as Bar[];\n const vals1 = source1.toArray();\n const vals2 = typeof source2 === 'number'\n ? Array(bars.length).fill(source2)\n : source2.toArray();\n\n const result = taCore.cross(vals1, vals2);\n // Convert boolean array to number array\n const numResult = result.map(b => b ? 1 : 0);\n return Series.fromArray(bars, numResult);\n}\n\n/**\n * Change (difference from previous value)\n * @param source - Source series\n * @param length - Lookback period\n * @returns Series with change values\n */\nexport function change(source: Series, length: number = 1): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.change(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Momentum\n * @param source - Source series\n * @param length - Lookback period\n * @returns Series with momentum values\n */\nexport function mom(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.mom(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Rate of Change\n * @param source - Source series\n * @param length - Lookback period\n * @returns Series with ROC values\n */\nexport function roc(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.roc(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Highest value in period\n * @param source - Source series\n * @param length - Period length\n * @returns Series with highest values\n */\nexport function highest(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.highest(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Lowest value in period\n * @param source - Source series\n * @param length - Period length\n * @returns Series with lowest values\n */\nexport function lowest(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.lowest(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Rising detection\n * @param source - Source series\n * @param length - Lookback period\n * @returns Series with 1 where rising, 0 otherwise\n */\nexport function rising(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.rising(sourceValues, length);\n // Convert boolean array to number array\n const numResult = result.map(b => b ? 1 : 0);\n return Series.fromArray(bars, numResult);\n}\n\n/**\n * Falling detection\n * @param source - Source series\n * @param length - Lookback period\n * @returns Series with 1 where falling, 0 otherwise\n */\nexport function falling(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.falling(sourceValues, length);\n // Convert boolean array to number array\n const numResult = result.map(b => b ? 1 : 0);\n return Series.fromArray(bars, numResult);\n}\n\n/**\n * Cumulative sum\n * @param source - Source series\n * @returns Series with cumulative sum values\n */\nexport function cum(source: Series): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.cum(sourceValues);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Supertrend indicator\n * @param bars - Bar data\n * @param factor - Multiplier factor\n * @param atrLength - ATR period length\n * @returns Tuple of [supertrend, direction] Series\n */\nexport function supertrend(bars: Bar[], factor: number, atrLength: number): [Series, Series] {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n const close = bars.map(b => b.close);\n const [trendVals, dirVals] = taCore.supertrend(factor, atrLength, high, low, close);\n\n const trendSeries = Series.fromArray(bars, trendVals);\n const dirSeries = Series.fromArray(bars, dirVals);\n\n return [trendSeries, dirSeries];\n}\n\n /**\n * Volume Weighted Average Price (PineScript ta.vwap)\n * @param source - Source series\n * @param volume - Volume series\n * @param anchor - Reset condition (non-zero = reset); without it the sums never restart\n * @returns Series with VWAP values\n */\n export function vwap(source: Series, volume: Series, anchor?: Series): Series {\n const bars = source.bars as Bar[];\n return Series.fromArray(bars, taCore.vwap(source.toArray(), volume.toArray(), anchor?.toArray()));\n }\n\n /**\n * VWAP with standard deviation bands (PineScript `[vwap, upper, lower] = ta.vwap(source, anchor, stdev_mult)`)\n * @returns [vwap, upper, lower] Series\n */\n export function vwapBands(source: Series, volume: Series, anchor: Series | undefined, stdev_mult: number): [Series, Series, Series] {\n const bars = source.bars as Bar[];\n const [m, u, l] = taCore.vwap(source.toArray(), volume.toArray(), anchor?.toArray(), stdev_mult);\n return [Series.fromArray(bars, m), Series.fromArray(bars, u), Series.fromArray(bars, l)];\n }\n \n\n/**\n * Ichimoku Kinko Hyo (Ichimoku Cloud)\n * @param bars - Bar data\n * @param conversionPeriods - Period for Tenkan-sen (default: 9)\n * @param basePeriods - Period for Kijun-sen (default: 26)\n * @param laggingSpan2Periods - Period for Senkou Span B (default: 52)\n * @param displacement - Displacement for Senkou Spans and Chikou Span (default: 26)\n * @returns Tuple of [tenkanSen, kijunSen, senkouSpanA, senkouSpanB, chikouSpan] Series\n */\nexport function ichimoku(\n bars: Bar[],\n conversionPeriods: number,\n basePeriods: number,\n laggingSpan2Periods: number,\n displacement: number\n): [Series, Series, Series, Series, Series] {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n const close = bars.map(b => b.close);\n const [tenkan, kijun, senkouA, senkouB, chikou] = taCore.ichimoku(\n conversionPeriods,\n basePeriods,\n laggingSpan2Periods,\n displacement,\n high,\n low,\n close\n );\n\n return [\n Series.fromArray(bars, tenkan),\n Series.fromArray(bars, kijun),\n Series.fromArray(bars, senkouA),\n Series.fromArray(bars, senkouB),\n Series.fromArray(bars, chikou),\n ];\n}\n\n/**\n * Volume Weighted Moving Average\n * @param source - Source series\n * @param length - Period length\n * @param volume - Volume series\n * @returns Series with VWMA values\n */\nexport function vwma(source: Series, length: number, volume: Series): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const volumeValues = volume.toArray();\n const result = taCore.vwma(sourceValues, length, volumeValues);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Linear Regression\n * @param source - Source series\n * @param length - Period length\n * @param offset - Offset (default: 0)\n * @returns Series with linear regression values\n */\nexport function linreg(source: Series, length: number, offset: number = 0): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.linreg(sourceValues, length, offset);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Arnaud Legoux Moving Average\n * @param source - Source series\n * @param length - Period length (default: 9)\n * @param offset - Controls tradeoff between smoothness and responsiveness (default: 0.85)\n * @param sigma - Standard deviation factor for sharpness (default: 6)\n * @param floor - Whether to floor the offset calculation (default: false)\n * @returns Series with ALMA values\n */\nexport function alma(source: Series, length: number = 9, offset: number = 0.85, sigma: number = 6, floor: boolean = false): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.alma(sourceValues, length, offset, sigma, floor);\n return Series.fromArray(bars, result);\n}\n\n/**\n * ZigZag indicator - identifies significant trend reversals\n * @param bars - Bar data\n * @param deviation - Minimum percentage price change to form a new pivot (default: 5.0)\n * @param depth - Minimum bars between pivots (default: 10)\n * @param backstep - Bars to look back for confirmation (default: 3)\n * @returns Tuple of [zigzag values, direction, isPivot flags] Series\n * @remarks\n * - The isPivot Series contains numeric values (1 for pivot, 0 for non-pivot)\n * converted from boolean for consistency with other Series-based functions\n * - The core ta.zigzag() function returns boolean isPivot values\n */\nexport function zigzag(\n bars: Bar[],\n deviation: number = 5,\n depth: number = 10,\n backstep: number = 3\n): [Series, Series, Series] {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n\n const [zigzagVals, dirVals, pivotVals] = taCore.zigzag(\n deviation, depth, backstep, undefined, high, low\n );\n\n // Convert boolean pivot flags to numbers (1/0) for Series compatibility\n return [\n Series.fromArray(bars, zigzagVals),\n Series.fromArray(bars, dirVals),\n Series.fromArray(bars, pivotVals.map(b => b ? 1 : 0)),\n ];\n}\n\n/**\n * Commodity Channel Index\n * @param source - Source series (typically hlc3)\n * @param length - Period length\n * @returns Series with CCI values\n */\nexport function cci(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const sourceValues = source.toArray();\n const result = taCore.cci(sourceValues, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Parabolic SAR (Stop and Reverse)\n * @param bars - Bar data\n * @param start - Initial acceleration factor (default: 0.02)\n * @param inc - Acceleration factor increment (default: 0.02)\n * @param max - Maximum acceleration factor (default: 0.2)\n * @returns Series with SAR values\n */\nexport function sar(bars: Bar[], start: number = 0.02, inc: number = 0.02, max: number = 0.2): Series {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n const close = bars.map(b => b.close);\n const result = taCore.sar(start, inc, max, high, low, close);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Deviation\n * @param source - Source series\n * @param length - Period length\n * @returns Series with deviation values\n */\nexport function dev(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.dev(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Variance\n * @param source - Source series\n * @param length - Period length\n * @param biased - Use biased estimation (default: true)\n * @returns Series with variance values\n */\nexport function variance(source: Series, length: number | Series, biased: boolean = true): Series {\n const bars = source.bars as Bar[];\n const result = taCore.variance(source.toArray(), length instanceof Series ? length.toArray() : length, biased);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Median\n * @param source - Source series\n * @param length - Period length\n * @returns Series with median values\n */\nexport function median(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.median(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Symmetrically Weighted Moving Average\n * @param source - Source series\n * @returns Series with SWMA values\n */\nexport function swma(source: Series): Series {\n const bars = source.bars as Bar[];\n const result = taCore.swma(source.toArray());\n return Series.fromArray(bars, result);\n}\n\n/**\n * Correlation\n * @param source1 - First source series\n * @param source2 - Second source series\n * @param length - Period length\n * @returns Series with correlation values\n */\nexport function correlation(source1: Series, source2: Series, length: number): Series {\n const bars = source1.bars as Bar[];\n const result = taCore.correlation(source1.toArray(), source2.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Percent Rank\n * @param source - Source series\n * @param length - Period length\n * @returns Series with percent rank values\n */\nexport function percentrank(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.percentrank(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Money Flow Index\n * @param source - Source series (typically hlc3)\n * @param length - Period length\n * @param volume - Volume series\n * @returns Series with MFI values\n */\nexport function mfi(source: Series, length: number, volume: Series): Series {\n const bars = source.bars as Bar[];\n const result = taCore.mfi(source.toArray(), length, volume.toArray());\n return Series.fromArray(bars, result);\n}\n\n/**\n * Hull Moving Average\n * @param source - Source series\n * @param length - Period length\n * @returns Series with HMA values\n */\nexport function hma(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.hma(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Pivot High\n * @param source - Source series\n * @param leftbars - Number of bars to the left of the pivot\n * @param rightbars - Number of bars to the right of the pivot\n * @returns Series with the pivot high value on the bar where the pivot is confirmed,\n * `rightbars` bars after the pivot bar (as in PineScript), NaN elsewhere\n */\nexport function pivothigh(source: Series, leftbars: number, rightbars: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.pivothigh(source.toArray(), leftbars, rightbars);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Pivot Low\n * @param source - Source series\n * @param leftbars - Number of bars to the left of the pivot\n * @param rightbars - Number of bars to the right of the pivot\n * @returns Series with the pivot low value on the bar where the pivot is confirmed,\n * `rightbars` bars after the pivot bar (as in PineScript), NaN elsewhere\n */\nexport function pivotlow(source: Series, leftbars: number, rightbars: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.pivotlow(source.toArray(), leftbars, rightbars);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Bars Since condition was true\n * @param condition - Boolean series (1/0 values)\n * @returns Series with bar count since condition was last true\n */\nexport function barssince(condition: Series): Series {\n const bars = condition.bars as Bar[];\n const boolValues = condition.toArray().map(v => v === 1);\n const result = taCore.barssince(boolValues);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Value When condition was true\n * @param condition - Boolean series (1/0 values)\n * @param source - Source series to extract values from\n * @param occurrence - Which occurrence to use (0 = most recent)\n * @returns Series with values from source when condition was true\n */\nexport function valuewhen(condition: Series, source: Series, occurrence: number): Series {\n const bars = condition.bars as Bar[];\n const boolValues = condition.toArray().map(v => v === 1);\n const result = taCore.valuewhen(boolValues, source.toArray(), occurrence);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Directional Movement Index\n * @param bars - Bar data\n * @param diLength - DI period length\n * @param adxSmoothing - ADX smoothing period\n * @returns Tuple of [plusDI, minusDI, adx] Series\n */\nexport function dmi(bars: Bar[], diLength: number, adxSmoothing: number): [Series, Series, Series] {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n const close = bars.map(b => b.close);\n const [plusDI, minusDI, adx] = taCore.dmi(diLength, adxSmoothing, high, low, close);\n return [\n Series.fromArray(bars, plusDI),\n Series.fromArray(bars, minusDI),\n Series.fromArray(bars, adx),\n ];\n}\n\n/**\n * True Strength Index\n * @param source - Source series\n * @param shortLength - Short smoothing period\n * @param longLength - Long smoothing period\n * @returns Series with TSI values, in [-1, 1] as PineScript\n */\nexport function tsi(source: Series, shortLength: number, longLength: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.tsi(source.toArray(), shortLength, longLength);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Chande Momentum Oscillator\n * @param source - Source series\n * @param length - Period length\n * @returns Series with CMO values\n */\nexport function cmo(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.cmo(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Keltner Channel\n * @param bars - Bar data\n * @param source - Source series\n * @param length - Period length\n * @param mult - Multiplier\n * @param useTrueRange - Use true range (default: true)\n * @returns Tuple of [middle, upper, lower] Series\n */\nexport function kc(bars: Bar[], source: Series, length: number, mult: number, useTrueRange: boolean = true): [Series, Series, Series] {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n const close = bars.map(b => b.close);\n const [middle, upper, lower] = taCore.kc(source.toArray(), length, mult, useTrueRange, high, low, close);\n return [\n Series.fromArray(bars, middle),\n Series.fromArray(bars, upper),\n Series.fromArray(bars, lower),\n ];\n}\n\n/**\n * Bollinger Bands Width\n * @param source - Source series\n * @param length - Period length\n * @param mult - Standard deviation multiplier\n * @returns Series with BBW values\n */\nexport function bbw(source: Series, length: number, mult: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.bbw(source.toArray(), length, mult);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Williams %R\n * @param bars - Bar data\n * @param length - Period length (default: 14)\n * @returns Series with Williams %R values\n */\nexport function wpr(bars: Bar[], length: number = 14): Series {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n const close = bars.map(b => b.close);\n const result = taCore.wpr(high, low, close, length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Keltner Channel Width\n * @param bars - Bar data\n * @param source - Source series\n * @param length - Period length (default: 20)\n * @param mult - Multiplier (default: 2)\n * @param useTrueRange - Use true range (default: true)\n * @returns Series with KCW values\n */\nexport function kcw(bars: Bar[], source: Series, length: number = 20, mult: number = 2, useTrueRange: boolean = true): Series {\n const high = bars.map(b => b.high);\n const low = bars.map(b => b.low);\n const close = bars.map(b => b.close);\n const result = taCore.kcw(source.toArray(), length, mult, useTrueRange, high, low, close);\n return Series.fromArray(bars, result);\n}\n\n /**\n * Range: highest minus lowest value over the last `length` non-na values (PineScript ta.range)\n * @param source - Source series\n * @param length - Number of values\n * @returns Series with range values\n */\n export function range(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n return Series.fromArray(bars, taCore.range(source.toArray(), length));\n }\n \n\n/**\n * Highest Bars - offset to the highest value\n * @param source - Source series\n * @param length - Period length\n * @returns Series with bar offsets to highest value\n */\nexport function highestbars(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.highestbars(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Lowest Bars - offset to the lowest value\n * @param source - Source series\n * @param length - Period length\n * @returns Series with bar offsets to lowest value\n */\nexport function lowestbars(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.lowestbars(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n /**\n * All-time highest value (PineScript ta.max)\n * @param source - Source series\n * @returns Series with the highest value up to each bar\n */\n export function max(source: Series): Series {\n const bars = source.bars as Bar[];\n return Series.fromArray(bars, taCore.max(source.toArray()));\n }\n \n\n /**\n * All-time lowest value (PineScript ta.min)\n * @param source - Source series\n * @returns Series with the lowest value up to each bar\n */\n export function min(source: Series): Series {\n const bars = source.bars as Bar[];\n return Series.fromArray(bars, taCore.min(source.toArray()));\n }\n \n\n/**\n * Center of Gravity\n * @param source - Source series\n * @param length - Period length (default: 10)\n * @returns Series with COG values\n */\nexport function cog(source: Series, length: number = 10): Series {\n const bars = source.bars as Bar[];\n const result = taCore.cog(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Mode (most frequent value)\n * @param source - Source series\n * @param length - Period length\n * @returns Series with mode values\n */\nexport function mode(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.mode(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Percentile (linear interpolation)\n * @param source - Source series\n * @param length - Period length\n * @param percentage - Percentile percentage\n * @returns Series with percentile values\n */\nexport function percentile_linear_interpolation(source: Series, length: number, percentage: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.percentile_linear_interpolation(source.toArray(), length, percentage);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Percentile (nearest rank)\n * @param source - Source series\n * @param length - Period length\n * @param percentage - Percentile percentage\n * @returns Series with percentile values\n */\nexport function percentile_nearest_rank(source: Series, length: number, percentage: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.percentile_nearest_rank(source.toArray(), length, percentage);\n return Series.fromArray(bars, result);\n}\n\n/**\n * Rank Correlation Index\n * @param source - Source series\n * @param length - Period length\n * @returns Series with RCI values\n */\nexport function rci(source: Series, length: number): Series {\n const bars = source.bars as Bar[];\n const result = taCore.rci(source.toArray(), length);\n return Series.fromArray(bars, result);\n}\n\n// Export as namespace object to match PineScript ta.* syntax\nexport const ta = {\n sma,\n ema,\n wma,\n vwma,\n rma,\n rsi,\n macd,\n bb,\n stdev,\n atr,\n tr,\n stoch,\n crossover,\n crossunder,\n cross,\n change,\n mom,\n roc,\n highest,\n lowest,\n rising,\n falling,\n cum,\n supertrend,\n vwap,\n ichimoku,\n linreg,\n alma,\n zigzag,\n cci,\n sar,\n dev,\n variance,\n median,\n swma,\n correlation,\n percentrank,\n mfi,\n hma,\n pivothigh,\n pivotlow,\n barssince,\n valuewhen,\n dmi,\n tsi,\n cmo,\n kc,\n bbw,\n wpr,\n kcw,\n range,\n highestbars,\n lowestbars,\n max,\n min,\n vwapBands,\n obv,\n pvt,\n accdist,\n nvi,\n pvi,\n iii,\n wad,\n wvad,\n cog,\n mode,\n percentile_linear_interpolation,\n percentile_nearest_rank,\n rci,\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA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|
7
7
|
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Table namespace
|
|
3
|
+
* Functions for creating and filling table drawing objects.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* A table is drawn at a fixed position of the pane (`position.*`), not at a bar. Tables have no getters in
|
|
7
|
+
* PineScript; the script API returns the live tables in `result.tables`.
|
|
8
|
+
*
|
|
9
|
+
* PineScript rules:
|
|
10
|
+
* - `table.cell` defines a cell: the arguments it does not give get their default, a previous definition of the
|
|
11
|
+
* cell is replaced
|
|
12
|
+
* - `table.cell_set_*` changes one property of a cell (a cell that was not defined is created)
|
|
13
|
+
* - a column or row outside the table is a runtime error
|
|
14
|
+
* - a deleted table is `na`: its functions do nothing
|
|
15
|
+
*
|
|
16
|
+
* @version 6
|
|
17
|
+
*/
|
|
18
|
+
import type { Table, color } from '../types/index.js';
|
|
19
|
+
type TablePosition = Table['position'];
|
|
20
|
+
type HAlign = 'left' | 'center' | 'right';
|
|
21
|
+
type VAlign = 'top' | 'center' | 'bottom';
|
|
22
|
+
type FontFamily = 'default' | 'monospace';
|
|
23
|
+
/**
|
|
24
|
+
* Creates a new table (PineScript `table.new`).
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const t = table.new(position.top_right, 2, 3, '#131722', '#787B86', 1);
|
|
29
|
+
* table.cell(t, 0, 0, 'RSI', 0, 0, '#FFFFFF');
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function new_table(position: TablePosition, columns: number, rows: number, bgcolor?: color, frame_color?: color, frame_width?: number, border_color?: color, border_width?: number, force_overlay?: boolean): Table;
|
|
33
|
+
/**
|
|
34
|
+
* Defines a cell (PineScript `table.cell`): its text and properties. Omitted properties get their default.
|
|
35
|
+
*/
|
|
36
|
+
export declare function cell(table_id: Table, column: number, row: number, text?: string, width?: number, height?: number, text_color?: color, text_halign?: HAlign, text_valign?: VAlign, text_size?: string | number, bgcolor?: color, tooltip?: string, text_font_family?: FontFamily, text_formatting?: number): void;
|
|
37
|
+
/** Sets the text of a cell. */
|
|
38
|
+
export declare const cell_set_text: (table_id: Table, column: number, row: number, value: string | undefined) => void;
|
|
39
|
+
/** Sets the width of a cell (% of the chart width; 0 fits the text). */
|
|
40
|
+
export declare const cell_set_width: (table_id: Table, column: number, row: number, value: number | undefined) => void;
|
|
41
|
+
/** Sets the height of a cell (% of the chart height; 0 fits the text). */
|
|
42
|
+
export declare const cell_set_height: (table_id: Table, column: number, row: number, value: number | undefined) => void;
|
|
43
|
+
/** Sets the text colour of a cell. */
|
|
44
|
+
export declare const cell_set_text_color: (table_id: Table, column: number, row: number, value: color | undefined) => void;
|
|
45
|
+
/** Sets the horizontal text alignment of a cell. */
|
|
46
|
+
export declare const cell_set_text_halign: (table_id: Table, column: number, row: number, value: "left" | "right" | "center" | undefined) => void;
|
|
47
|
+
/** Sets the vertical text alignment of a cell. */
|
|
48
|
+
export declare const cell_set_text_valign: (table_id: Table, column: number, row: number, value: "center" | "top" | "bottom" | undefined) => void;
|
|
49
|
+
/** Sets the text size of a cell. */
|
|
50
|
+
export declare const cell_set_text_size: (table_id: Table, column: number, row: number, value: string | number | undefined) => void;
|
|
51
|
+
/** Sets the background colour of a cell. */
|
|
52
|
+
export declare const cell_set_bgcolor: (table_id: Table, column: number, row: number, value: color | undefined) => void;
|
|
53
|
+
/** Sets the tooltip of a cell. */
|
|
54
|
+
export declare const cell_set_tooltip: (table_id: Table, column: number, row: number, value: string | undefined) => void;
|
|
55
|
+
/** Sets the font family of a cell. */
|
|
56
|
+
export declare const cell_set_text_font_family: (table_id: Table, column: number, row: number, value: "default" | "monospace" | undefined) => void;
|
|
57
|
+
/** Sets the text formatting of a cell (`text.format_*` flags). */
|
|
58
|
+
export declare const cell_set_text_formatting: (table_id: Table, column: number, row: number, value: number | undefined) => void;
|
|
59
|
+
/**
|
|
60
|
+
* Merges the cells from start_column / start_row to end_column / end_row (PineScript `table.merge_cells`). The
|
|
61
|
+
* merged cell shows the content of the start cell.
|
|
62
|
+
*/
|
|
63
|
+
export declare function merge_cells(table_id: Table, start_column: number, start_row: number, end_column: number, end_row: number): void;
|
|
64
|
+
/**
|
|
65
|
+
* Removes the cells from start_column / start_row to end_column / end_row (PineScript `table.clear`; default end:
|
|
66
|
+
* the start cell), and the merges that start in that range.
|
|
67
|
+
*/
|
|
68
|
+
export declare function clear(table_id: Table, start_column: number, start_row: number, end_column?: number, end_row?: number): void;
|
|
69
|
+
/** Moves the table to another position (`position.*`). */
|
|
70
|
+
export declare const set_position: (table_id: Table, value: "top_left" | "top_center" | "top_right" | "middle_left" | "middle_center" | "middle_right" | "bottom_left" | "bottom_center" | "bottom_right") => void;
|
|
71
|
+
/** Sets the background colour of the table. */
|
|
72
|
+
export declare const set_bgcolor: (table_id: Table, value: color | undefined) => void;
|
|
73
|
+
/** Sets the colour of the outer frame. */
|
|
74
|
+
export declare const set_frame_color: (table_id: Table, value: color | undefined) => void;
|
|
75
|
+
/** Sets the width of the outer frame. */
|
|
76
|
+
export declare const set_frame_width: (table_id: Table, value: number | undefined) => void;
|
|
77
|
+
/** Sets the colour of the cell borders. */
|
|
78
|
+
export declare const set_border_color: (table_id: Table, value: color | undefined) => void;
|
|
79
|
+
/** Sets the width of the cell borders. */
|
|
80
|
+
export declare const set_border_width: (table_id: Table, value: number | undefined) => void;
|
|
81
|
+
/** Deletes the table (PineScript `table.delete`). */
|
|
82
|
+
export declare function delete_table(table_id: Table): void;
|
|
83
|
+
/** All live tables, in creation order (PineScript `table.all`). A new array. */
|
|
84
|
+
export declare function all(): Table[];
|
|
85
|
+
export { new_table as new };
|
|
86
|
+
export { delete_table as delete };
|
|
87
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,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OAAO,GAAE,MAAkB,GAC1B,IAAI,CAUN;AASD,0DAA0D;AAC1D,eAAO,MAAM,YAAY,aAPL,KAAK,2JAAoB,IAOG,CAAC;AACjD,+CAA+C;AAC/C,eAAO,MAAM,WAAW,aATJ,KAAK,+BAAoB,IASC,CAAC;AAC/C,0CAA0C;AAC1C,eAAO,MAAM,eAAe,aAXR,KAAK,+BAAoB,IAWS,CAAC;AACvD,yCAAyC;AACzC,eAAO,MAAM,eAAe,aAbR,KAAK,gCAAoB,IAaS,CAAC;AACvD,2CAA2C;AAC3C,eAAO,MAAM,gBAAgB,aAfT,KAAK,+BAAoB,IAeW,CAAC;AACzD,0CAA0C;AAC1C,eAAO,MAAM,gBAAgB,aAjBT,KAAK,gCAAoB,IAiBW,CAAC;AAEzD,qDAAqD;AACrD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,KAAK,GAAG,IAAI,CAElD;AAED,gFAAgF;AAChF,wBAAgB,GAAG,IAAI,KAAK,EAAE,CAE7B;AAGD,OAAO,EAAE,SAAS,IAAI,GAAG,EAAE,CAAC;AAC5B,OAAO,EAAE,YAAY,IAAI,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all2) => {
|
|
7
|
+
for (var name in all2)
|
|
8
|
+
__defProp(target, name, { get: all2[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key2 of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key2) && key2 !== except)
|
|
14
|
+
__defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var table_exports = {};
|
|
20
|
+
__export(table_exports, {
|
|
21
|
+
all: () => all,
|
|
22
|
+
cell: () => cell,
|
|
23
|
+
cell_set_bgcolor: () => cell_set_bgcolor,
|
|
24
|
+
cell_set_height: () => cell_set_height,
|
|
25
|
+
cell_set_text: () => cell_set_text,
|
|
26
|
+
cell_set_text_color: () => cell_set_text_color,
|
|
27
|
+
cell_set_text_font_family: () => cell_set_text_font_family,
|
|
28
|
+
cell_set_text_formatting: () => cell_set_text_formatting,
|
|
29
|
+
cell_set_text_halign: () => cell_set_text_halign,
|
|
30
|
+
cell_set_text_size: () => cell_set_text_size,
|
|
31
|
+
cell_set_text_valign: () => cell_set_text_valign,
|
|
32
|
+
cell_set_tooltip: () => cell_set_tooltip,
|
|
33
|
+
cell_set_width: () => cell_set_width,
|
|
34
|
+
clear: () => clear,
|
|
35
|
+
delete: () => delete_table,
|
|
36
|
+
delete_table: () => delete_table,
|
|
37
|
+
merge_cells: () => merge_cells,
|
|
38
|
+
new: () => new_table,
|
|
39
|
+
new_table: () => new_table,
|
|
40
|
+
set_bgcolor: () => set_bgcolor,
|
|
41
|
+
set_border_color: () => set_border_color,
|
|
42
|
+
set_border_width: () => set_border_width,
|
|
43
|
+
set_frame_color: () => set_frame_color,
|
|
44
|
+
set_frame_width: () => set_frame_width,
|
|
45
|
+
set_position: () => set_position
|
|
46
|
+
});
|
|
47
|
+
module.exports = __toCommonJS(table_exports);
|
|
48
|
+
var import_registry = require("../drawing/registry.js");
|
|
49
|
+
function new_table(position, columns, rows, bgcolor, frame_color, frame_width, border_color, border_width, force_overlay) {
|
|
50
|
+
return (0, import_registry.register)("table", {
|
|
51
|
+
position,
|
|
52
|
+
columns,
|
|
53
|
+
rows,
|
|
54
|
+
bgcolor,
|
|
55
|
+
frame_color,
|
|
56
|
+
frame_width,
|
|
57
|
+
border_color,
|
|
58
|
+
border_width,
|
|
59
|
+
force_overlay: force_overlay ?? false,
|
|
60
|
+
cells: /* @__PURE__ */ new Map(),
|
|
61
|
+
merges: []
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function checkCell(caller, id, column, row) {
|
|
65
|
+
if (!(column >= 0 && column < id.columns && row >= 0 && row < id.rows)) {
|
|
66
|
+
throw new RangeError(
|
|
67
|
+
`${caller}: column ${column}, row ${row} is outside the table (${id.columns} columns, ${id.rows} rows).`
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const key = (column, row) => `${column},${row}`;
|
|
72
|
+
function cellOf(caller, id, column, row) {
|
|
73
|
+
checkCell(caller, id, column, row);
|
|
74
|
+
const cells = id.cells ??= /* @__PURE__ */ new Map();
|
|
75
|
+
let cell2 = cells.get(key(column, row));
|
|
76
|
+
if (!cell2) cells.set(key(column, row), cell2 = { text: "" });
|
|
77
|
+
return cell2;
|
|
78
|
+
}
|
|
79
|
+
function cell(table_id, column, row, text, width, height, text_color, text_halign, text_valign, text_size, bgcolor, tooltip, text_font_family, text_formatting) {
|
|
80
|
+
if ((0, import_registry.isDeleted)(table_id)) return;
|
|
81
|
+
checkCell("table.cell()", table_id, column, row);
|
|
82
|
+
(table_id.cells ??= /* @__PURE__ */ new Map()).set(key(column, row), {
|
|
83
|
+
text: text ?? "",
|
|
84
|
+
width,
|
|
85
|
+
height,
|
|
86
|
+
text_color,
|
|
87
|
+
text_halign,
|
|
88
|
+
text_valign,
|
|
89
|
+
text_size,
|
|
90
|
+
bgcolor,
|
|
91
|
+
tooltip,
|
|
92
|
+
text_font_family,
|
|
93
|
+
text_formatting
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function setCell(name, field) {
|
|
97
|
+
return (table_id, column, row, value) => {
|
|
98
|
+
if ((0, import_registry.isDeleted)(table_id)) return;
|
|
99
|
+
cellOf(`table.${name}()`, table_id, column, row)[field] = value;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
const cell_set_text = setCell("cell_set_text", "text");
|
|
103
|
+
const cell_set_width = setCell("cell_set_width", "width");
|
|
104
|
+
const cell_set_height = setCell("cell_set_height", "height");
|
|
105
|
+
const cell_set_text_color = setCell("cell_set_text_color", "text_color");
|
|
106
|
+
const cell_set_text_halign = setCell("cell_set_text_halign", "text_halign");
|
|
107
|
+
const cell_set_text_valign = setCell("cell_set_text_valign", "text_valign");
|
|
108
|
+
const cell_set_text_size = setCell("cell_set_text_size", "text_size");
|
|
109
|
+
const cell_set_bgcolor = setCell("cell_set_bgcolor", "bgcolor");
|
|
110
|
+
const cell_set_tooltip = setCell("cell_set_tooltip", "tooltip");
|
|
111
|
+
const cell_set_text_font_family = setCell("cell_set_text_font_family", "text_font_family");
|
|
112
|
+
const cell_set_text_formatting = setCell("cell_set_text_formatting", "text_formatting");
|
|
113
|
+
function merge_cells(table_id, start_column, start_row, end_column, end_row) {
|
|
114
|
+
if ((0, import_registry.isDeleted)(table_id)) return;
|
|
115
|
+
checkCell("table.merge_cells()", table_id, start_column, start_row);
|
|
116
|
+
checkCell("table.merge_cells()", table_id, end_column, end_row);
|
|
117
|
+
if (end_column < start_column || end_row < start_row) {
|
|
118
|
+
throw new RangeError("table.merge_cells(): the end cell is before the start cell.");
|
|
119
|
+
}
|
|
120
|
+
(table_id.merges ??= []).push({ start_column, start_row, end_column, end_row });
|
|
121
|
+
}
|
|
122
|
+
function clear(table_id, start_column, start_row, end_column = start_column, end_row = start_row) {
|
|
123
|
+
if ((0, import_registry.isDeleted)(table_id)) return;
|
|
124
|
+
checkCell("table.clear()", table_id, start_column, start_row);
|
|
125
|
+
checkCell("table.clear()", table_id, end_column, end_row);
|
|
126
|
+
const inside = (column, row) => column >= start_column && column <= end_column && row >= start_row && row <= end_row;
|
|
127
|
+
for (let column = start_column; column <= end_column; column++) {
|
|
128
|
+
for (let row = start_row; row <= end_row; row++) table_id.cells?.delete(key(column, row));
|
|
129
|
+
}
|
|
130
|
+
if (table_id.merges) table_id.merges = table_id.merges.filter((m) => !inside(m.start_column, m.start_row));
|
|
131
|
+
}
|
|
132
|
+
function setTable(field) {
|
|
133
|
+
return (table_id, value) => {
|
|
134
|
+
if ((0, import_registry.isDeleted)(table_id)) return;
|
|
135
|
+
table_id[field] = value;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
const set_position = setTable("position");
|
|
139
|
+
const set_bgcolor = setTable("bgcolor");
|
|
140
|
+
const set_frame_color = setTable("frame_color");
|
|
141
|
+
const set_frame_width = setTable("frame_width");
|
|
142
|
+
const set_border_color = setTable("border_color");
|
|
143
|
+
const set_border_width = setTable("border_width");
|
|
144
|
+
function delete_table(table_id) {
|
|
145
|
+
(0, import_registry.remove)("table", table_id);
|
|
146
|
+
}
|
|
147
|
+
function all() {
|
|
148
|
+
return (0, import_registry.all)("table");
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/table/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Table namespace\n * Functions for creating and filling table drawing objects.\n *\n * @remarks\n * A table is drawn at a fixed position of the pane (`position.*`), not at a bar. Tables have no getters in\n * PineScript; the script API returns the live tables in `result.tables`.\n *\n * PineScript rules:\n * - `table.cell` defines a cell: the arguments it does not give get their default, a previous definition of the\n * cell is replaced\n * - `table.cell_set_*` changes one property of a cell (a cell that was not defined is created)\n * - a column or row outside the table is a runtime error\n * - a deleted table is `na`: its functions do nothing\n *\n * @version 6\n */\n\nimport { all as allDrawings, isDeleted, register, remove } from '../drawing/registry.js';\nimport type { Table, TableCell, color } from '../types/index.js';\n\ntype TablePosition = Table['position'];\ntype HAlign = 'left' | 'center' | 'right';\ntype VAlign = 'top' | 'center' | 'bottom';\ntype FontFamily = 'default' | 'monospace';\n\n/**\n * Creates a new table (PineScript `table.new`).\n *\n * @example\n * ```typescript\n * const t = table.new(position.top_right, 2, 3, '#131722', '#787B86', 1);\n * table.cell(t, 0, 0, 'RSI', 0, 0, '#FFFFFF');\n * ```\n */\nexport function new_table(\n position: TablePosition,\n columns: number,\n rows: number,\n bgcolor?: color,\n frame_color?: color,\n frame_width?: number,\n border_color?: color,\n border_width?: number,\n force_overlay?: boolean\n): Table {\n return register('table', {\n position,\n columns,\n rows,\n bgcolor,\n frame_color,\n frame_width,\n border_color,\n border_width,\n force_overlay: force_overlay ?? false,\n cells: new Map(),\n merges: [],\n });\n}\n\nfunction checkCell(caller: string, id: Table, column: number, row: number): void {\n if (!(column >= 0 && column < id.columns && row >= 0 && row < id.rows)) {\n throw new RangeError(\n `${caller}: column ${column}, row ${row} is outside the table (${id.columns} columns, ${id.rows} rows).`\n );\n }\n}\n\nconst key = (column: number, row: number): string => `${column},${row}`;\n\n/** The cell at column / row, created when it was not defined. */\nfunction cellOf(caller: string, id: Table, column: number, row: number): TableCell {\n checkCell(caller, id, column, row);\n const cells = (id.cells ??= new Map());\n let cell = cells.get(key(column, row));\n if (!cell) cells.set(key(column, row), (cell = { text: '' }));\n return cell;\n}\n\n/**\n * Defines a cell (PineScript `table.cell`): its text and properties. Omitted properties get their default.\n */\nexport function cell(\n table_id: Table,\n column: number,\n row: number,\n text?: string,\n width?: number,\n height?: number,\n text_color?: color,\n text_halign?: HAlign,\n text_valign?: VAlign,\n text_size?: string | number,\n bgcolor?: color,\n tooltip?: string,\n text_font_family?: FontFamily,\n text_formatting?: number\n): void {\n if (isDeleted(table_id)) return;\n checkCell('table.cell()', table_id, column, row);\n (table_id.cells ??= new Map()).set(key(column, row), {\n text: text ?? '',\n width,\n height,\n text_color,\n text_halign,\n text_valign,\n text_size,\n bgcolor,\n tooltip,\n text_font_family,\n text_formatting,\n });\n}\n\nfunction setCell<K extends keyof TableCell>(name: string, field: K) {\n return (table_id: Table, column: number, row: number, value: TableCell[K]): void => {\n if (isDeleted(table_id)) return;\n cellOf(`table.${name}()`, table_id, column, row)[field] = value;\n };\n}\n\n/** Sets the text of a cell. */\nexport const cell_set_text = setCell('cell_set_text', 'text');\n/** Sets the width of a cell (% of the chart width; 0 fits the text). */\nexport const cell_set_width = setCell('cell_set_width', 'width');\n/** Sets the height of a cell (% of the chart height; 0 fits the text). */\nexport const cell_set_height = setCell('cell_set_height', 'height');\n/** Sets the text colour of a cell. */\nexport const cell_set_text_color = setCell('cell_set_text_color', 'text_color');\n/** Sets the horizontal text alignment of a cell. */\nexport const cell_set_text_halign = setCell('cell_set_text_halign', 'text_halign');\n/** Sets the vertical text alignment of a cell. */\nexport const cell_set_text_valign = setCell('cell_set_text_valign', 'text_valign');\n/** Sets the text size of a cell. */\nexport const cell_set_text_size = setCell('cell_set_text_size', 'text_size');\n/** Sets the background colour of a cell. */\nexport const cell_set_bgcolor = setCell('cell_set_bgcolor', 'bgcolor');\n/** Sets the tooltip of a cell. */\nexport const cell_set_tooltip = setCell('cell_set_tooltip', 'tooltip');\n/** Sets the font family of a cell. */\nexport const cell_set_text_font_family = setCell('cell_set_text_font_family', 'text_font_family');\n/** Sets the text formatting of a cell (`text.format_*` flags). */\nexport const cell_set_text_formatting = setCell('cell_set_text_formatting', 'text_formatting');\n\n/**\n * Merges the cells from start_column / start_row to end_column / end_row (PineScript `table.merge_cells`). The\n * merged cell shows the content of the start cell.\n */\nexport function merge_cells(\n table_id: Table,\n start_column: number,\n start_row: number,\n end_column: number,\n end_row: number\n): void {\n if (isDeleted(table_id)) return;\n checkCell('table.merge_cells()', table_id, start_column, start_row);\n checkCell('table.merge_cells()', table_id, end_column, end_row);\n if (end_column < start_column || end_row < start_row) {\n throw new RangeError('table.merge_cells(): the end cell is before the start cell.');\n }\n (table_id.merges ??= []).push({ start_column, start_row, end_column, end_row });\n}\n\n/**\n * Removes the cells from start_column / start_row to end_column / end_row (PineScript `table.clear`; default end:\n * the start cell), and the merges that start in that range.\n */\nexport function clear(\n table_id: Table,\n start_column: number,\n start_row: number,\n end_column: number = start_column,\n end_row: number = start_row\n): void {\n if (isDeleted(table_id)) return;\n checkCell('table.clear()', table_id, start_column, start_row);\n checkCell('table.clear()', table_id, end_column, end_row);\n const inside = (column: number, row: number): boolean =>\n column >= start_column && column <= end_column && row >= start_row && row <= end_row;\n for (let column = start_column; column <= end_column; column++) {\n for (let row = start_row; row <= end_row; row++) table_id.cells?.delete(key(column, row));\n }\n if (table_id.merges) table_id.merges = table_id.merges.filter((m) => !inside(m.start_column, m.start_row));\n}\n\nfunction setTable<K extends keyof Table>(field: K) {\n return (table_id: Table, value: Table[K]): void => {\n if (isDeleted(table_id)) return;\n table_id[field] = value;\n };\n}\n\n/** Moves the table to another position (`position.*`). */\nexport const set_position = setTable('position');\n/** Sets the background colour of the table. */\nexport const set_bgcolor = setTable('bgcolor');\n/** Sets the colour of the outer frame. */\nexport const set_frame_color = setTable('frame_color');\n/** Sets the width of the outer frame. */\nexport const set_frame_width = setTable('frame_width');\n/** Sets the colour of the cell borders. */\nexport const set_border_color = setTable('border_color');\n/** Sets the width of the cell borders. */\nexport const set_border_width = setTable('border_width');\n\n/** Deletes the table (PineScript `table.delete`). */\nexport function delete_table(table_id: Table): void {\n remove('table', table_id);\n}\n\n/** All live tables, in creation order (PineScript `table.all`). A new array. */\nexport function all(): Table[] {\n return allDrawings('table');\n}\n\n// Alias to match PineScript API\nexport { new_table as new };\nexport { delete_table as delete };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBA,sBAAgE;AAiBzD,SAAS,UACd,UACA,SACA,MACA,SACA,aACA,aACA,cACA,cACA,eACO;AACP,aAAO,0BAAS,SAA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,UAAU,YAAY,UAAU;AAC9D,aAAS,MAAM,WAAW,OAAO,SAAS,MAAO,UAAS,OAAO,OAAO,IAAI,QAAQ,GAAG,CAAC;AAAA,EAC1F;AACA,MAAI,SAAS,OAAQ,UAAS,SAAS,SAAS,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,cAAc,EAAE,SAAS,CAAC;AAC3G;AAEA,SAAS,SAAgC,OAAU;AACjD,SAAO,CAAC,UAAiB,UAA0B;AACjD,YAAI,2BAAU,QAAQ,EAAG;AACzB,aAAS,KAAK,IAAI;AAAA,EACpB;AACF;AAGO,MAAM,eAAe,SAAS,UAAU;AAExC,MAAM,cAAc,SAAS,SAAS;AAEtC,MAAM,kBAAkB,SAAS,aAAa;AAE9C,MAAM,kBAAkB,SAAS,aAAa;AAE9C,MAAM,mBAAmB,SAAS,cAAc;AAEhD,MAAM,mBAAmB,SAAS,cAAc;AAGhD,SAAS,aAAa,UAAuB;AAClD,8BAAO,SAAS,QAAQ;AAC1B;AAGO,SAAS,MAAe;AAC7B,aAAO,gBAAAC,KAAY,OAAO;AAC5B;",
|
|
6
|
+
"names": ["cell", "allDrawings"]
|
|
7
|
+
}
|
package/dist/cjs/text/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Text namespace
|
|
3
|
-
* PineScript `text.format_*` constants for `label.set_text_formatting` and `box.set_text_formatting
|
|
3
|
+
* PineScript `text.format_*` constants for `label.set_text_formatting` and `box.set_text_formatting`, and the
|
|
4
|
+
* `text.align_*` / `text.wrap_*` constants.
|
|
4
5
|
*
|
|
5
|
-
* The values are flags that add up, as in PineScript (`text.format_bold + text.format_italic`).
|
|
6
|
+
* The format values are flags that add up, as in PineScript (`text.format_bold + text.format_italic`).
|
|
6
7
|
* They are the values PineScript uses for drawn labels and boxes.
|
|
7
8
|
*/
|
|
8
9
|
/** No formatting. */
|
|
@@ -11,4 +12,18 @@ export declare const format_none = 0;
|
|
|
11
12
|
export declare const format_bold = 1;
|
|
12
13
|
/** Italic text. */
|
|
13
14
|
export declare const format_italic = 2;
|
|
15
|
+
/** Text aligned to the left (`table.cell`, `box.new`, `label.new` textalign). */
|
|
16
|
+
export declare const align_left: "left";
|
|
17
|
+
/** Text centred horizontally or vertically. */
|
|
18
|
+
export declare const align_center: "center";
|
|
19
|
+
/** Text aligned to the right. */
|
|
20
|
+
export declare const align_right: "right";
|
|
21
|
+
/** Text aligned to the top (`table.cell`, `box.new` text_valign). */
|
|
22
|
+
export declare const align_top: "top";
|
|
23
|
+
/** Text aligned to the bottom. */
|
|
24
|
+
export declare const align_bottom: "bottom";
|
|
25
|
+
/** Text wrapped to the box width (`box.new` text_wrap). */
|
|
26
|
+
export declare const wrap_auto: "auto";
|
|
27
|
+
/** Text not wrapped. */
|
|
28
|
+
export declare const wrap_none: "none";
|
|
14
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/text/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/text/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,qBAAqB;AACrB,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,iBAAiB;AACjB,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,mBAAmB;AACnB,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B,iFAAiF;AACjF,eAAO,MAAM,UAAU,EAAG,MAAe,CAAC;AAC1C,+CAA+C;AAC/C,eAAO,MAAM,YAAY,EAAG,QAAiB,CAAC;AAC9C,iCAAiC;AACjC,eAAO,MAAM,WAAW,EAAG,OAAgB,CAAC;AAC5C,qEAAqE;AACrE,eAAO,MAAM,SAAS,EAAG,KAAc,CAAC;AACxC,kCAAkC;AAClC,eAAO,MAAM,YAAY,EAAG,QAAiB,CAAC;AAC9C,2DAA2D;AAC3D,eAAO,MAAM,SAAS,EAAG,MAAe,CAAC;AACzC,wBAAwB;AACxB,eAAO,MAAM,SAAS,EAAG,MAAe,CAAC"}
|
package/dist/cjs/text/index.js
CHANGED
|
@@ -18,12 +18,26 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var text_exports = {};
|
|
20
20
|
__export(text_exports, {
|
|
21
|
+
align_bottom: () => align_bottom,
|
|
22
|
+
align_center: () => align_center,
|
|
23
|
+
align_left: () => align_left,
|
|
24
|
+
align_right: () => align_right,
|
|
25
|
+
align_top: () => align_top,
|
|
21
26
|
format_bold: () => format_bold,
|
|
22
27
|
format_italic: () => format_italic,
|
|
23
|
-
format_none: () => format_none
|
|
28
|
+
format_none: () => format_none,
|
|
29
|
+
wrap_auto: () => wrap_auto,
|
|
30
|
+
wrap_none: () => wrap_none
|
|
24
31
|
});
|
|
25
32
|
module.exports = __toCommonJS(text_exports);
|
|
26
33
|
const format_none = 0;
|
|
27
34
|
const format_bold = 1;
|
|
28
35
|
const format_italic = 2;
|
|
36
|
+
const align_left = "left";
|
|
37
|
+
const align_center = "center";
|
|
38
|
+
const align_right = "right";
|
|
39
|
+
const align_top = "top";
|
|
40
|
+
const align_bottom = "bottom";
|
|
41
|
+
const wrap_auto = "auto";
|
|
42
|
+
const wrap_none = "none";
|
|
29
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/text/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Text namespace\n * PineScript `text.format_*` constants for `label.set_text_formatting` and `box.set_text_formatting
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["/**\n * Text namespace\n * PineScript `text.format_*` constants for `label.set_text_formatting` and `box.set_text_formatting`, and the\n * `text.align_*` / `text.wrap_*` constants.\n *\n * The format values are flags that add up, as in PineScript (`text.format_bold + text.format_italic`).\n * They are the values PineScript uses for drawn labels and boxes.\n */\n\n/** No formatting. */\nexport const format_none = 0;\n/** Bold text. */\nexport const format_bold = 1;\n/** Italic text. */\nexport const format_italic = 2;\n\n/** Text aligned to the left (`table.cell`, `box.new`, `label.new` textalign). */\nexport const align_left = 'left' as const;\n/** Text centred horizontally or vertically. */\nexport const align_center = 'center' as const;\n/** Text aligned to the right. */\nexport const align_right = 'right' as const;\n/** Text aligned to the top (`table.cell`, `box.new` text_valign). */\nexport const align_top = 'top' as const;\n/** Text aligned to the bottom. */\nexport const align_bottom = 'bottom' as const;\n/** Text wrapped to the box width (`box.new` text_wrap). */\nexport const wrap_auto = 'auto' as const;\n/** Text not wrapped. */\nexport const wrap_none = 'none' as const;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,MAAM,cAAc;AAEpB,MAAM,cAAc;AAEpB,MAAM,gBAAgB;AAGtB,MAAM,aAAa;AAEnB,MAAM,eAAe;AAErB,MAAM,cAAc;AAEpB,MAAM,YAAY;AAElB,MAAM,eAAe;AAErB,MAAM,YAAY;AAElB,MAAM,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* Time zones: "UT", "UTC", "GMT", "+0530", "-05:00", "GMT+5", "UTC-0300", and the RFC 2822
|
|
11
11
|
* names EST, EDT, CST, CDT, MST, MDT, PST, PDT. After a "T" time, only numeric offsets.
|
|
12
12
|
* Without a time the time is 00:00. Without a time zone the time zone is GMT+0.
|
|
13
|
+
* "2025" and "2025-06" are the first day of the year / month. "01 Jan 2022 GMT+3" (a zone without a time) gives na.
|
|
13
14
|
* "24:00" is midnight at the end of the day.
|
|
14
15
|
*
|
|
15
16
|
* "Z", "2024-01-01T09:30:00 GMT", "24:30" and "09:30:60" are compile errors in PineScript, and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datestring.d.ts","sourceRoot":"","sources":["../../../src/time/datestring.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"datestring.d.ts","sourceRoot":"","sources":["../../../src/time/datestring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AA6CH;;;GAGG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAuC1D"}
|