OHLC rework

This commit is contained in:
tim
2024-08-06 20:59:37 -04:00
parent d47d90e432
commit f9f154f495
4 changed files with 258 additions and 212 deletions

View File

@@ -1,6 +1,6 @@
// import {subscribeOnStream, unsubscribeFromStream,} from './streaming.js';
import {jBars, tvResolutionToPeriodString} from './jBars.js';
import {loadOHLC} from './ohlc.js';
import {metadata} from "@/version.js";
import FlexSearch from "flexsearch";
import {useChartOrderStore} from "@/orderbuild.js";
@@ -318,7 +318,7 @@ export const DataFeed = {
// todo need to consider the selected fee tier
let bars, metadata;
const pool = useChartOrderStore().selectedPool;
[bars, metadata] = await jBars(lookupSymbol(symbolInfo.ticker), pool[0], from, to, resolution); // This is the one that does all the work
[bars, metadata] = await loadOHLC(lookupSymbol(symbolInfo.ticker), pool[0], from, to, resolution); // This is the one that does all the work
if (firstDataRequest) {
lastBarsCache.set(symbolInfo.full_name, {
...bars[bars.length - 1],