pinets 0.7.6 → 0.7.8

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
@@ -71,6 +71,33 @@ npm install pinets
71
71
 
72
72
  ## Usage Examples
73
73
 
74
+ ### Streaming Data
75
+
76
+ PineTS provides a convenient event-based interface for streaming live data:
77
+
78
+ ```javascript
79
+ import { PineTS, Provider } from 'pinets';
80
+
81
+ const pineTS = new PineTS(Provider.Binance, 'BTCUSDT', '1m');
82
+
83
+ // Start streaming with 1 second interval
84
+ const evt = pineTS.stream(
85
+ indicator,
86
+ //assuming that indicator is a pine source code or pineTS function
87
+ {
88
+ pageSize: 10,
89
+ live: true,
90
+ interval: 1000,
91
+ }
92
+ );
93
+
94
+ evt.on('data', (ctx) => {
95
+ console.log('Update:', ctx.result.close);
96
+ });
97
+
98
+ // See documentation for full details
99
+ ```
100
+
74
101
  ### Option 1: Run Native Pine Script Directly _(Experimental)_
75
102
 
76
103
  Starting with v0.7.0, you can run original Pine Script code directly: