@mathieuc/tradingview 3.4.5 → 3.4.6

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.
@@ -4,9 +4,15 @@ const TradingView = require('../main');
4
4
  * This example tests built-in indicators like volume-based indicators
5
5
  */
6
6
 
7
- const volumeProfile = new TradingView.BuiltInIndicator('VbPFixed@tv-basicstudies-139!');
7
+ const volumeProfile = new TradingView.BuiltInIndicator('VbPFixed@tv-basicstudies-241!');
8
8
 
9
- if (!process.argv[2] && !['VbPFixed@tv-basicstudies-139!', 'Volume@tv-basicstudies-144'].includes(volumeProfile.type)) {
9
+ const AUTHENTICATED_INDICATORS = [
10
+ 'VbPFixed@tv-basicstudies-241',
11
+ 'VbPFixed@tv-basicstudies-241!',
12
+ 'Volume@tv-basicstudies-241',
13
+ ];
14
+
15
+ if (!process.argv[2] && !AUTHENTICATED_INDICATORS.includes(volumeProfile.type)) {
10
16
  throw Error('Please specify your \'sessionid\' cookie');
11
17
  }
12
18
 
@@ -91,6 +91,6 @@ async function addIndicator(name, pineId, options = {}) {
91
91
  });
92
92
  }
93
93
 
94
- addIndicator('Volume', 'Volume@tv-basicstudies-144');
94
+ addIndicator('Volume', 'Volume@tv-basicstudies-241');
95
95
  addIndicator('EMA_50', 'STD;EMA', { Length: 50 });
96
96
  addIndicator('EMA_200', 'STD;EMA', { Length: 200 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mathieuc/tradingview",
3
- "version": "3.4.5",
3
+ "version": "3.4.6",
4
4
  "description": "Tradingview instant stocks API, indicator alerts, trading bot, and more !",
5
5
  "main": "main.js",
6
6
  "scripts": {
@@ -1,6 +1,7 @@
1
1
  /**
2
- * @typedef {'Volume@tv-basicstudies-144'
3
- * | 'VbPFixed@tv-basicstudies-139!'
2
+ * @typedef {'Volume@tv-basicstudies-241'
3
+ * | 'VbPFixed@tv-basicstudies-241'
4
+ * | 'VbPFixed@tv-basicstudies-241!'
4
5
  * | 'VbPFixed@tv-volumebyprice-53!'
5
6
  * | 'VbPSessions@tv-volumebyprice-53'
6
7
  * | 'VbPSessionsRough@tv-volumebyprice-53!'
@@ -17,11 +18,22 @@
17
18
  */
18
19
 
19
20
  const defaultValues = {
20
- 'Volume@tv-basicstudies-144': {
21
+ 'Volume@tv-basicstudies-241': {
21
22
  length: 20,
22
23
  col_prev_close: false,
23
24
  },
24
- 'VbPFixed@tv-basicstudies-139!': {
25
+ 'VbPFixed@tv-basicstudies-241': {
26
+ rowsLayout: 'Number Of Rows',
27
+ rows: 24,
28
+ volume: 'Up/Down',
29
+ vaVolume: 70,
30
+ subscribeRealtime: false,
31
+ first_bar_time: NaN,
32
+ last_bar_time: Date.now(),
33
+ extendToRight: false,
34
+ mapRightBoundaryToBarStartTime: true,
35
+ },
36
+ 'VbPFixed@tv-basicstudies-241!': {
25
37
  rowsLayout: 'Number Of Rows',
26
38
  rows: 24,
27
39
  volume: 'Up/Down',