pinets 0.5.0 → 0.7.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 +150 -35
- package/dist/pinets.min.browser.es.js +117 -0
- package/dist/pinets.min.browser.es.js.map +1 -0
- package/dist/pinets.min.browser.js +96 -15
- package/dist/pinets.min.browser.js.map +1 -0
- package/dist/pinets.min.cjs +96 -14
- package/dist/pinets.min.cjs.map +1 -0
- package/dist/pinets.min.es.js +99 -4
- package/dist/pinets.min.es.js.map +1 -0
- package/dist/types/Context.class.d.ts +7 -13
- package/dist/types/PineTS.class.d.ts +2 -0
- package/dist/types/marketData/Binance/BinanceProvider.class.d.ts +2 -1
- package/dist/types/marketData/IProvider.d.ts +43 -0
- package/dist/types/marketData/Mock/MockProvider.class.d.ts +13 -1
- package/dist/types/namespaces/Barstate.d.ts +13 -0
- package/dist/types/namespaces/Core.d.ts +23 -3
- package/dist/types/namespaces/Log.d.ts +10 -0
- package/dist/types/namespaces/Plot.helper.d.ts +16 -0
- package/dist/types/namespaces/Plots.d.ts +16 -0
- package/dist/types/namespaces/Str.d.ts +23 -0
- package/dist/types/namespaces/Timeframe.d.ts +17 -0
- package/dist/types/namespaces/Types.d.ts +86 -0
- package/dist/types/namespaces/array/PineArrayObject.d.ts +102 -1
- package/dist/types/namespaces/array/array.index.d.ts +1 -129
- package/dist/types/namespaces/array/methods/avg.d.ts +2 -1
- package/dist/types/namespaces/array/methods/binary_search.d.ts +2 -0
- package/dist/types/namespaces/array/methods/binary_search_leftmost.d.ts +2 -0
- package/dist/types/namespaces/array/methods/binary_search_rightmost.d.ts +2 -0
- package/dist/types/namespaces/array/methods/covariance.d.ts +2 -1
- package/dist/types/namespaces/array/methods/every.d.ts +1 -1
- package/dist/types/namespaces/array/methods/fill.d.ts +2 -1
- package/dist/types/namespaces/array/methods/join.d.ts +5 -0
- package/dist/types/namespaces/array/methods/median.d.ts +2 -0
- package/dist/types/namespaces/array/methods/mode.d.ts +2 -0
- package/dist/types/namespaces/array/methods/new.d.ts +2 -1
- package/dist/types/namespaces/array/methods/new_float.d.ts +2 -1
- package/dist/types/namespaces/array/methods/new_int.d.ts +2 -1
- package/dist/types/namespaces/array/methods/percentile_linear_interpolation.d.ts +3 -0
- package/dist/types/namespaces/array/methods/percentile_nearest_rank.d.ts +2 -0
- package/dist/types/namespaces/array/methods/percentrank.d.ts +2 -0
- package/dist/types/namespaces/array/methods/push.d.ts +2 -1
- package/dist/types/namespaces/array/methods/range.d.ts +2 -1
- package/dist/types/namespaces/array/methods/set.d.ts +2 -1
- package/dist/types/namespaces/array/methods/some.d.ts +1 -1
- package/dist/types/namespaces/array/methods/sort.d.ts +2 -1
- package/dist/types/namespaces/array/methods/sort_indices.d.ts +2 -1
- package/dist/types/namespaces/array/methods/stdev.d.ts +2 -1
- package/dist/types/namespaces/array/methods/sum.d.ts +2 -1
- package/dist/types/namespaces/array/methods/unshift.d.ts +2 -1
- package/dist/types/namespaces/array/methods/variance.d.ts +2 -1
- package/dist/types/namespaces/array/utils.d.ts +5 -0
- package/dist/types/namespaces/input/methods/any.d.ts +1 -2
- package/dist/types/namespaces/input/methods/bool.d.ts +1 -2
- package/dist/types/namespaces/input/methods/color.d.ts +1 -2
- package/dist/types/namespaces/input/methods/enum.d.ts +1 -2
- package/dist/types/namespaces/input/methods/float.d.ts +1 -2
- package/dist/types/namespaces/input/methods/int.d.ts +1 -2
- package/dist/types/namespaces/input/methods/param.d.ts +1 -1
- package/dist/types/namespaces/input/methods/price.d.ts +1 -2
- package/dist/types/namespaces/input/methods/session.d.ts +1 -2
- package/dist/types/namespaces/input/methods/source.d.ts +1 -2
- package/dist/types/namespaces/input/methods/string.d.ts +1 -2
- package/dist/types/namespaces/input/methods/symbol.d.ts +1 -2
- package/dist/types/namespaces/input/methods/text_area.d.ts +1 -2
- package/dist/types/namespaces/input/methods/time.d.ts +1 -2
- package/dist/types/namespaces/input/methods/timeframe.d.ts +1 -2
- package/dist/types/namespaces/input/types.d.ts +12 -1
- package/dist/types/namespaces/input/utils.d.ts +2 -0
- package/dist/types/namespaces/map/PineMapObject.d.ts +26 -0
- package/dist/types/namespaces/map/map.index.d.ts +7 -0
- package/dist/types/namespaces/map/methods/clear.d.ts +3 -0
- package/dist/types/namespaces/map/methods/contains.d.ts +3 -0
- package/dist/types/namespaces/map/methods/copy.d.ts +3 -0
- package/dist/types/namespaces/map/methods/get.d.ts +3 -0
- package/dist/types/namespaces/map/methods/keys.d.ts +4 -0
- package/dist/types/namespaces/map/methods/new.d.ts +3 -0
- package/dist/types/namespaces/map/methods/param.d.ts +1 -0
- package/dist/types/namespaces/map/methods/put.d.ts +3 -0
- package/dist/types/namespaces/map/methods/put_all.d.ts +3 -0
- package/dist/types/namespaces/map/methods/remove.d.ts +3 -0
- package/dist/types/namespaces/map/methods/size.d.ts +3 -0
- package/dist/types/namespaces/map/methods/values.d.ts +4 -0
- package/dist/types/namespaces/math/math.index.d.ts +18 -0
- package/dist/types/namespaces/math/methods/abs.d.ts +2 -1
- package/dist/types/namespaces/math/methods/e.d.ts +5 -0
- package/dist/types/namespaces/math/methods/phi.d.ts +5 -0
- package/dist/types/namespaces/math/methods/pi.d.ts +5 -0
- package/dist/types/namespaces/math/methods/round_to_mintick.d.ts +2 -0
- package/dist/types/namespaces/math/methods/rphi.d.ts +5 -0
- package/dist/types/namespaces/math/methods/sign.d.ts +2 -0
- package/dist/types/namespaces/matrix/PineMatrixObject.d.ts +102 -0
- package/dist/types/namespaces/matrix/matrix.index.d.ts +7 -0
- package/dist/types/namespaces/matrix/methods/add_col.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/add_row.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/avg.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/col.d.ts +4 -0
- package/dist/types/namespaces/matrix/methods/columns.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/concat.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/copy.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/det.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/diff.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/eigenvalues.d.ts +4 -0
- package/dist/types/namespaces/matrix/methods/eigenvectors.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/elements_count.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/fill.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/get.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/inv.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_antidiagonal.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_antisymmetric.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_binary.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_diagonal.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_identity.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_square.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_stochastic.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_symmetric.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_triangular.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_zero.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/kron.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/max.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/median.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/min.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/mode.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/mult.d.ts +4 -0
- package/dist/types/namespaces/matrix/methods/new.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/param.d.ts +1 -0
- package/dist/types/namespaces/matrix/methods/pinv.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/pow.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/rank.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/remove_col.d.ts +4 -0
- package/dist/types/namespaces/matrix/methods/remove_row.d.ts +4 -0
- package/dist/types/namespaces/matrix/methods/reshape.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/reverse.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/row.d.ts +4 -0
- package/dist/types/namespaces/matrix/methods/rows.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/set.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/sort.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/submatrix.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/sum.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/swap_columns.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/swap_rows.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/trace.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/transpose.d.ts +3 -0
- package/dist/types/namespaces/request/methods/security_lower_tf.d.ts +9 -0
- package/dist/types/namespaces/request/request.index.d.ts +3 -0
- package/dist/types/namespaces/ta/methods/atr.d.ts +2 -1
- package/dist/types/namespaces/ta/methods/pivothigh.d.ts +1 -1
- package/dist/types/namespaces/ta/methods/pivotlow.d.ts +1 -1
- package/dist/types/namespaces/ta/methods/tr.d.ts +2 -1
- package/dist/types/namespaces/utils.d.ts +12 -0
- package/dist/types/transpiler/index.d.ts +1 -1
- package/dist/types/transpiler/pineToJS/ast.d.ts +167 -0
- package/dist/types/transpiler/pineToJS/codegen.d.ts +53 -0
- package/dist/types/transpiler/pineToJS/lexer.d.ts +31 -0
- package/dist/types/transpiler/pineToJS/parser.d.ts +45 -0
- package/dist/types/transpiler/pineToJS/pineToJS.index.d.ts +32 -0
- package/dist/types/transpiler/pineToJS/tokens.d.ts +34 -0
- package/dist/types/transpiler/settings.d.ts +6 -0
- package/dist/types/transpiler/transformers/WrapperTransformer.d.ts +5 -3
- package/dist/types/transpiler/utils/ASTFactory.d.ts +1 -0
- package/dist/types/types/PineTypes.d.ts +30 -15
- package/package.json +27 -6
- package/dist/pinets.dev.browser.js +0 -13887
- package/dist/pinets.dev.cjs +0 -14024
- package/dist/pinets.dev.cjs.map +0 -1
- package/dist/pinets.dev.es.js +0 -6375
- package/dist/pinets.dev.es.js.map +0 -1
|
@@ -7,23 +7,14 @@ import TechnicalAnalysis from './namespaces/ta/ta.index';
|
|
|
7
7
|
import { Series } from './Series';
|
|
8
8
|
export declare class Context {
|
|
9
9
|
data: any;
|
|
10
|
+
indicator: IndicatorOptions;
|
|
10
11
|
cache: any;
|
|
11
12
|
taState: any;
|
|
12
13
|
isSecondaryContext: boolean;
|
|
13
14
|
NA: any;
|
|
14
15
|
lang: any;
|
|
15
16
|
pine: {
|
|
16
|
-
|
|
17
|
-
ta: TechnicalAnalysis;
|
|
18
|
-
math: PineMath;
|
|
19
|
-
request: PineRequest;
|
|
20
|
-
array: PineArray;
|
|
21
|
-
na: () => any;
|
|
22
|
-
plotchar: (...args: any[]) => any;
|
|
23
|
-
color: any;
|
|
24
|
-
plot: (...args: any[]) => any;
|
|
25
|
-
nz: (...args: any[]) => any;
|
|
26
|
-
bar_index: number;
|
|
17
|
+
[key: string]: any;
|
|
27
18
|
};
|
|
28
19
|
private static _deprecationWarningsShown;
|
|
29
20
|
idx: number;
|
|
@@ -40,8 +31,9 @@ export declare class Context {
|
|
|
40
31
|
limit: number;
|
|
41
32
|
sDate: number;
|
|
42
33
|
eDate: number;
|
|
34
|
+
fullContext: Context;
|
|
43
35
|
pineTSCode: Function | String;
|
|
44
|
-
constructor({ marketData, source, tickerId, timeframe, limit, sDate, eDate, }: {
|
|
36
|
+
constructor({ marketData, source, tickerId, timeframe, limit, sDate, eDate, fullContext, }: {
|
|
45
37
|
marketData: any;
|
|
46
38
|
source: IProvider | any[];
|
|
47
39
|
tickerId?: string;
|
|
@@ -49,7 +41,9 @@ export declare class Context {
|
|
|
49
41
|
limit?: number;
|
|
50
42
|
sDate?: number;
|
|
51
43
|
eDate?: number;
|
|
44
|
+
fullContext?: Context;
|
|
52
45
|
});
|
|
46
|
+
private bindContextObject;
|
|
53
47
|
/**
|
|
54
48
|
* this function is used to initialize the target variable with the source array
|
|
55
49
|
* this array will represent a time series and its values will be shifted at runtime in order to mimic Pine script behavior
|
|
@@ -75,7 +69,7 @@ export declare class Context {
|
|
|
75
69
|
* @param decimals - the number of decimals to precision to
|
|
76
70
|
* @returns the precision number
|
|
77
71
|
*/
|
|
78
|
-
precision(
|
|
72
|
+
precision(value: number, decimals?: number): number;
|
|
79
73
|
/**
|
|
80
74
|
* This function is used to apply special transformation to internal PineTS parameters and handle them as time-series
|
|
81
75
|
* @param source - the source data, can be an array or a single value
|
|
@@ -19,6 +19,7 @@ export declare class PineTS {
|
|
|
19
19
|
hl2: any;
|
|
20
20
|
hlc3: any;
|
|
21
21
|
ohlc4: any;
|
|
22
|
+
hlcc4: any;
|
|
22
23
|
openTime: any;
|
|
23
24
|
closeTime: any;
|
|
24
25
|
private _readyPromise;
|
|
@@ -28,6 +29,7 @@ export declare class PineTS {
|
|
|
28
29
|
get transpiledCode(): Function | String;
|
|
29
30
|
private _isSecondaryContext;
|
|
30
31
|
markAsSecondary(): void;
|
|
32
|
+
private _syminfo;
|
|
31
33
|
constructor(source: IProvider | any[], tickerId?: string, timeframe?: string, limit?: number, sDate?: number, eDate?: number);
|
|
32
34
|
setDebugSettings({ ln, debug }: {
|
|
33
35
|
ln: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IProvider } from '@pinets/marketData/IProvider';
|
|
1
|
+
import { IProvider, ISymbolInfo } from '@pinets/marketData/IProvider';
|
|
2
2
|
export declare class BinanceProvider implements IProvider {
|
|
3
3
|
private cacheManager;
|
|
4
4
|
constructor();
|
|
@@ -8,4 +8,5 @@ export declare class BinanceProvider implements IProvider {
|
|
|
8
8
|
* Determines if pagination is needed based on the parameters
|
|
9
9
|
*/
|
|
10
10
|
private shouldPaginate;
|
|
11
|
+
getSymbolInfo(tickerId: string): Promise<ISymbolInfo>;
|
|
11
12
|
}
|
|
@@ -1,3 +1,46 @@
|
|
|
1
|
+
export type ISymbolInfo = {
|
|
2
|
+
current_contract: string;
|
|
3
|
+
description: string;
|
|
4
|
+
isin: string;
|
|
5
|
+
main_tickerid: string;
|
|
6
|
+
prefix: string;
|
|
7
|
+
root: string;
|
|
8
|
+
ticker: string;
|
|
9
|
+
tickerid: string;
|
|
10
|
+
type: string;
|
|
11
|
+
basecurrency: string;
|
|
12
|
+
country: string;
|
|
13
|
+
currency: string;
|
|
14
|
+
timezone: string;
|
|
15
|
+
employees: number;
|
|
16
|
+
industry: string;
|
|
17
|
+
sector: string;
|
|
18
|
+
shareholders: number;
|
|
19
|
+
shares_outstanding_float: number;
|
|
20
|
+
shares_outstanding_total: number;
|
|
21
|
+
expiration_date: number;
|
|
22
|
+
session: string;
|
|
23
|
+
volumetype: string;
|
|
24
|
+
mincontract: number;
|
|
25
|
+
minmove: number;
|
|
26
|
+
mintick: number;
|
|
27
|
+
pointvalue: number;
|
|
28
|
+
pricescale: number;
|
|
29
|
+
recommendations_buy: number;
|
|
30
|
+
recommendations_buy_strong: number;
|
|
31
|
+
recommendations_date: number;
|
|
32
|
+
recommendations_hold: number;
|
|
33
|
+
recommendations_sell: number;
|
|
34
|
+
recommendations_sell_strong: number;
|
|
35
|
+
recommendations_total: number;
|
|
36
|
+
target_price_average: number;
|
|
37
|
+
target_price_date: number;
|
|
38
|
+
target_price_estimates: number;
|
|
39
|
+
target_price_high: number;
|
|
40
|
+
target_price_low: number;
|
|
41
|
+
target_price_median: number;
|
|
42
|
+
};
|
|
1
43
|
export interface IProvider {
|
|
2
44
|
getMarketData(tickerId: string, timeframe: string, limit?: number, sDate?: number, eDate?: number): Promise<any>;
|
|
45
|
+
getSymbolInfo(tickerId: string): Promise<ISymbolInfo>;
|
|
3
46
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IProvider } from '@pinets/marketData/IProvider';
|
|
1
|
+
import { IProvider, ISymbolInfo } from '@pinets/marketData/IProvider';
|
|
2
2
|
interface Kline {
|
|
3
3
|
openTime: number;
|
|
4
4
|
open: number;
|
|
@@ -32,6 +32,7 @@ interface Kline {
|
|
|
32
32
|
*/
|
|
33
33
|
export declare class MockProvider implements IProvider {
|
|
34
34
|
private dataCache;
|
|
35
|
+
private exchangeInfoCache;
|
|
35
36
|
private readonly dataDirectory;
|
|
36
37
|
constructor(dataDirectory?: string);
|
|
37
38
|
/**
|
|
@@ -65,6 +66,17 @@ export declare class MockProvider implements IProvider {
|
|
|
65
66
|
* @returns Promise<Kline[]> - Array of candle data
|
|
66
67
|
*/
|
|
67
68
|
getMarketData(tickerId: string, timeframe: string, limit?: number, sDate?: number, eDate?: number): Promise<Kline[]>;
|
|
69
|
+
/**
|
|
70
|
+
* Loads exchange info from JSON file
|
|
71
|
+
*/
|
|
72
|
+
private loadExchangeInfo;
|
|
73
|
+
/**
|
|
74
|
+
* Implements IProvider.getSymbolInfo
|
|
75
|
+
*
|
|
76
|
+
* @param tickerId - Symbol name (e.g., 'BTCUSDT' or 'BTCUSDT.P')
|
|
77
|
+
* @returns Promise<ISymbolInfo> - Symbol information
|
|
78
|
+
*/
|
|
79
|
+
getSymbolInfo(tickerId: string): Promise<ISymbolInfo>;
|
|
68
80
|
/**
|
|
69
81
|
* Clears the data cache
|
|
70
82
|
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class Barstate {
|
|
2
|
+
private context;
|
|
3
|
+
private _live;
|
|
4
|
+
constructor(context: any);
|
|
5
|
+
setLive(): void;
|
|
6
|
+
get isnew(): boolean;
|
|
7
|
+
get islast(): boolean;
|
|
8
|
+
get isfirst(): boolean;
|
|
9
|
+
get ishistory(): boolean;
|
|
10
|
+
get isrealtime(): boolean;
|
|
11
|
+
get isconfirmed(): boolean;
|
|
12
|
+
get islastconfirmedhistory(): boolean;
|
|
13
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function parseIndicatorOptions(args: any[]): Partial<IndicatorOptions>;
|
|
1
2
|
export declare class Core {
|
|
2
3
|
private context;
|
|
3
4
|
color: {
|
|
@@ -12,13 +13,32 @@ export declare class Core {
|
|
|
12
13
|
black: string;
|
|
13
14
|
gray: string;
|
|
14
15
|
blue: string;
|
|
16
|
+
yellow: string;
|
|
17
|
+
orange: string;
|
|
18
|
+
purple: string;
|
|
19
|
+
pink: string;
|
|
20
|
+
brown: string;
|
|
21
|
+
teal: string;
|
|
22
|
+
cyan: string;
|
|
23
|
+
navy: string;
|
|
24
|
+
indigo: string;
|
|
25
|
+
violet: string;
|
|
26
|
+
magenta: string;
|
|
27
|
+
rose: string;
|
|
28
|
+
gold: string;
|
|
29
|
+
silver: string;
|
|
30
|
+
bronze: string;
|
|
15
31
|
};
|
|
16
32
|
constructor(context: any);
|
|
17
33
|
private extractPlotOptions;
|
|
18
|
-
indicator(
|
|
19
|
-
plotchar(series: number[], title: string, options: PlotCharOptions): void;
|
|
20
|
-
plot(series: any, title: string, options: PlotOptions): void;
|
|
34
|
+
indicator(...args: any[]): any;
|
|
21
35
|
get bar_index(): any;
|
|
22
36
|
na(series: any): boolean;
|
|
23
37
|
nz(series: any, replacement?: number): any;
|
|
38
|
+
fixnan(series: any): any;
|
|
39
|
+
alertcondition(condition: any, title: any, message: any): void;
|
|
40
|
+
bool(series: any): boolean;
|
|
41
|
+
int(series: any): number;
|
|
42
|
+
float(series: any): number;
|
|
43
|
+
string(series: any): any;
|
|
24
44
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Context } from '..';
|
|
2
|
+
export declare class Log {
|
|
3
|
+
private context;
|
|
4
|
+
constructor(context: Context);
|
|
5
|
+
private logFormat;
|
|
6
|
+
param(source: any, index?: number, name?: string): any;
|
|
7
|
+
warning(message: string, ...args: any[]): void;
|
|
8
|
+
error(message: string, ...args: any[]): void;
|
|
9
|
+
info(message: string, ...args: any[]): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class PlotHelper {
|
|
2
|
+
private context;
|
|
3
|
+
constructor(context: any);
|
|
4
|
+
private extractPlotOptions;
|
|
5
|
+
plotchar(series: number[], title: string, options: PlotCharOptions): void;
|
|
6
|
+
plot(...args: any[]): void;
|
|
7
|
+
}
|
|
8
|
+
export declare class HlineHelper {
|
|
9
|
+
private context;
|
|
10
|
+
constructor(context: any);
|
|
11
|
+
get style_dashed(): string;
|
|
12
|
+
get style_solid(): string;
|
|
13
|
+
get style_dotted(): string;
|
|
14
|
+
param(source: any, index?: number, name?: string): any;
|
|
15
|
+
any(price: any, title: any, color: any, linestyle: any, linewidth: any, editable: any, display: any): any;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class PlotHelper {
|
|
2
|
+
private context;
|
|
3
|
+
constructor(context: any);
|
|
4
|
+
private extractPlotOptions;
|
|
5
|
+
plotchar(series: number[], title: string, options: PlotCharOptions): void;
|
|
6
|
+
plot(...args: any[]): void;
|
|
7
|
+
}
|
|
8
|
+
export declare class HlineHelper {
|
|
9
|
+
private context;
|
|
10
|
+
constructor(context: any);
|
|
11
|
+
get style_dashed(): string;
|
|
12
|
+
get style_solid(): string;
|
|
13
|
+
get style_dotted(): string;
|
|
14
|
+
param(source: any, index?: number, name?: string): any;
|
|
15
|
+
any(price: any, title: any, color: any, linestyle: any, linewidth: any, editable: any, display: any): any;
|
|
16
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Context } from '..';
|
|
2
|
+
export declare class Str {
|
|
3
|
+
private context;
|
|
4
|
+
constructor(context: Context);
|
|
5
|
+
param(source: any, index?: number, name?: string): any;
|
|
6
|
+
tostring(value: any): string;
|
|
7
|
+
tonumber(value: any): number;
|
|
8
|
+
lower(value: string): string;
|
|
9
|
+
upper(value: string): string;
|
|
10
|
+
trim(value: string): string;
|
|
11
|
+
repeat(source: string, repeat: number, separator?: string): string;
|
|
12
|
+
replace_all(source: string, target: string, replacement: string): string;
|
|
13
|
+
replace(source: string, target: string, replacement: string, occurrence?: number): string;
|
|
14
|
+
contains(source: string, target: string): boolean;
|
|
15
|
+
endswith(source: string, target: string): boolean;
|
|
16
|
+
startswith(source: string, target: string): boolean;
|
|
17
|
+
pos(source: string, target: string): number;
|
|
18
|
+
length(source: string): number;
|
|
19
|
+
match(source: string, pattern: string): RegExpMatchArray;
|
|
20
|
+
split(source: string, separator: string): string[][];
|
|
21
|
+
substring(source: string, begin_pos: number, end_pos: number): string;
|
|
22
|
+
format(message: string, ...args: any[]): string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class Timeframe {
|
|
2
|
+
private context;
|
|
3
|
+
constructor(context: any);
|
|
4
|
+
param(source: any, index?: number, name?: string): any;
|
|
5
|
+
get main_period(): any;
|
|
6
|
+
get period(): any;
|
|
7
|
+
get multiplier(): number;
|
|
8
|
+
get isdwm(): boolean;
|
|
9
|
+
get isdaily(): boolean;
|
|
10
|
+
get isweekly(): boolean;
|
|
11
|
+
get ismonthly(): boolean;
|
|
12
|
+
get isseconds(): boolean;
|
|
13
|
+
get isminutes(): boolean;
|
|
14
|
+
get isintraday(): boolean;
|
|
15
|
+
from_seconds(seconds: number): string | number;
|
|
16
|
+
in_seconds(timeframe: string): number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export declare enum order {
|
|
2
|
+
ascending = 1,
|
|
3
|
+
descending = 0
|
|
4
|
+
}
|
|
5
|
+
export declare enum currency {
|
|
6
|
+
AED = "AED",
|
|
7
|
+
ARS = "ARS",
|
|
8
|
+
AUD = "AUD",
|
|
9
|
+
BDT = "BDT",
|
|
10
|
+
BHD = "BHD",
|
|
11
|
+
BRL = "BRL",
|
|
12
|
+
BTC = "BTC",
|
|
13
|
+
CAD = "CAD",
|
|
14
|
+
CHF = "CHF",
|
|
15
|
+
CLP = "CLP",
|
|
16
|
+
CNY = "CNY",
|
|
17
|
+
COP = "COP",
|
|
18
|
+
CZK = "CZK",
|
|
19
|
+
DKK = "DKK",
|
|
20
|
+
EGP = "EGP",
|
|
21
|
+
ETH = "ETH",
|
|
22
|
+
EUR = "EUR",
|
|
23
|
+
GBP = "GBP",
|
|
24
|
+
HKD = "HKD",
|
|
25
|
+
HUF = "HUF",
|
|
26
|
+
IDR = "IDR",
|
|
27
|
+
ILS = "ILS",
|
|
28
|
+
INR = "INR",
|
|
29
|
+
ISK = "ISK",
|
|
30
|
+
JPY = "JPY",
|
|
31
|
+
KES = "KES",
|
|
32
|
+
KRW = "KRW",
|
|
33
|
+
KWD = "KWD",
|
|
34
|
+
LKR = "LKR",
|
|
35
|
+
MAD = "MAD",
|
|
36
|
+
MXN = "MXN",
|
|
37
|
+
MYR = "MYR",
|
|
38
|
+
NGN = "NGN",
|
|
39
|
+
NOK = "NOK",
|
|
40
|
+
NONE = "NONE",
|
|
41
|
+
NZD = "NZD",
|
|
42
|
+
PEN = "PEN",
|
|
43
|
+
PHP = "PHP",
|
|
44
|
+
PKR = "PKR",
|
|
45
|
+
PLN = "PLN",
|
|
46
|
+
QAR = "QAR",
|
|
47
|
+
RON = "RON",
|
|
48
|
+
RSD = "RSD",
|
|
49
|
+
RUB = "RUB",
|
|
50
|
+
SAR = "SAR",
|
|
51
|
+
SEK = "SEK",
|
|
52
|
+
SGD = "SGD",
|
|
53
|
+
THB = "THB",
|
|
54
|
+
TND = "TND",
|
|
55
|
+
TRY = "TRY",
|
|
56
|
+
TWD = "TWD",
|
|
57
|
+
USD = "USD",
|
|
58
|
+
USDT = "USDT",
|
|
59
|
+
VES = "VES",
|
|
60
|
+
VND = "VND",
|
|
61
|
+
ZAR = "ZAR"
|
|
62
|
+
}
|
|
63
|
+
export declare enum dayofweek {
|
|
64
|
+
sunday = 1,
|
|
65
|
+
monday = 2,
|
|
66
|
+
tuesday = 3,
|
|
67
|
+
wednesday = 4,
|
|
68
|
+
thursday = 5,
|
|
69
|
+
friday = 6,
|
|
70
|
+
saturday = 7
|
|
71
|
+
}
|
|
72
|
+
export declare enum display {
|
|
73
|
+
all = "all",
|
|
74
|
+
data_window = "data_window",
|
|
75
|
+
none = "none",
|
|
76
|
+
pane = "pane",
|
|
77
|
+
price_scale = "price_scale",
|
|
78
|
+
status_line = "status_line"
|
|
79
|
+
}
|
|
80
|
+
declare const types: {
|
|
81
|
+
order: typeof order;
|
|
82
|
+
currency: typeof currency;
|
|
83
|
+
dayofweek: typeof dayofweek;
|
|
84
|
+
display: typeof display;
|
|
85
|
+
};
|
|
86
|
+
export default types;
|
|
@@ -1,5 +1,106 @@
|
|
|
1
|
+
export declare enum PineArrayType {
|
|
2
|
+
any = "",
|
|
3
|
+
box = "box",
|
|
4
|
+
bool = "bool",
|
|
5
|
+
color = "color",
|
|
6
|
+
float = "float",
|
|
7
|
+
int = "int",
|
|
8
|
+
label = "label",
|
|
9
|
+
line = "line",
|
|
10
|
+
linefill = "linefill",
|
|
11
|
+
string = "string",
|
|
12
|
+
table = "table"
|
|
13
|
+
}
|
|
1
14
|
export declare class PineArrayObject {
|
|
2
15
|
array: any;
|
|
3
|
-
|
|
16
|
+
type: PineArrayType;
|
|
17
|
+
context: any;
|
|
18
|
+
private _abs;
|
|
19
|
+
private _avg;
|
|
20
|
+
private _binary_search;
|
|
21
|
+
private _binary_search_leftmost;
|
|
22
|
+
private _binary_search_rightmost;
|
|
23
|
+
private _clear;
|
|
24
|
+
private _concat;
|
|
25
|
+
private _copy;
|
|
26
|
+
private _covariance;
|
|
27
|
+
private _every;
|
|
28
|
+
private _fill;
|
|
29
|
+
private _first;
|
|
30
|
+
private _get;
|
|
31
|
+
private _includes;
|
|
32
|
+
private _indexof;
|
|
33
|
+
private _insert;
|
|
34
|
+
private _join;
|
|
35
|
+
private _last;
|
|
36
|
+
private _lastindexof;
|
|
37
|
+
private _max;
|
|
38
|
+
private _median;
|
|
39
|
+
private _min;
|
|
40
|
+
private _mode;
|
|
41
|
+
private _percentile_linear_interpolation;
|
|
42
|
+
private _percentile_nearest_rank;
|
|
43
|
+
private _percentrank;
|
|
44
|
+
private _pop;
|
|
45
|
+
private _push;
|
|
46
|
+
private _range;
|
|
47
|
+
private _remove;
|
|
48
|
+
private _reverse;
|
|
49
|
+
private _set;
|
|
50
|
+
private _shift;
|
|
51
|
+
private _size;
|
|
52
|
+
private _slice;
|
|
53
|
+
private _some;
|
|
54
|
+
private _sort;
|
|
55
|
+
private _sort_indices;
|
|
56
|
+
private _standardize;
|
|
57
|
+
private _stdev;
|
|
58
|
+
private _sum;
|
|
59
|
+
private _unshift;
|
|
60
|
+
private _variance;
|
|
61
|
+
constructor(array: any, type: PineArrayType, context: any);
|
|
4
62
|
toString(): string;
|
|
63
|
+
abs(...args: any[]): any;
|
|
64
|
+
avg(...args: any[]): any;
|
|
65
|
+
binary_search(...args: any[]): any;
|
|
66
|
+
binary_search_leftmost(...args: any[]): any;
|
|
67
|
+
binary_search_rightmost(...args: any[]): any;
|
|
68
|
+
clear(...args: any[]): any;
|
|
69
|
+
concat(...args: any[]): any;
|
|
70
|
+
copy(...args: any[]): any;
|
|
71
|
+
covariance(...args: any[]): any;
|
|
72
|
+
every(...args: any[]): any;
|
|
73
|
+
fill(...args: any[]): any;
|
|
74
|
+
first(...args: any[]): any;
|
|
75
|
+
get(...args: any[]): any;
|
|
76
|
+
includes(...args: any[]): any;
|
|
77
|
+
indexof(...args: any[]): any;
|
|
78
|
+
insert(...args: any[]): any;
|
|
79
|
+
join(...args: any[]): any;
|
|
80
|
+
last(...args: any[]): any;
|
|
81
|
+
lastindexof(...args: any[]): any;
|
|
82
|
+
max(...args: any[]): any;
|
|
83
|
+
median(...args: any[]): any;
|
|
84
|
+
min(...args: any[]): any;
|
|
85
|
+
mode(...args: any[]): any;
|
|
86
|
+
percentile_linear_interpolation(...args: any[]): any;
|
|
87
|
+
percentile_nearest_rank(...args: any[]): any;
|
|
88
|
+
percentrank(...args: any[]): any;
|
|
89
|
+
pop(...args: any[]): any;
|
|
90
|
+
push(...args: any[]): any;
|
|
91
|
+
range(...args: any[]): any;
|
|
92
|
+
remove(...args: any[]): any;
|
|
93
|
+
reverse(...args: any[]): any;
|
|
94
|
+
set(...args: any[]): any;
|
|
95
|
+
shift(...args: any[]): any;
|
|
96
|
+
size(...args: any[]): any;
|
|
97
|
+
slice(...args: any[]): any;
|
|
98
|
+
some(...args: any[]): any;
|
|
99
|
+
sort(...args: any[]): any;
|
|
100
|
+
sort_indices(...args: any[]): any;
|
|
101
|
+
standardize(...args: any[]): any;
|
|
102
|
+
stdev(...args: any[]): any;
|
|
103
|
+
sum(...args: any[]): any;
|
|
104
|
+
unshift(...args: any[]): any;
|
|
105
|
+
variance(...args: any[]): any;
|
|
5
106
|
}
|
|
@@ -1,135 +1,7 @@
|
|
|
1
1
|
export { PineArrayObject } from './PineArrayObject';
|
|
2
|
-
import { abs } from './methods/abs';
|
|
3
|
-
import { avg } from './methods/avg';
|
|
4
|
-
import { clear } from './methods/clear';
|
|
5
|
-
import { concat } from './methods/concat';
|
|
6
|
-
import { copy } from './methods/copy';
|
|
7
|
-
import { covariance } from './methods/covariance';
|
|
8
|
-
import { every } from './methods/every';
|
|
9
|
-
import { fill } from './methods/fill';
|
|
10
|
-
import { first } from './methods/first';
|
|
11
|
-
import { from } from './methods/from';
|
|
12
|
-
import { get } from './methods/get';
|
|
13
|
-
import { includes } from './methods/includes';
|
|
14
|
-
import { indexof } from './methods/indexof';
|
|
15
|
-
import { insert } from './methods/insert';
|
|
16
|
-
import { join } from './methods/join';
|
|
17
|
-
import { last } from './methods/last';
|
|
18
|
-
import { lastindexof } from './methods/lastindexof';
|
|
19
|
-
import { max } from './methods/max';
|
|
20
|
-
import { min } from './methods/min';
|
|
21
|
-
import { new_fn } from './methods/new';
|
|
22
|
-
import { new_bool } from './methods/new_bool';
|
|
23
|
-
import { new_float } from './methods/new_float';
|
|
24
|
-
import { new_int } from './methods/new_int';
|
|
25
|
-
import { new_string } from './methods/new_string';
|
|
26
|
-
import { param } from './methods/param';
|
|
27
|
-
import { pop } from './methods/pop';
|
|
28
|
-
import { push } from './methods/push';
|
|
29
|
-
import { range } from './methods/range';
|
|
30
|
-
import { remove } from './methods/remove';
|
|
31
|
-
import { reverse } from './methods/reverse';
|
|
32
|
-
import { set } from './methods/set';
|
|
33
|
-
import { shift } from './methods/shift';
|
|
34
|
-
import { size } from './methods/size';
|
|
35
|
-
import { slice } from './methods/slice';
|
|
36
|
-
import { some } from './methods/some';
|
|
37
|
-
import { sort } from './methods/sort';
|
|
38
|
-
import { sort_indices } from './methods/sort_indices';
|
|
39
|
-
import { standardize } from './methods/standardize';
|
|
40
|
-
import { stdev } from './methods/stdev';
|
|
41
|
-
import { sum } from './methods/sum';
|
|
42
|
-
import { unshift } from './methods/unshift';
|
|
43
|
-
import { variance } from './methods/variance';
|
|
44
|
-
declare const methods: {
|
|
45
|
-
abs: typeof abs;
|
|
46
|
-
avg: typeof avg;
|
|
47
|
-
clear: typeof clear;
|
|
48
|
-
concat: typeof concat;
|
|
49
|
-
copy: typeof copy;
|
|
50
|
-
covariance: typeof covariance;
|
|
51
|
-
every: typeof every;
|
|
52
|
-
fill: typeof fill;
|
|
53
|
-
first: typeof first;
|
|
54
|
-
from: typeof from;
|
|
55
|
-
get: typeof get;
|
|
56
|
-
includes: typeof includes;
|
|
57
|
-
indexof: typeof indexof;
|
|
58
|
-
insert: typeof insert;
|
|
59
|
-
join: typeof join;
|
|
60
|
-
last: typeof last;
|
|
61
|
-
lastindexof: typeof lastindexof;
|
|
62
|
-
max: typeof max;
|
|
63
|
-
min: typeof min;
|
|
64
|
-
new: typeof new_fn;
|
|
65
|
-
new_bool: typeof new_bool;
|
|
66
|
-
new_float: typeof new_float;
|
|
67
|
-
new_int: typeof new_int;
|
|
68
|
-
new_string: typeof new_string;
|
|
69
|
-
param: typeof param;
|
|
70
|
-
pop: typeof pop;
|
|
71
|
-
push: typeof push;
|
|
72
|
-
range: typeof range;
|
|
73
|
-
remove: typeof remove;
|
|
74
|
-
reverse: typeof reverse;
|
|
75
|
-
set: typeof set;
|
|
76
|
-
shift: typeof shift;
|
|
77
|
-
size: typeof size;
|
|
78
|
-
slice: typeof slice;
|
|
79
|
-
some: typeof some;
|
|
80
|
-
sort: typeof sort;
|
|
81
|
-
sort_indices: typeof sort_indices;
|
|
82
|
-
standardize: typeof standardize;
|
|
83
|
-
stdev: typeof stdev;
|
|
84
|
-
sum: typeof sum;
|
|
85
|
-
unshift: typeof unshift;
|
|
86
|
-
variance: typeof variance;
|
|
87
|
-
};
|
|
88
2
|
export declare class PineArray {
|
|
89
3
|
private context;
|
|
90
|
-
|
|
91
|
-
abs: ReturnType<typeof methods.abs>;
|
|
92
|
-
avg: ReturnType<typeof methods.avg>;
|
|
93
|
-
clear: ReturnType<typeof methods.clear>;
|
|
94
|
-
concat: ReturnType<typeof methods.concat>;
|
|
95
|
-
copy: ReturnType<typeof methods.copy>;
|
|
96
|
-
covariance: ReturnType<typeof methods.covariance>;
|
|
97
|
-
every: ReturnType<typeof methods.every>;
|
|
98
|
-
fill: ReturnType<typeof methods.fill>;
|
|
99
|
-
first: ReturnType<typeof methods.first>;
|
|
100
|
-
from: ReturnType<typeof methods.from>;
|
|
101
|
-
get: ReturnType<typeof methods.get>;
|
|
102
|
-
includes: ReturnType<typeof methods.includes>;
|
|
103
|
-
indexof: ReturnType<typeof methods.indexof>;
|
|
104
|
-
insert: ReturnType<typeof methods.insert>;
|
|
105
|
-
join: ReturnType<typeof methods.join>;
|
|
106
|
-
last: ReturnType<typeof methods.last>;
|
|
107
|
-
lastindexof: ReturnType<typeof methods.lastindexof>;
|
|
108
|
-
max: ReturnType<typeof methods.max>;
|
|
109
|
-
min: ReturnType<typeof methods.min>;
|
|
110
|
-
new: ReturnType<typeof methods.new>;
|
|
111
|
-
new_bool: ReturnType<typeof methods.new_bool>;
|
|
112
|
-
new_float: ReturnType<typeof methods.new_float>;
|
|
113
|
-
new_int: ReturnType<typeof methods.new_int>;
|
|
114
|
-
new_string: ReturnType<typeof methods.new_string>;
|
|
115
|
-
param: ReturnType<typeof methods.param>;
|
|
116
|
-
pop: ReturnType<typeof methods.pop>;
|
|
117
|
-
push: ReturnType<typeof methods.push>;
|
|
118
|
-
range: ReturnType<typeof methods.range>;
|
|
119
|
-
remove: ReturnType<typeof methods.remove>;
|
|
120
|
-
reverse: ReturnType<typeof methods.reverse>;
|
|
121
|
-
set: ReturnType<typeof methods.set>;
|
|
122
|
-
shift: ReturnType<typeof methods.shift>;
|
|
123
|
-
size: ReturnType<typeof methods.size>;
|
|
124
|
-
slice: ReturnType<typeof methods.slice>;
|
|
125
|
-
some: ReturnType<typeof methods.some>;
|
|
126
|
-
sort: ReturnType<typeof methods.sort>;
|
|
127
|
-
sort_indices: ReturnType<typeof methods.sort_indices>;
|
|
128
|
-
standardize: ReturnType<typeof methods.standardize>;
|
|
129
|
-
stdev: ReturnType<typeof methods.stdev>;
|
|
130
|
-
sum: ReturnType<typeof methods.sum>;
|
|
131
|
-
unshift: ReturnType<typeof methods.unshift>;
|
|
132
|
-
variance: ReturnType<typeof methods.variance>;
|
|
4
|
+
[key: string]: any;
|
|
133
5
|
constructor(context: any);
|
|
134
6
|
}
|
|
135
7
|
export default PineArray;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { PineArrayObject } from '../PineArrayObject';
|
|
2
|
-
|
|
2
|
+
import { Context } from '../../../Context.class';
|
|
3
|
+
export declare function covariance(context: Context): (arr1: PineArrayObject, arr2: PineArrayObject, biased?: boolean) => number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PineArrayObject } from '../PineArrayObject';
|
|
2
|
-
export declare function every(context: any): (id: PineArrayObject
|
|
2
|
+
export declare function every(context: any): (id: PineArrayObject) => boolean;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { PineArrayObject } from '../PineArrayObject';
|
|
2
|
-
|
|
2
|
+
import { Context } from '../../../Context.class';
|
|
3
|
+
export declare function fill(context: Context): (id: PineArrayObject, value: any, start?: number, end?: number) => void;
|