diff --git a/src/charts/ohlc.js b/src/charts/ohlc.js index 9368065..fa62842 100644 --- a/src/charts/ohlc.js +++ b/src/charts/ohlc.js @@ -190,7 +190,8 @@ export async function loadOHLC (symbol, contract, from, to, tvRes) { let price = parseFloat(row[1]) if (inverted) price = 1/price - open = high = low = close = price + open = latest === null ? price : latest[1] + high = low = close = price break case 3: time = parseInt(row[0]) @@ -204,6 +205,8 @@ export async function loadOHLC (symbol, contract, from, to, tvRes) { } high = Math.max(open, close) low = Math.min(open,close) + if (latest!==null) + open = latest[1] break case 5: time = parseInt(row[0])