pinets 0.9.28 → 0.9.29
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/dist/pinets.min.browser.es.js +16 -16
- package/dist/pinets.min.browser.es.js.map +1 -1
- package/dist/pinets.min.browser.js +17 -17
- package/dist/pinets.min.browser.js.map +1 -1
- package/dist/pinets.min.cjs +16 -16
- package/dist/pinets.min.cjs.map +1 -1
- package/dist/pinets.min.es.js +17 -17
- package/dist/pinets.min.es.js.map +1 -1
- package/dist/types/Context.class.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/namespaces/Ticker.d.ts +30 -23
- package/dist/types/tickerModifier.d.ts +9 -0
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export type { IProvider, ISymbolInfo, BaseProviderConfig, ApiKeyProviderConfig }
|
|
|
11
11
|
export type { Kline, PeriodType } from './marketData/types';
|
|
12
12
|
export { computeNextPeriodStart, localTimeToUTC, computeSessionClose, TIMEFRAME_SECONDS, TIMEFRAME_PERIOD_INFO } from './marketData/types';
|
|
13
13
|
export { aggregateCandles, selectSubTimeframe, getAggregationRatio } from './marketData/aggregation';
|
|
14
|
+
export { splitTickerModifier, stripTickerModifier, withTickerModifier } from './tickerModifier';
|
|
14
15
|
export { PineTS, Context, Provider, Indicator, PineRuntimeError };
|
|
15
16
|
export type { IPineInput, IPineProp, PineInputType, PineInputDisplay, PinePropType, PreparedScript } from './Indicator';
|
|
16
17
|
export { INDICATOR_PROPS, STRATEGY_PROPS, propsForDeclaration } from './Indicator';
|
|
@@ -4,11 +4,17 @@
|
|
|
4
4
|
* The methods here construct "ticker ID" strings that are passed to
|
|
5
5
|
* `request.security` / `request.security_lower_tf` to fetch data for a
|
|
6
6
|
* specific symbol — potentially with extra modifiers (session,
|
|
7
|
-
* adjustment, non-standard chart type).
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* `
|
|
11
|
-
*
|
|
7
|
+
* adjustment, non-standard chart type).
|
|
8
|
+
*
|
|
9
|
+
* CHART-TYPE modifiers travel as an EXTENDED-TICKER suffix
|
|
10
|
+
* (`"BINANCE:BTCUSDT;heikinashi"` — see `tickerModifier.ts`):
|
|
11
|
+
* `ticker.heikinashi()` appends it, `ticker.standard()` strips it, and
|
|
12
|
+
* `request.security` passes it through to the data source untouched. An
|
|
13
|
+
* embedding host that owns the transform honors it; PineTS' own bundled
|
|
14
|
+
* providers serve standard candles only and strip it at their boundary
|
|
15
|
+
* (documented no-op for standalone use). The other non-standard types
|
|
16
|
+
* (Renko, Kagi, Line Break, Point & Figure) remain plain-symbol stubs —
|
|
17
|
+
* no data source we route to can construct those bars.
|
|
12
18
|
*
|
|
13
19
|
* For the plain "no-modifier" cases — which cover virtually every
|
|
14
20
|
* real-world Pine script — the returned tickerid strings match
|
|
@@ -27,13 +33,14 @@ export declare class Ticker {
|
|
|
27
33
|
*/
|
|
28
34
|
param(source: any, index?: number, _name?: string): any;
|
|
29
35
|
/**
|
|
30
|
-
* ticker.inherit(from_tickerid, symbol) →
|
|
36
|
+
* ticker.inherit(from_tickerid, symbol) → string
|
|
31
37
|
*
|
|
32
|
-
* Returns a ticker ID that uses `symbol` and inherits modifier
|
|
33
|
-
*
|
|
34
|
-
* `
|
|
35
|
-
*
|
|
36
|
-
*
|
|
38
|
+
* Returns a ticker ID that uses `symbol` and inherits modifier settings from
|
|
39
|
+
* `from_tickerid`. The CHART-TYPE modifier is honored: inheriting from a
|
|
40
|
+
* `";heikinashi"` ticker (e.g. `syminfo.tickerid` on a Heikin-Ashi chart)
|
|
41
|
+
* yields `"symbol;heikinashi"`, so the derived request keeps the chart type.
|
|
42
|
+
* The other modifier kinds (session, currency, adjustment) can't be honored
|
|
43
|
+
* without a TV datafeed and are dropped, as before.
|
|
37
44
|
*/
|
|
38
45
|
inherit(_from_tickerid: any, symbol: any): string;
|
|
39
46
|
/**
|
|
@@ -54,22 +61,22 @@ export declare class Ticker {
|
|
|
54
61
|
/**
|
|
55
62
|
* ticker.standard(symbol?) → simple string
|
|
56
63
|
*
|
|
57
|
-
* Returns the symbol stripped of any
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* undefined, falls back to `syminfo.tickerid`.
|
|
64
|
+
* Returns the symbol stripped of any chart-type modifier suffix —
|
|
65
|
+
* on a Heikin-Ashi chart, `ticker.standard(syminfo.tickerid)` turns
|
|
66
|
+
* `"BINANCE:BTCUSDT;heikinashi"` back into `"BINANCE:BTCUSDT"`, so a
|
|
67
|
+
* `request.security` call on the result fetches STANDARD candles.
|
|
68
|
+
* If `symbol` is undefined, falls back to `syminfo.tickerid`.
|
|
62
69
|
*/
|
|
63
70
|
standard(symbol?: any): string;
|
|
64
71
|
/**
|
|
65
|
-
* ticker.heikinashi(symbol) →
|
|
72
|
+
* ticker.heikinashi(symbol) → extended-ticker string
|
|
66
73
|
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
74
|
+
* Returns the symbol with the Heikin-Ashi chart-type modifier
|
|
75
|
+
* appended (`"BINANCE:BTCUSDT;heikinashi"`). `request.security`
|
|
76
|
+
* passes it through to the data source: an embedding host that owns
|
|
77
|
+
* the Heikin-Ashi transform serves derived bars; PineTS' own bundled
|
|
78
|
+
* providers strip the modifier and serve standard candles (documented
|
|
79
|
+
* standalone limitation). Idempotent on already-modified tickers.
|
|
73
80
|
*/
|
|
74
81
|
heikinashi(symbol: any): string;
|
|
75
82
|
/**
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Split `"SYM;modifier"` into its parts. Plain symbols yield `modifier: null`. */
|
|
2
|
+
export declare function splitTickerModifier(tickerId: string): {
|
|
3
|
+
symbol: string;
|
|
4
|
+
modifier: string | null;
|
|
5
|
+
};
|
|
6
|
+
/** The plain symbol with any chart-type modifier removed. */
|
|
7
|
+
export declare function stripTickerModifier(tickerId: string): string;
|
|
8
|
+
/** Append a chart-type modifier (replacing any existing one; idempotent). */
|
|
9
|
+
export declare function withTickerModifier(tickerId: string, modifier: string): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pinets",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.29",
|
|
4
4
|
"description": "Run Pine Script anywhere. PineTS is an open-source transpiler and runtime that brings Pine Script logic to Node.js and the browser with 1:1 syntax compatibility. Reliably write, port, and run indicators or strategies on your own infrastructure.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Pine Script",
|