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
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
export declare class PineMatrixObject {
|
|
2
|
+
context: any;
|
|
3
|
+
matrix: any[][];
|
|
4
|
+
private _add_col;
|
|
5
|
+
private _add_row;
|
|
6
|
+
private _avg;
|
|
7
|
+
private _col;
|
|
8
|
+
private _columns;
|
|
9
|
+
private _concat;
|
|
10
|
+
private _copy;
|
|
11
|
+
private _det;
|
|
12
|
+
private _diff;
|
|
13
|
+
private _eigenvalues;
|
|
14
|
+
private _eigenvectors;
|
|
15
|
+
private _elements_count;
|
|
16
|
+
private _fill;
|
|
17
|
+
private _get;
|
|
18
|
+
private _inv;
|
|
19
|
+
private _is_antidiagonal;
|
|
20
|
+
private _is_antisymmetric;
|
|
21
|
+
private _is_binary;
|
|
22
|
+
private _is_diagonal;
|
|
23
|
+
private _is_identity;
|
|
24
|
+
private _is_square;
|
|
25
|
+
private _is_stochastic;
|
|
26
|
+
private _is_symmetric;
|
|
27
|
+
private _is_triangular;
|
|
28
|
+
private _is_zero;
|
|
29
|
+
private _kron;
|
|
30
|
+
private _max;
|
|
31
|
+
private _median;
|
|
32
|
+
private _min;
|
|
33
|
+
private _mode;
|
|
34
|
+
private _mult;
|
|
35
|
+
private _pinv;
|
|
36
|
+
private _pow;
|
|
37
|
+
private _rank;
|
|
38
|
+
private _remove_col;
|
|
39
|
+
private _remove_row;
|
|
40
|
+
private _reshape;
|
|
41
|
+
private _reverse;
|
|
42
|
+
private _row;
|
|
43
|
+
private _rows;
|
|
44
|
+
private _set;
|
|
45
|
+
private _sort;
|
|
46
|
+
private _submatrix;
|
|
47
|
+
private _sum;
|
|
48
|
+
private _swap_columns;
|
|
49
|
+
private _swap_rows;
|
|
50
|
+
private _trace;
|
|
51
|
+
private _transpose;
|
|
52
|
+
constructor(rows: number, cols: number, initialValue: any, context: any);
|
|
53
|
+
toString(): string;
|
|
54
|
+
add_col(...args: any[]): any;
|
|
55
|
+
add_row(...args: any[]): any;
|
|
56
|
+
avg(...args: any[]): any;
|
|
57
|
+
col(...args: any[]): any;
|
|
58
|
+
columns(...args: any[]): any;
|
|
59
|
+
concat(...args: any[]): any;
|
|
60
|
+
copy(...args: any[]): any;
|
|
61
|
+
det(...args: any[]): any;
|
|
62
|
+
diff(...args: any[]): any;
|
|
63
|
+
eigenvalues(...args: any[]): any;
|
|
64
|
+
eigenvectors(...args: any[]): any;
|
|
65
|
+
elements_count(...args: any[]): any;
|
|
66
|
+
fill(...args: any[]): any;
|
|
67
|
+
get(...args: any[]): any;
|
|
68
|
+
inv(...args: any[]): any;
|
|
69
|
+
is_antidiagonal(...args: any[]): any;
|
|
70
|
+
is_antisymmetric(...args: any[]): any;
|
|
71
|
+
is_binary(...args: any[]): any;
|
|
72
|
+
is_diagonal(...args: any[]): any;
|
|
73
|
+
is_identity(...args: any[]): any;
|
|
74
|
+
is_square(...args: any[]): any;
|
|
75
|
+
is_stochastic(...args: any[]): any;
|
|
76
|
+
is_symmetric(...args: any[]): any;
|
|
77
|
+
is_triangular(...args: any[]): any;
|
|
78
|
+
is_zero(...args: any[]): any;
|
|
79
|
+
kron(...args: any[]): any;
|
|
80
|
+
max(...args: any[]): any;
|
|
81
|
+
median(...args: any[]): any;
|
|
82
|
+
min(...args: any[]): any;
|
|
83
|
+
mode(...args: any[]): any;
|
|
84
|
+
mult(...args: any[]): any;
|
|
85
|
+
pinv(...args: any[]): any;
|
|
86
|
+
pow(...args: any[]): any;
|
|
87
|
+
rank(...args: any[]): any;
|
|
88
|
+
remove_col(...args: any[]): any;
|
|
89
|
+
remove_row(...args: any[]): any;
|
|
90
|
+
reshape(...args: any[]): any;
|
|
91
|
+
reverse(...args: any[]): any;
|
|
92
|
+
row(...args: any[]): any;
|
|
93
|
+
rows(...args: any[]): any;
|
|
94
|
+
set(...args: any[]): any;
|
|
95
|
+
sort(...args: any[]): any;
|
|
96
|
+
submatrix(...args: any[]): any;
|
|
97
|
+
sum(...args: any[]): any;
|
|
98
|
+
swap_columns(...args: any[]): any;
|
|
99
|
+
swap_rows(...args: any[]): any;
|
|
100
|
+
trace(...args: any[]): any;
|
|
101
|
+
transpose(...args: any[]): any;
|
|
102
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PineMatrixObject } from '../PineMatrixObject';
|
|
2
|
+
import { Context } from '../../../Context.class';
|
|
3
|
+
import { PineArrayObject } from '../../array/PineArrayObject';
|
|
4
|
+
export declare function col(context: Context): (id: PineMatrixObject, column: number) => PineArrayObject;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PineMatrixObject } from '../PineMatrixObject';
|
|
2
|
+
import { Context } from '../../../Context.class';
|
|
3
|
+
import { PineArrayObject } from '../../array/PineArrayObject';
|
|
4
|
+
export declare function mult(context: Context): (id: PineMatrixObject, id2: PineMatrixObject | number | PineArrayObject) => PineMatrixObject;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function param(context: any): (source: any, index?: number) => any;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PineMatrixObject } from '../PineMatrixObject';
|
|
2
|
+
import { Context } from '../../../Context.class';
|
|
3
|
+
import { PineArrayObject } from '../../array/PineArrayObject';
|
|
4
|
+
export declare function remove_col(context: Context): (id: PineMatrixObject, column_index: number) => PineArrayObject;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PineMatrixObject } from '../PineMatrixObject';
|
|
2
|
+
import { Context } from '../../../Context.class';
|
|
3
|
+
import { PineArrayObject } from '../../array/PineArrayObject';
|
|
4
|
+
export declare function remove_row(context: Context): (id: PineMatrixObject, row_index: number) => PineArrayObject;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PineMatrixObject } from '../PineMatrixObject';
|
|
2
|
+
import { Context } from '../../../Context.class';
|
|
3
|
+
import { PineArrayObject } from '../../array/PineArrayObject';
|
|
4
|
+
export declare function row(context: Context): (id: PineMatrixObject, row: number) => PineArrayObject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function security(context: any): (symbol: any, timeframe: any, expression: any, gaps?: boolean, lookahead?: boolean, ignore_invalid_symbol?: boolean, currency?: any, calc_bars_count?: any) => Promise<any>;
|
|
1
|
+
export declare function security(context: any): (symbol: any, timeframe: any, expression: any, gaps?: boolean | any[], lookahead?: boolean | any[], ignore_invalid_symbol?: boolean, currency?: any, calc_bars_count?: any) => Promise<any>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Requests the results of an expression from a specified symbol on a timeframe lower than or equal to the chart's timeframe.
|
|
3
|
+
* It returns an array containing one element for each lower-timeframe bar within the chart bar.
|
|
4
|
+
* On a 5-minute chart, requesting data using a timeframe argument of "1" typically returns an array with five elements representing
|
|
5
|
+
* the value of the expression on each 1-minute bar, ordered by time with the earliest value first.
|
|
6
|
+
* @param context
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare function security_lower_tf(context: any): (symbol: any, timeframe: any, expression: any, ignore_invalid_symbol?: boolean | any[], currency?: any, ignore_invalid_timeframe?: boolean | any[], calc_bars_count?: number | any[]) => Promise<any>;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { param } from './methods/param';
|
|
2
2
|
import { security } from './methods/security';
|
|
3
|
+
import { security_lower_tf } from './methods/security_lower_tf';
|
|
3
4
|
declare const methods: {
|
|
4
5
|
param: typeof param;
|
|
5
6
|
security: typeof security;
|
|
7
|
+
security_lower_tf: typeof security_lower_tf;
|
|
6
8
|
};
|
|
7
9
|
export declare class PineRequest {
|
|
8
10
|
private context;
|
|
9
11
|
private _cache;
|
|
10
12
|
param: ReturnType<typeof methods.param>;
|
|
11
13
|
security: ReturnType<typeof methods.security>;
|
|
14
|
+
security_lower_tf: ReturnType<typeof methods.security_lower_tf>;
|
|
12
15
|
constructor(context: any);
|
|
13
16
|
}
|
|
14
17
|
export default PineRequest;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function findLTFContextIdx(myOpenTime: number, myCloseTime: number, openTime: number[], closeTime: number[], lookahead?: boolean, mainContextEDate?: number, gaps?: boolean): number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* On-Balance Volume (OBV)
|
|
3
|
+
* Cumulative indicator that adds volume on up days and subtracts on down days
|
|
4
|
+
*
|
|
5
|
+
* Logic:
|
|
6
|
+
* - If close > close[1]: OBV = OBV[1] + volume
|
|
7
|
+
* - If close < close[1]: OBV = OBV[1] - volume
|
|
8
|
+
* - If close == close[1]: OBV = OBV[1]
|
|
9
|
+
*
|
|
10
|
+
* Note: OBV starts at 0 on the first bar (when there's no previous close to compare)
|
|
11
|
+
*/
|
|
12
|
+
export declare function obv(context: any): () => any;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ALMA - Arnaud Legoux Moving Average
|
|
3
|
+
*
|
|
4
|
+
* ALMA uses a Gaussian distribution to weight the moving average,
|
|
5
|
+
* reducing lag while maintaining smoothness.
|
|
6
|
+
*
|
|
7
|
+
* @param source - The data source (typically close price)
|
|
8
|
+
* @param period - The number of periods (window size)
|
|
9
|
+
* @param offset - Position of Gaussian peak (0-1, default 0.85). Higher = more responsive
|
|
10
|
+
* @param sigma - Width of Gaussian curve (default 6). Higher = smoother
|
|
11
|
+
*
|
|
12
|
+
* Formula:
|
|
13
|
+
* - m = offset * (period - 1)
|
|
14
|
+
* - s = period / sigma
|
|
15
|
+
* - weight[i] = exp(-((i - m)^2) / (2 * s^2))
|
|
16
|
+
* - ALMA = sum(weight[i] * price[i]) / sum(weight[i])
|
|
17
|
+
*/
|
|
18
|
+
export declare function alma(context: any): (source: any, _period: any, _offset: any, _sigma: any, _callId?: string) => any;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { Series } from '../../../Series';
|
|
2
|
+
export declare function atr(context: any): (length: number) => Series;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bollinger Bands (BB)
|
|
3
|
+
*
|
|
4
|
+
* Bollinger Bands are volatility bands placed above and below a moving average.
|
|
5
|
+
* Volatility is based on the standard deviation, which changes as volatility increases and decreases.
|
|
6
|
+
*
|
|
7
|
+
* Formula:
|
|
8
|
+
* - Middle Band = SMA(source, length)
|
|
9
|
+
* - Upper Band = Middle Band + (multiplier × Standard Deviation)
|
|
10
|
+
* - Lower Band = Middle Band - (multiplier × Standard Deviation)
|
|
11
|
+
*
|
|
12
|
+
* @param source - The data source (typically close price)
|
|
13
|
+
* @param length - The period for SMA and standard deviation (default 20)
|
|
14
|
+
* @param mult - The multiplier for standard deviation (default 2)
|
|
15
|
+
* @returns [upper, middle, lower]
|
|
16
|
+
*/
|
|
17
|
+
export declare function bb(context: any): (source: any, _length: any, _mult: any, _callId?: string) => any[][];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bollinger Bands Width (BBW)
|
|
3
|
+
*
|
|
4
|
+
* Formula:
|
|
5
|
+
* basis = ta.sma(source, length)
|
|
6
|
+
* dev = mult * ta.stdev(source, length)
|
|
7
|
+
* bbw = (((basis + dev) - (basis - dev)) / basis) * 100
|
|
8
|
+
*/
|
|
9
|
+
export declare function bbw(context: any): (source: any, _length: any, _mult: any, _callId?: string) => any;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Commodity Channel Index (CCI)
|
|
3
|
+
*
|
|
4
|
+
* CCI measures the deviation of the price from its average price.
|
|
5
|
+
* It's used to identify cyclical trends and overbought/oversold conditions.
|
|
6
|
+
*
|
|
7
|
+
* Formula:
|
|
8
|
+
* - Typical Price (TP) = (high + low + close) / 3
|
|
9
|
+
* - CCI = (TP - SMA(TP, length)) / (0.015 × Mean Deviation)
|
|
10
|
+
* - Mean Deviation = Average of |TP - SMA(TP)| over length periods
|
|
11
|
+
*
|
|
12
|
+
* @param source - Source series (typically close price, but can be any price)
|
|
13
|
+
* @param length - Number of bars back (lookback period)
|
|
14
|
+
* @returns CCI value
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* - Returns NaN during initialization period (when not enough data)
|
|
18
|
+
* - The constant 0.015 ensures approximately 70-80% of values fall between -100 and +100
|
|
19
|
+
*/
|
|
20
|
+
export declare function cci(context: any): (source: any, _length: any, _callId?: string) => any;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chande Momentum Oscillator (CMO)
|
|
3
|
+
*
|
|
4
|
+
* Calculates the difference between the sum of recent gains and the sum of recent losses
|
|
5
|
+
* and then divides the result by the sum of all price movement over the same period.
|
|
6
|
+
*
|
|
7
|
+
* Pine Script Formula:
|
|
8
|
+
* mom = change(src)
|
|
9
|
+
* sm1 = sum((mom >= 0) ? mom : 0.0, length)
|
|
10
|
+
* sm2 = sum((mom >= 0) ? 0.0 : -mom, length)
|
|
11
|
+
* cmo = 100 * (sm1 - sm2) / (sm1 + sm2)
|
|
12
|
+
*
|
|
13
|
+
* @param source - Source series (typically close)
|
|
14
|
+
* @param length - Number of bars (lookback period)
|
|
15
|
+
* @returns CMO value (-100 to +100)
|
|
16
|
+
*/
|
|
17
|
+
export declare function cmo(context: any): (source: any, _length: any, _callId?: string) => any;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Center of Gravity (COG)
|
|
3
|
+
*
|
|
4
|
+
* The cog (center of gravity) is an indicator based on statistics and the Fibonacci golden ratio.
|
|
5
|
+
*
|
|
6
|
+
* Pine Script Formula:
|
|
7
|
+
* sum = sum(source, length)
|
|
8
|
+
* num = 0.0
|
|
9
|
+
* for i = 0 to length - 1
|
|
10
|
+
* price = source[i]
|
|
11
|
+
* num = num + price * (i + 1)
|
|
12
|
+
* cog = -num / sum
|
|
13
|
+
*
|
|
14
|
+
* @param source - Source series (typically close)
|
|
15
|
+
* @param length - Number of bars (lookback period)
|
|
16
|
+
* @returns Center of Gravity value
|
|
17
|
+
*/
|
|
18
|
+
export declare function cog(context: any): (source: any, _length: any, _callId?: string) => any;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Correlation Coefficient
|
|
3
|
+
*
|
|
4
|
+
* Describes the degree to which two series tend to deviate from their ta.sma() values.
|
|
5
|
+
* r = cov(X, Y) / (stdev(X) * stdev(Y))
|
|
6
|
+
*/
|
|
7
|
+
export declare function correlation(context: any): (source1: any, source2: any, _length: any, _callId?: string) => any;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross Detection
|
|
3
|
+
*
|
|
4
|
+
* Detects when two series cross each other (either direction).
|
|
5
|
+
* Returns true if series1 crosses series2 (either above or below).
|
|
6
|
+
*
|
|
7
|
+
* Formula:
|
|
8
|
+
* cross = (source1[0] > source2[0] && source1[1] <= source2[1]) ||
|
|
9
|
+
* (source1[0] < source2[0] && source1[1] >= source2[1])
|
|
10
|
+
*
|
|
11
|
+
* @param source1 - First data series
|
|
12
|
+
* @param source2 - Second data series
|
|
13
|
+
* @returns true if the series have crossed, false otherwise
|
|
14
|
+
*/
|
|
15
|
+
export declare function cross(context: any): (source1: any, source2: any, _callId?: string) => boolean;
|