diff --git a/package.json b/package.json index 7d987b7..4a6e462 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mathieuc/tradingview", - "version": "3.3.1", + "version": "3.3.2", "description": "Tradingview instant stocks API, indicator alerts, trading bot, and more !", "main": "main.js", "scripts": { diff --git a/src/chart/study.js b/src/chart/study.js index 19d3829..b127a43 100644 --- a/src/chart/study.js +++ b/src/chart/study.js @@ -280,6 +280,16 @@ module.exports = (chartSession) => class ChartStudy { changes.push('perfReport'); } + if (parsed.data && parsed.data.report && parsed.data.report.trades) { + this.#strategyReport.trades = parsed.data.report.trades; + changes.push('tradesReport'); + } + + if (parsed.data && parsed.data.report && parsed.data.report.history) { + this.#strategyReport.history = parsed.data.report.history; + changes.push('historyReport'); + } + if (parsed.dataCompressed) { const parsedC = await parseCompressed(parsed.dataCompressed); @@ -372,7 +382,11 @@ module.exports = (chartSession) => class ChartStudy { this.#callbacks.studyCompleted.push(cb); } - /** @typedef {'plots' | 'perfReport' | 'fullReport'} UpdateChangeType */ + /** + * @typedef { + * 'plots' | 'perfReport' | 'tradesReport' | 'historyReport' | 'fullReport' + * } UpdateChangeType + */ /** * When an indicator update happens