pinets 0.1.34 → 0.2.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 +12 -5
- package/dist/pinets.dev.browser.js +639 -484
- package/dist/pinets.dev.cjs +639 -484
- package/dist/pinets.dev.cjs.map +1 -1
- package/dist/pinets.dev.es.js +637 -482
- package/dist/pinets.dev.es.js.map +1 -1
- package/dist/pinets.min.browser.js +12 -12
- package/dist/pinets.min.cjs +12 -12
- package/dist/pinets.min.es.js +2 -2
- package/dist/types/Context.class.d.ts +1 -0
- package/dist/types/PineTS.class.d.ts +0 -3
- package/dist/types/marketData/Binance/BinanceProvider.class.d.ts +4 -0
- package/dist/types/namespaces/PineMath.d.ts +1 -0
- package/dist/types/namespaces/TechnicalAnalysis.d.ts +19 -19
- package/dist/types/transpiler/ScopeManager.class.d.ts +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
[](https://www.npmjs.com/package/pinets)
|
|
2
|
+
[](https://opensource.org/licenses/AGPL-3.0)
|
|
3
|
+
[](https://alaa-eddine.github.io/PineTS/)
|
|
4
|
+
[](https://www.reddit.com/r/PineTS/)
|
|
5
|
+
|
|
1
6
|
This project aims to provide a Javascript/Typescript port for Tradingview's Pine Script.
|
|
2
7
|
The current version does not run Pine Script directly, instead it runs a close Javascript equivalent called PineTS.
|
|
3
8
|
|
|
@@ -96,16 +101,14 @@ _oo = math.abs(open[1] - close[2]);
|
|
|
96
101
|
### Running PineTS Code
|
|
97
102
|
|
|
98
103
|
```javascript
|
|
99
|
-
import { PineTS,
|
|
104
|
+
import { PineTS, Provider } from 'pinets';
|
|
100
105
|
|
|
101
106
|
// Initialize with market data
|
|
102
|
-
|
|
103
|
-
const pineTS = new PineTS(Providers.Binance, 'BTCUSDT', 'D', 100);
|
|
107
|
+
const pineTS = new PineTS(Provider.Binance, 'BTCUSDT', 'D', 100);
|
|
104
108
|
|
|
105
109
|
// Run your indicator
|
|
106
110
|
const { result } = await pineTS.run((context) => {
|
|
107
|
-
const ta = context
|
|
108
|
-
const math = context.math;
|
|
111
|
+
const { ta, math } = context;
|
|
109
112
|
const { close, open } = context.data;
|
|
110
113
|
|
|
111
114
|
const ema9 = ta.ema(close, 9);
|
|
@@ -119,9 +122,13 @@ const { result } = await pineTS.run((context) => {
|
|
|
119
122
|
|
|
120
123
|
let _oo = open;
|
|
121
124
|
_oo = math.abs(open[1] - close[2]);
|
|
125
|
+
|
|
126
|
+
return { ema9, ema18, bull_bias, bear_bias };
|
|
122
127
|
});
|
|
123
128
|
```
|
|
124
129
|
|
|
130
|
+
> **📖 For detailed documentation on initialization options, parameters, and advanced usage, see the [Initialization and Usage Guide](https://alaa-eddine.github.io/PineTS/initialization-and-usage/)**
|
|
131
|
+
|
|
125
132
|
## Key Differences from Pine Script
|
|
126
133
|
|
|
127
134
|
1. **Variable Declaration**: Use JavaScript's `const`, `let`, and `var` instead of Pine Script's implicit declaration
|