pointsToTvOhlcStart() bugfix
This commit is contained in:
@@ -17,8 +17,8 @@ export function nearestOhlcStart(timestamp, periodSeconds=null) {
|
||||
return Math.round((timestamp-OHLC_START) / periodSeconds) * periodSeconds + OHLC_START
|
||||
}
|
||||
|
||||
export function pointsToTvOhlcStart(points) {
|
||||
export function pointsToTvOhlcStart(points, periodSeconds=null) {
|
||||
return points === null ? null : points.map((p) => {
|
||||
return {time: nearestOhlcStart(p.time/1000)*1000, price: p.price}
|
||||
return {time: nearestOhlcStart(p.time, periodSeconds), price: p.price}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user