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 CHANGED
@@ -1,3 +1,8 @@
1
+ [![npm version](https://img.shields.io/npm/v/pinets.svg?style=flat-square)](https://www.npmjs.com/package/pinets)
2
+ [![License: AGPL-3.0](https://img.shields.io/badge/License-AGPL--3.0-blue.svg?style=flat-square)](https://opensource.org/licenses/AGPL-3.0)
3
+ [![Documentation](https://img.shields.io/badge/docs-github--pages-blue?style=flat-square)](https://alaa-eddine.github.io/PineTS/)
4
+ [![Reddit](https://img.shields.io/reddit/subreddit-subscribers/PineTS?style=flat-square&logo=reddit)](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, Providers } from '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.ta;
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