π Get real-time stocks from TradingView
TypeScript backtestingbacktesting-trading-strategiesbitcoinchartscryptocryptocurrencyethereumrealtime-stocksstocksstocks-apistocks-pricestradingtradingviewtradingview-apitradingview-indicatortradingview-replaytradingview-scraper
Bug fix
Mathieu Colmon267356cbbd60
diff --git a/main.js b/main.jsindex c625b30..80de04c 100644--- a/main.js+++ b/main.js@@ -441,8 +441,9 @@ module.exports = (autoInit = true) => {p.v.forEach((val, i) => {if (i === 0) return;- if (indicator.plots[`plot_${i - 1}`]) period[indicator.plots[`plot_${i - 1}`]] = val;- else period[`_plot_${i - 1}`] = val;+ if (indicator.plots[`plot_${i - 1}`] && !period[indicator.plots[`plot_${i - 1}`]]) {+ period[indicator.plots[`plot_${i - 1}`]] = val;+ } else period[`_plot_${i - 1}`] = val;});periods[p.i][chart.indicators[parseInt(type, 10)].name || `st${type}`] = period;}