@mathieuc/tradingview 3.3.1 → 3.3.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/chart/study.js +15 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mathieuc/tradingview",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
4
4
  "description": "Tradingview instant stocks API, indicator alerts, trading bot, and more !",
5
5
  "main": "main.js",
6
6
  "scripts": {
@@ -280,6 +280,16 @@ module.exports = (chartSession) => class ChartStudy {
280
280
  changes.push('perfReport');
281
281
  }
282
282
 
283
+ if (parsed.data && parsed.data.report && parsed.data.report.trades) {
284
+ this.#strategyReport.trades = parsed.data.report.trades;
285
+ changes.push('tradesReport');
286
+ }
287
+
288
+ if (parsed.data && parsed.data.report && parsed.data.report.history) {
289
+ this.#strategyReport.history = parsed.data.report.history;
290
+ changes.push('historyReport');
291
+ }
292
+
283
293
  if (parsed.dataCompressed) {
284
294
  const parsedC = await parseCompressed(parsed.dataCompressed);
285
295
 
@@ -372,7 +382,11 @@ module.exports = (chartSession) => class ChartStudy {
372
382
  this.#callbacks.studyCompleted.push(cb);
373
383
  }
374
384
 
375
- /** @typedef {'plots' | 'perfReport' | 'fullReport'} UpdateChangeType */
385
+ /**
386
+ * @typedef {
387
+ * 'plots' | 'perfReport' | 'tradesReport' | 'historyReport' | 'fullReport'
388
+ * } UpdateChangeType
389
+ */
376
390
 
377
391
  /**
378
392
  * When an indicator update happens