diagonals working
This commit is contained in:
13
src/charts/chart-misc.js
Normal file
13
src/charts/chart-misc.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import {useChartOrderStore} from "@/orderbuild.js";
|
||||
|
||||
export function nearestOhlcStart(time) {
|
||||
// todo subtract OHLC root time
|
||||
const period = useChartOrderStore().intervalSecs
|
||||
return Math.round(time / period) * period
|
||||
}
|
||||
|
||||
export function pointsToOhlcStart(points) {
|
||||
return points === null ? null : points.map((p) => {
|
||||
return {time: nearestOhlcStart(p.time), price: p.price}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user