pinets 0.3.0 → 0.6.1
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 +50 -3
- package/dist/pinets.dev.browser.js +6429 -1434
- package/dist/pinets.dev.cjs +6525 -1418
- package/dist/pinets.dev.cjs.map +1 -1
- package/dist/pinets.dev.es.js +6527 -1415
- package/dist/pinets.dev.es.js.map +1 -1
- package/dist/pinets.min.browser.js +16 -11
- package/dist/pinets.min.cjs +16 -11
- package/dist/pinets.min.es.js +6 -1
- package/dist/types/Context.class.d.ts +79 -17
- package/dist/types/PineTS.class.d.ts +13 -1
- 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 +16 -0
- package/dist/types/namespaces/Log.d.ts +10 -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/from.d.ts +1 -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 +14 -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.d.ts +1 -1
- 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/request/types/barmerge.type.d.ts +7 -0
- package/dist/types/namespaces/request/utils/findLTFContextIdx.d.ts +1 -0
- package/dist/types/namespaces/ta/getters/obv.d.ts +12 -0
- package/dist/types/namespaces/ta/methods/accdist.d.ts +7 -0
- package/dist/types/namespaces/ta/methods/alma.d.ts +18 -0
- package/dist/types/namespaces/ta/methods/atr.d.ts +2 -1
- package/dist/types/namespaces/ta/methods/barssince.d.ts +6 -0
- package/dist/types/namespaces/ta/methods/bb.d.ts +17 -0
- package/dist/types/namespaces/ta/methods/bbw.d.ts +9 -0
- package/dist/types/namespaces/ta/methods/cci.d.ts +20 -0
- package/dist/types/namespaces/ta/methods/cmo.d.ts +17 -0
- package/dist/types/namespaces/ta/methods/cog.d.ts +18 -0
- package/dist/types/namespaces/ta/methods/correlation.d.ts +7 -0
- package/dist/types/namespaces/ta/methods/cross.d.ts +15 -0
- package/dist/types/namespaces/ta/methods/cum.d.ts +14 -0
- package/dist/types/namespaces/ta/methods/dmi.d.ts +24 -0
- package/dist/types/namespaces/ta/methods/falling.d.ts +15 -0
- package/dist/types/namespaces/ta/methods/highestbars.d.ts +7 -0
- package/dist/types/namespaces/ta/methods/iii.d.ts +7 -0
- package/dist/types/namespaces/ta/methods/kc.d.ts +12 -0
- package/dist/types/namespaces/ta/methods/kcw.d.ts +11 -0
- package/dist/types/namespaces/ta/methods/lowestbars.d.ts +7 -0
- package/dist/types/namespaces/ta/methods/macd.d.ts +18 -0
- package/dist/types/namespaces/ta/methods/mfi.d.ts +15 -0
- package/dist/types/namespaces/ta/methods/mode.d.ts +6 -0
- package/dist/types/namespaces/ta/methods/nvi.d.ts +10 -0
- package/dist/types/namespaces/ta/methods/obv.d.ts +12 -0
- package/dist/types/namespaces/ta/methods/percentile_linear_interpolation.d.ts +6 -0
- package/dist/types/namespaces/ta/methods/percentile_nearest_rank.d.ts +7 -0
- package/dist/types/namespaces/ta/methods/percentrank.d.ts +6 -0
- package/dist/types/namespaces/ta/methods/pvi.d.ts +10 -0
- package/dist/types/namespaces/ta/methods/pvt.d.ts +12 -0
- package/dist/types/namespaces/ta/methods/range.d.ts +7 -0
- package/dist/types/namespaces/ta/methods/rising.d.ts +15 -0
- package/dist/types/namespaces/ta/methods/sar.d.ts +12 -0
- package/dist/types/namespaces/ta/methods/stoch.d.ts +21 -0
- package/dist/types/namespaces/ta/methods/supertrend.d.ts +23 -0
- package/dist/types/namespaces/ta/methods/swma.d.ts +14 -0
- package/dist/types/namespaces/ta/methods/tr.d.ts +2 -0
- package/dist/types/namespaces/ta/methods/tsi.d.ts +17 -0
- package/dist/types/namespaces/ta/methods/valuewhen.d.ts +6 -0
- package/dist/types/namespaces/ta/methods/vwap.d.ts +14 -0
- package/dist/types/namespaces/ta/methods/wad.d.ts +11 -0
- package/dist/types/namespaces/ta/methods/wpr.d.ts +17 -0
- package/dist/types/namespaces/ta/methods/wvad.d.ts +7 -0
- package/dist/types/namespaces/ta/ta.index.d.ts +120 -5
- package/dist/types/transpiler/analysis/ScopeManager.d.ts +11 -0
- package/dist/types/transpiler/index.d.ts +4 -1
- package/dist/types/transpiler/settings.d.ts +4 -0
- package/dist/types/transpiler/transformers/InjectionTransformer.d.ts +6 -0
- package/dist/types/transpiler/transformers/MainTransformer.d.ts +4 -1
- package/dist/types/transpiler/transformers/NormalizationTransformer.d.ts +15 -0
- package/dist/types/transpiler/transformers/WrapperTransformer.d.ts +9 -0
- package/dist/types/transpiler/utils/ASTFactory.d.ts +2 -0
- package/dist/types/types/PineTypes.d.ts +11 -0
- package/package.json +6 -4
|
@@ -1,21 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import PineMath from '@pinets/namespaces/math/math.index';
|
|
3
|
-
import { PineRequest } from '@pinets/namespaces/request/request.index';
|
|
4
|
-
import TechnicalAnalysis from '@pinets/namespaces/ta/ta.index';
|
|
1
|
+
import { IProvider, ISymbolInfo } from './marketData/IProvider';
|
|
5
2
|
import { PineArray } from './namespaces/array/array.index';
|
|
6
|
-
import {
|
|
3
|
+
import { PineMap } from './namespaces/map/map.index';
|
|
4
|
+
import { PineMatrix } from './namespaces/matrix/matrix.index';
|
|
5
|
+
import { Barstate } from './namespaces/Barstate';
|
|
6
|
+
import { Input } from './namespaces/input/input.index';
|
|
7
|
+
import PineMath from './namespaces/math/math.index';
|
|
8
|
+
import { PineRequest } from './namespaces/request/request.index';
|
|
9
|
+
import TechnicalAnalysis from './namespaces/ta/ta.index';
|
|
10
|
+
import { Series } from './Series';
|
|
11
|
+
import { Log } from './namespaces/Log';
|
|
12
|
+
import { Str } from './namespaces/Str';
|
|
13
|
+
import { Timeframe } from './namespaces/Timeframe';
|
|
7
14
|
export declare class Context {
|
|
8
15
|
data: any;
|
|
9
16
|
cache: any;
|
|
10
17
|
taState: any;
|
|
18
|
+
isSecondaryContext: boolean;
|
|
11
19
|
NA: any;
|
|
12
|
-
math: PineMath;
|
|
13
|
-
ta: TechnicalAnalysis;
|
|
14
|
-
input: Input;
|
|
15
|
-
request: PineRequest;
|
|
16
|
-
array: PineArray;
|
|
17
|
-
core: any;
|
|
18
20
|
lang: any;
|
|
21
|
+
pine: {
|
|
22
|
+
input: Input;
|
|
23
|
+
ta: TechnicalAnalysis;
|
|
24
|
+
math: PineMath;
|
|
25
|
+
request: PineRequest;
|
|
26
|
+
array: PineArray;
|
|
27
|
+
map: PineMap;
|
|
28
|
+
matrix: PineMatrix;
|
|
29
|
+
na: () => any;
|
|
30
|
+
plotchar: (...args: any[]) => any;
|
|
31
|
+
color: any;
|
|
32
|
+
plot: (...args: any[]) => any;
|
|
33
|
+
nz: (...args: any[]) => any;
|
|
34
|
+
bar_index: number;
|
|
35
|
+
syminfo: ISymbolInfo;
|
|
36
|
+
barstate: Barstate;
|
|
37
|
+
log: Log;
|
|
38
|
+
str: Str;
|
|
39
|
+
timeframe: Timeframe;
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
};
|
|
42
|
+
private static _deprecationWarningsShown;
|
|
19
43
|
idx: number;
|
|
20
44
|
params: any;
|
|
21
45
|
const: any;
|
|
@@ -30,8 +54,9 @@ export declare class Context {
|
|
|
30
54
|
limit: number;
|
|
31
55
|
sDate: number;
|
|
32
56
|
eDate: number;
|
|
57
|
+
fullContext: Context;
|
|
33
58
|
pineTSCode: Function | String;
|
|
34
|
-
constructor({ marketData, source, tickerId, timeframe, limit, sDate, eDate, }: {
|
|
59
|
+
constructor({ marketData, source, tickerId, timeframe, limit, sDate, eDate, fullContext, }: {
|
|
35
60
|
marketData: any;
|
|
36
61
|
source: IProvider | any[];
|
|
37
62
|
tickerId?: string;
|
|
@@ -39,25 +64,34 @@ export declare class Context {
|
|
|
39
64
|
limit?: number;
|
|
40
65
|
sDate?: number;
|
|
41
66
|
eDate?: number;
|
|
67
|
+
fullContext?: Context;
|
|
42
68
|
});
|
|
43
69
|
/**
|
|
44
70
|
* this function is used to initialize the target variable with the source array
|
|
45
71
|
* this array will represent a time series and its values will be shifted at runtime in order to mimic Pine script behavior
|
|
46
72
|
* @param trg - the target variable name : used internally to maintain the series in the execution context
|
|
47
|
-
* @param src - the source data, can be
|
|
73
|
+
* @param src - the source data, can be Series, array, or a single value
|
|
48
74
|
* @param idx - the index of the source array, used to get a sub-series of the source data
|
|
49
|
-
* @returns
|
|
75
|
+
* @returns Series object
|
|
50
76
|
*/
|
|
51
|
-
init(trg: any, src: any, idx?: number):
|
|
77
|
+
init(trg: any, src: any, idx?: number): Series;
|
|
78
|
+
/**
|
|
79
|
+
* Initializes a 'var' variable.
|
|
80
|
+
* - First bar: uses the initial value.
|
|
81
|
+
* - Subsequent bars: maintains the previous value (state).
|
|
82
|
+
* @param trg - The target variable
|
|
83
|
+
* @param src - The source initializer value
|
|
84
|
+
* @returns Series object
|
|
85
|
+
*/
|
|
86
|
+
initVar(trg: any, src: any): Series;
|
|
52
87
|
/**
|
|
53
88
|
* this function is used to set the floating point precision of a number
|
|
54
89
|
* by default it is set to 10 decimals which is the same as pine script
|
|
55
90
|
* @param n - the number to be precision
|
|
56
91
|
* @param decimals - the number of decimals to precision to
|
|
57
|
-
|
|
58
92
|
* @returns the precision number
|
|
59
93
|
*/
|
|
60
|
-
precision(
|
|
94
|
+
precision(value: number, decimals?: number): number;
|
|
61
95
|
/**
|
|
62
96
|
* This function is used to apply special transformation to internal PineTS parameters and handle them as time-series
|
|
63
97
|
* @param source - the source data, can be an array or a single value
|
|
@@ -78,5 +112,33 @@ export declare class Context {
|
|
|
78
112
|
* @param value - The value to set
|
|
79
113
|
*/
|
|
80
114
|
set(target: any, value: any): void;
|
|
115
|
+
/**
|
|
116
|
+
* @deprecated Use context.pine.math instead. This will be removed in a future version.
|
|
117
|
+
*/
|
|
118
|
+
get math(): PineMath;
|
|
119
|
+
/**
|
|
120
|
+
* @deprecated Use context.pine.ta instead. This will be removed in a future version.
|
|
121
|
+
*/
|
|
122
|
+
get ta(): TechnicalAnalysis;
|
|
123
|
+
/**
|
|
124
|
+
* @deprecated Use context.pine.input instead. This will be removed in a future version.
|
|
125
|
+
*/
|
|
126
|
+
get input(): Input;
|
|
127
|
+
/**
|
|
128
|
+
* @deprecated Use context.pine.request instead. This will be removed in a future version.
|
|
129
|
+
*/
|
|
130
|
+
get request(): PineRequest;
|
|
131
|
+
/**
|
|
132
|
+
* @deprecated Use context.pine.array instead. This will be removed in a future version.
|
|
133
|
+
*/
|
|
134
|
+
get array(): PineArray;
|
|
135
|
+
/**
|
|
136
|
+
* @deprecated Use context.pine.* (e.g., context.pine.na, context.pine.plot) instead. This will be removed in a future version.
|
|
137
|
+
*/
|
|
138
|
+
get core(): any;
|
|
139
|
+
/**
|
|
140
|
+
* Shows a deprecation warning once per property access pattern
|
|
141
|
+
*/
|
|
142
|
+
private _showDeprecationWarning;
|
|
81
143
|
}
|
|
82
144
|
export default Context;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { IProvider } from './marketData/IProvider';
|
|
1
2
|
import { Context } from './Context.class';
|
|
2
|
-
|
|
3
|
+
/**
|
|
4
|
+
* This class is a wrapper for the Pine Script language, it allows to run Pine Script code in a JavaScript environment
|
|
5
|
+
*/
|
|
3
6
|
export declare class PineTS {
|
|
4
7
|
private source;
|
|
5
8
|
private tickerId?;
|
|
@@ -16,13 +19,22 @@ export declare class PineTS {
|
|
|
16
19
|
hl2: any;
|
|
17
20
|
hlc3: any;
|
|
18
21
|
ohlc4: any;
|
|
22
|
+
hlcc4: any;
|
|
19
23
|
openTime: any;
|
|
20
24
|
closeTime: any;
|
|
21
25
|
private _readyPromise;
|
|
22
26
|
private _ready;
|
|
27
|
+
private _debugSettings;
|
|
23
28
|
private _transpiledCode;
|
|
24
29
|
get transpiledCode(): Function | String;
|
|
30
|
+
private _isSecondaryContext;
|
|
31
|
+
markAsSecondary(): void;
|
|
32
|
+
private _syminfo;
|
|
25
33
|
constructor(source: IProvider | any[], tickerId?: string, timeframe?: string, limit?: number, sDate?: number, eDate?: number);
|
|
34
|
+
setDebugSettings({ ln, debug }: {
|
|
35
|
+
ln: boolean;
|
|
36
|
+
debug: boolean;
|
|
37
|
+
}): void;
|
|
26
38
|
private loadMarketData;
|
|
27
39
|
ready(): Promise<any>;
|
|
28
40
|
/**
|
|
@@ -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
|
+
}
|
|
@@ -12,12 +12,28 @@ export declare class Core {
|
|
|
12
12
|
black: string;
|
|
13
13
|
gray: string;
|
|
14
14
|
blue: string;
|
|
15
|
+
yellow: string;
|
|
16
|
+
orange: string;
|
|
17
|
+
purple: string;
|
|
18
|
+
pink: string;
|
|
19
|
+
brown: string;
|
|
20
|
+
teal: string;
|
|
21
|
+
cyan: string;
|
|
22
|
+
navy: string;
|
|
23
|
+
indigo: string;
|
|
24
|
+
violet: string;
|
|
25
|
+
magenta: string;
|
|
26
|
+
rose: string;
|
|
27
|
+
gold: string;
|
|
28
|
+
silver: string;
|
|
29
|
+
bronze: string;
|
|
15
30
|
};
|
|
16
31
|
constructor(context: any);
|
|
17
32
|
private extractPlotOptions;
|
|
18
33
|
indicator(title: string, shorttitle?: string, options?: IndicatorOptions): void;
|
|
19
34
|
plotchar(series: number[], title: string, options: PlotCharOptions): void;
|
|
20
35
|
plot(series: any, title: string, options: PlotOptions): void;
|
|
36
|
+
get bar_index(): any;
|
|
21
37
|
na(series: any): boolean;
|
|
22
38
|
nz(series: any, replacement?: number): any;
|
|
23
39
|
}
|
|
@@ -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,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
|
+
pine_screener = "pine_screener",
|
|
78
|
+
price_scale = "price_scale",
|
|
79
|
+
status_line = "status_line"
|
|
80
|
+
}
|
|
81
|
+
declare const types: {
|
|
82
|
+
order: typeof order;
|
|
83
|
+
currency: typeof currency;
|
|
84
|
+
dayofweek: typeof dayofweek;
|
|
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
|
}
|