pinets 0.5.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.
Files changed (147) hide show
  1. package/README.md +47 -3
  2. package/dist/pinets.dev.browser.js +3019 -391
  3. package/dist/pinets.dev.cjs +3106 -365
  4. package/dist/pinets.dev.cjs.map +1 -1
  5. package/dist/pinets.dev.es.js +3110 -360
  6. package/dist/pinets.dev.es.js.map +1 -1
  7. package/dist/pinets.min.browser.js +15 -14
  8. package/dist/pinets.min.cjs +15 -14
  9. package/dist/pinets.min.es.js +5 -4
  10. package/dist/types/Context.class.d.ts +19 -3
  11. package/dist/types/PineTS.class.d.ts +2 -0
  12. package/dist/types/marketData/Binance/BinanceProvider.class.d.ts +2 -1
  13. package/dist/types/marketData/IProvider.d.ts +43 -0
  14. package/dist/types/marketData/Mock/MockProvider.class.d.ts +13 -1
  15. package/dist/types/namespaces/Barstate.d.ts +13 -0
  16. package/dist/types/namespaces/Core.d.ts +15 -0
  17. package/dist/types/namespaces/Log.d.ts +10 -0
  18. package/dist/types/namespaces/Str.d.ts +23 -0
  19. package/dist/types/namespaces/Timeframe.d.ts +17 -0
  20. package/dist/types/namespaces/Types.d.ts +86 -0
  21. package/dist/types/namespaces/array/PineArrayObject.d.ts +102 -1
  22. package/dist/types/namespaces/array/array.index.d.ts +1 -129
  23. package/dist/types/namespaces/array/methods/avg.d.ts +2 -1
  24. package/dist/types/namespaces/array/methods/binary_search.d.ts +2 -0
  25. package/dist/types/namespaces/array/methods/binary_search_leftmost.d.ts +2 -0
  26. package/dist/types/namespaces/array/methods/binary_search_rightmost.d.ts +2 -0
  27. package/dist/types/namespaces/array/methods/covariance.d.ts +2 -1
  28. package/dist/types/namespaces/array/methods/every.d.ts +1 -1
  29. package/dist/types/namespaces/array/methods/fill.d.ts +2 -1
  30. package/dist/types/namespaces/array/methods/join.d.ts +5 -0
  31. package/dist/types/namespaces/array/methods/median.d.ts +2 -0
  32. package/dist/types/namespaces/array/methods/mode.d.ts +2 -0
  33. package/dist/types/namespaces/array/methods/new.d.ts +2 -1
  34. package/dist/types/namespaces/array/methods/new_float.d.ts +2 -1
  35. package/dist/types/namespaces/array/methods/new_int.d.ts +2 -1
  36. package/dist/types/namespaces/array/methods/percentile_linear_interpolation.d.ts +3 -0
  37. package/dist/types/namespaces/array/methods/percentile_nearest_rank.d.ts +2 -0
  38. package/dist/types/namespaces/array/methods/percentrank.d.ts +2 -0
  39. package/dist/types/namespaces/array/methods/push.d.ts +2 -1
  40. package/dist/types/namespaces/array/methods/range.d.ts +2 -1
  41. package/dist/types/namespaces/array/methods/set.d.ts +2 -1
  42. package/dist/types/namespaces/array/methods/some.d.ts +1 -1
  43. package/dist/types/namespaces/array/methods/sort.d.ts +2 -1
  44. package/dist/types/namespaces/array/methods/sort_indices.d.ts +2 -1
  45. package/dist/types/namespaces/array/methods/stdev.d.ts +2 -1
  46. package/dist/types/namespaces/array/methods/sum.d.ts +2 -1
  47. package/dist/types/namespaces/array/methods/unshift.d.ts +2 -1
  48. package/dist/types/namespaces/array/methods/variance.d.ts +2 -1
  49. package/dist/types/namespaces/array/utils.d.ts +5 -0
  50. package/dist/types/namespaces/input/methods/any.d.ts +1 -2
  51. package/dist/types/namespaces/input/methods/bool.d.ts +1 -2
  52. package/dist/types/namespaces/input/methods/color.d.ts +1 -2
  53. package/dist/types/namespaces/input/methods/enum.d.ts +1 -2
  54. package/dist/types/namespaces/input/methods/float.d.ts +1 -2
  55. package/dist/types/namespaces/input/methods/int.d.ts +1 -2
  56. package/dist/types/namespaces/input/methods/param.d.ts +1 -1
  57. package/dist/types/namespaces/input/methods/price.d.ts +1 -2
  58. package/dist/types/namespaces/input/methods/session.d.ts +1 -2
  59. package/dist/types/namespaces/input/methods/source.d.ts +1 -2
  60. package/dist/types/namespaces/input/methods/string.d.ts +1 -2
  61. package/dist/types/namespaces/input/methods/symbol.d.ts +1 -2
  62. package/dist/types/namespaces/input/methods/text_area.d.ts +1 -2
  63. package/dist/types/namespaces/input/methods/time.d.ts +1 -2
  64. package/dist/types/namespaces/input/methods/timeframe.d.ts +1 -2
  65. package/dist/types/namespaces/input/types.d.ts +12 -1
  66. package/dist/types/namespaces/input/utils.d.ts +14 -0
  67. package/dist/types/namespaces/map/PineMapObject.d.ts +26 -0
  68. package/dist/types/namespaces/map/map.index.d.ts +7 -0
  69. package/dist/types/namespaces/map/methods/clear.d.ts +3 -0
  70. package/dist/types/namespaces/map/methods/contains.d.ts +3 -0
  71. package/dist/types/namespaces/map/methods/copy.d.ts +3 -0
  72. package/dist/types/namespaces/map/methods/get.d.ts +3 -0
  73. package/dist/types/namespaces/map/methods/keys.d.ts +4 -0
  74. package/dist/types/namespaces/map/methods/new.d.ts +3 -0
  75. package/dist/types/namespaces/map/methods/param.d.ts +1 -0
  76. package/dist/types/namespaces/map/methods/put.d.ts +3 -0
  77. package/dist/types/namespaces/map/methods/put_all.d.ts +3 -0
  78. package/dist/types/namespaces/map/methods/remove.d.ts +3 -0
  79. package/dist/types/namespaces/map/methods/size.d.ts +3 -0
  80. package/dist/types/namespaces/map/methods/values.d.ts +4 -0
  81. package/dist/types/namespaces/math/math.index.d.ts +18 -0
  82. package/dist/types/namespaces/math/methods/abs.d.ts +2 -1
  83. package/dist/types/namespaces/math/methods/e.d.ts +5 -0
  84. package/dist/types/namespaces/math/methods/phi.d.ts +5 -0
  85. package/dist/types/namespaces/math/methods/pi.d.ts +5 -0
  86. package/dist/types/namespaces/math/methods/round_to_mintick.d.ts +2 -0
  87. package/dist/types/namespaces/math/methods/rphi.d.ts +5 -0
  88. package/dist/types/namespaces/math/methods/sign.d.ts +2 -0
  89. package/dist/types/namespaces/matrix/PineMatrixObject.d.ts +102 -0
  90. package/dist/types/namespaces/matrix/matrix.index.d.ts +7 -0
  91. package/dist/types/namespaces/matrix/methods/add_col.d.ts +3 -0
  92. package/dist/types/namespaces/matrix/methods/add_row.d.ts +3 -0
  93. package/dist/types/namespaces/matrix/methods/avg.d.ts +3 -0
  94. package/dist/types/namespaces/matrix/methods/col.d.ts +4 -0
  95. package/dist/types/namespaces/matrix/methods/columns.d.ts +3 -0
  96. package/dist/types/namespaces/matrix/methods/concat.d.ts +3 -0
  97. package/dist/types/namespaces/matrix/methods/copy.d.ts +3 -0
  98. package/dist/types/namespaces/matrix/methods/det.d.ts +3 -0
  99. package/dist/types/namespaces/matrix/methods/diff.d.ts +3 -0
  100. package/dist/types/namespaces/matrix/methods/eigenvalues.d.ts +4 -0
  101. package/dist/types/namespaces/matrix/methods/eigenvectors.d.ts +3 -0
  102. package/dist/types/namespaces/matrix/methods/elements_count.d.ts +3 -0
  103. package/dist/types/namespaces/matrix/methods/fill.d.ts +3 -0
  104. package/dist/types/namespaces/matrix/methods/get.d.ts +3 -0
  105. package/dist/types/namespaces/matrix/methods/inv.d.ts +3 -0
  106. package/dist/types/namespaces/matrix/methods/is_antidiagonal.d.ts +3 -0
  107. package/dist/types/namespaces/matrix/methods/is_antisymmetric.d.ts +3 -0
  108. package/dist/types/namespaces/matrix/methods/is_binary.d.ts +3 -0
  109. package/dist/types/namespaces/matrix/methods/is_diagonal.d.ts +3 -0
  110. package/dist/types/namespaces/matrix/methods/is_identity.d.ts +3 -0
  111. package/dist/types/namespaces/matrix/methods/is_square.d.ts +3 -0
  112. package/dist/types/namespaces/matrix/methods/is_stochastic.d.ts +3 -0
  113. package/dist/types/namespaces/matrix/methods/is_symmetric.d.ts +3 -0
  114. package/dist/types/namespaces/matrix/methods/is_triangular.d.ts +3 -0
  115. package/dist/types/namespaces/matrix/methods/is_zero.d.ts +3 -0
  116. package/dist/types/namespaces/matrix/methods/kron.d.ts +3 -0
  117. package/dist/types/namespaces/matrix/methods/max.d.ts +3 -0
  118. package/dist/types/namespaces/matrix/methods/median.d.ts +3 -0
  119. package/dist/types/namespaces/matrix/methods/min.d.ts +3 -0
  120. package/dist/types/namespaces/matrix/methods/mode.d.ts +3 -0
  121. package/dist/types/namespaces/matrix/methods/mult.d.ts +4 -0
  122. package/dist/types/namespaces/matrix/methods/new.d.ts +3 -0
  123. package/dist/types/namespaces/matrix/methods/param.d.ts +1 -0
  124. package/dist/types/namespaces/matrix/methods/pinv.d.ts +3 -0
  125. package/dist/types/namespaces/matrix/methods/pow.d.ts +3 -0
  126. package/dist/types/namespaces/matrix/methods/rank.d.ts +3 -0
  127. package/dist/types/namespaces/matrix/methods/remove_col.d.ts +4 -0
  128. package/dist/types/namespaces/matrix/methods/remove_row.d.ts +4 -0
  129. package/dist/types/namespaces/matrix/methods/reshape.d.ts +3 -0
  130. package/dist/types/namespaces/matrix/methods/reverse.d.ts +3 -0
  131. package/dist/types/namespaces/matrix/methods/row.d.ts +4 -0
  132. package/dist/types/namespaces/matrix/methods/rows.d.ts +3 -0
  133. package/dist/types/namespaces/matrix/methods/set.d.ts +3 -0
  134. package/dist/types/namespaces/matrix/methods/sort.d.ts +3 -0
  135. package/dist/types/namespaces/matrix/methods/submatrix.d.ts +3 -0
  136. package/dist/types/namespaces/matrix/methods/sum.d.ts +3 -0
  137. package/dist/types/namespaces/matrix/methods/swap_columns.d.ts +3 -0
  138. package/dist/types/namespaces/matrix/methods/swap_rows.d.ts +3 -0
  139. package/dist/types/namespaces/matrix/methods/trace.d.ts +3 -0
  140. package/dist/types/namespaces/matrix/methods/transpose.d.ts +3 -0
  141. package/dist/types/namespaces/request/methods/security_lower_tf.d.ts +9 -0
  142. package/dist/types/namespaces/request/request.index.d.ts +3 -0
  143. package/dist/types/namespaces/ta/methods/atr.d.ts +2 -1
  144. package/dist/types/namespaces/ta/methods/tr.d.ts +2 -1
  145. package/dist/types/transpiler/settings.d.ts +4 -0
  146. package/dist/types/types/PineTypes.d.ts +11 -0
  147. package/package.json +6 -4
