Skip to content

Commit 5921da0

Browse files
committed
Strategy missing data bug fix
1 parent b74e45e commit 5921da0

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mathieuc/tradingview",
3-
"version": "3.3.1",
3+
"version": "3.3.2",
44
"description": "Tradingview instant stocks API, indicator alerts, trading bot, and more !",
55
"main": "main.js",
66
"scripts": {

src/chart/study.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,16 @@ module.exports = (chartSession) => class ChartStudy {
280280
changes.push('perfReport');
281281
}
282282

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+
283293
if (parsed.dataCompressed) {
284294
const parsedC = await parseCompressed(parsed.dataCompressed);
285295

@@ -372,7 +382,11 @@ module.exports = (chartSession) => class ChartStudy {
372382
this.#callbacks.studyCompleted.push(cb);
373383
}
374384

375-
/** @typedef {'plots' | 'perfReport' | 'fullReport'} UpdateChangeType */
385+
/**
386+
* @typedef {
387+
* 'plots' | 'perfReport' | 'tradesReport' | 'historyReport' | 'fullReport'
388+
* } UpdateChangeType
389+
*/
376390

377391
/**
378392
* When an indicator update happens

0 commit comments

Comments
 (0)