@@ -1,10 +1,16 @@
1
- import { IProvider } from './marketData/IProvider';
1
+ import { IProvider, ISymbolInfo } from './marketData/IProvider';
2
2
  import { PineArray } from './namespaces/array/array.index';
3
+ import { PineMap } from './namespaces/map/map.index';
4
+ import { PineMatrix } from './namespaces/matrix/matrix.index';
5
+ import { Barstate } from './namespaces/Barstate';
3
6
  import { Input } from './namespaces/input/input.index';
4
7
  import PineMath from './namespaces/math/math.index';
5
8
  import { PineRequest } from './namespaces/request/request.index';
6
9
  import TechnicalAnalysis from './namespaces/ta/ta.index';
7
10
  import { Series } from './Series';
11
+ import { Log } from './namespaces/Log';
12
+ import { Str } from './namespaces/Str';
13
+ import { Timeframe } from './namespaces/Timeframe';
8
14
  export declare class Context {
9
15
  data: any;
10
16
  cache: any;
@@ -18,12 +24,20 @@ export declare class Context {
18
24
  math: PineMath;
19
25
  request: PineRequest;
20
26
  array: PineArray;
27
+ map: PineMap;
28
+ matrix: PineMatrix;
21
29
  na: () => any;
22
30
  plotchar: (...args: any[]) => any;
23
31
  color: any;
24
32
  plot: (...args: any[]) => any;
25
33
  nz: (...args: any[]) => any;
26
34
  bar_index: number;
35
+ syminfo: ISymbolInfo;
36
+ barstate: Barstate;
37
+ log: Log;
38
+ str: Str;
39
+ timeframe: Timeframe;
40
+ [key: string]: any;
27
41
  };
28
42
  private static _deprecationWarningsShown;
29
43
  idx: number;
@@ -40,8 +54,9 @@ export declare class Context {
40
54
  limit: number;
41
55
  sDate: number;
42
56
  eDate: number;
57
+ fullContext: Context;
43
58
  pineTSCode: Function | String;
44
- constructor({ marketData, source, tickerId, timeframe, limit, sDate, eDate, }: {
59
+ constructor({ marketData, source, tickerId, timeframe, limit, sDate, eDate, fullContext, }: {
45
60
  marketData: any;
46
61
  source: IProvider | any[];
47
62
  tickerId?: string;
@@ -49,6 +64,7 @@ export declare class Context {
49
64
  limit?: number;
50
65
  sDate?: number;
51
66
  eDate?: number;
67
+ fullContext?: Context;
52
68
  });
53
69
  /**
54
70
  * this function is used to initialize the target variable with the source array
@@ -75,7 +91,7 @@ export declare class Context {
75
91
  * @param decimals - the number of decimals to precision to
76
92
  * @returns the precision number
77
93
  */
78
- precision(n: number, decimals?: number): number;
94
+ precision(value: number, decimals?: number): number;
79
95
  /**
80
96
  * This function is used to apply special transformation to internal PineTS parameters and handle them as time-series
81
97
  * @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
+ }
@@ -12,6 +12,21 @@ 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;
@@ -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
- constructor(array: any);
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
- private _cache;
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
- export declare function avg(context: any): (id: PineArrayObject) => number;
2
+ import { Context } from '../../../Context.class';
3
+ export declare function avg(context: Context): (id: PineArrayObject) => number;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function binary_search(context: any): (id: PineArrayObject, value: any) => number;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function binary_search_leftmost(context: any): (id: PineArrayObject, value: any) => number;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function binary_search_rightmost(context: any): (id: PineArrayObject, value: any) => number;
@@ -1,2 +1,3 @@
1
1
  import { PineArrayObject } from '../PineArrayObject';
2
- export declare function covariance(context: any): (arr1: PineArrayObject, arr2: PineArrayObject, biased?: boolean) => number;
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, callback: (val: any) => boolean) => boolean;
2
+ export declare function every(context: any): (id: PineArrayObject) => boolean;
@@ -1,2 +1,3 @@
1
1
  import { PineArrayObject } from '../PineArrayObject';
2
- export declare function fill(context: any): (id: PineArrayObject, value: any, start?: number, end?: number) => void;
2
+ import { Context } from '../../../Context.class';
3
+ export declare function fill(context: Context): (id: PineArrayObject, value: any, start?: number, end?: number) => void;
@@ -1,2 +1,7 @@
1
1
  import { PineArrayObject } from '../PineArrayObject';
2
+ /**
3
+ * Joins the elements of the array into a string, separated by the separator.
4
+ * @param context - The context of the array.
5
+ * @returns The string of the joined elements.
6
+ */
2
7
  export declare function join(context: any): (id: PineArrayObject, separator?: string) => string;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function median(context: any): (id: PineArrayObject) => any;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function mode(context: any): (id: PineArrayObject) => any;
@@ -1,2 +1,3 @@
1
1
  import { PineArrayObject } from '../PineArrayObject';
2
- export declare function new_fn(context: any): <T>(size: number, initial_value: T) => PineArrayObject;
2
+ import { Context } from '../../../Context.class';
3
+ export declare function new_fn(context: Context): <T>(size: number, initial_value: T) => PineArrayObject;
@@ -1,2 +1,3 @@
1
1
  import { PineArrayObject } from '../PineArrayObject';
2
- export declare function new_float(context: any): (size: number, initial_value?: number) => PineArrayObject;
2
+ import { Context } from '../../../Context.class';
3
+ export declare function new_float(context: Context): (size: number, initial_value?: number) => PineArrayObject;
@@ -1,2 +1,3 @@
1
1
  import { PineArrayObject } from '../PineArrayObject';
2
- export declare function new_int(context: any): (size: number, initial_value?: number) => PineArrayObject;
2
+ import { Context } from '../../../Context.class';
3
+ export declare function new_int(context: Context): (size: number, initial_value?: number) => PineArrayObject;