diff --git a/apps/backtest-report/components/TradingViewChart.tsx b/apps/backtest-report/components/TradingViewChart.tsx index 82e4c139a..5e643ce1c 100644 --- a/apps/backtest-report/components/TradingViewChart.tsx +++ b/apps/backtest-report/components/TradingViewChart.tsx @@ -1,7 +1,6 @@ import React, {useEffect, useRef, useState} from 'react'; import {tsvParse} from "d3-dsv"; -import {Button} from '@mantine/core'; -import { SegmentedControl } from '@mantine/core'; +import {SegmentedControl} from '@mantine/core'; // https://github.com/tradingview/lightweight-charts/issues/543 @@ -11,7 +10,7 @@ import {ReportSummary} from "../types"; import moment from "moment"; const parseKline = () => { - return (d : any) => { + return (d: any) => { d.startTime = new Date(Number(d.startTime) * 1000); d.endTime = new Date(Number(d.endTime) * 1000); d.time = d.startTime.getTime() / 1000; @@ -178,7 +177,7 @@ const ordersToMarkets = (interval: string, orders: Array | void): Array | void): Array {
{ return { label: interval, value: interval } })} + data={intervals.map((interval) => { + return {label: interval, value: interval} + })} onChange={setCurrentInterval} />
diff --git a/pkg/backtest/matching_test.go b/pkg/backtest/matching_test.go index 94a3a45a2..3b478bbce 100644 --- a/pkg/backtest/matching_test.go +++ b/pkg/backtest/matching_test.go @@ -42,9 +42,10 @@ func TestSimplePriceMatching_orderUpdate(t *testing.T) { t1 := time.Date(2021, 7, 1, 0, 0, 0, 0, time.UTC) engine := &SimplePriceMatching{ - Account: account, - Market: market, - CurrentTime: t1, + Account: account, + Market: market, + CurrentTime: t1, + closedOrders: make(map[uint64]types.Order), } orderUpdateCnt := 0 @@ -108,9 +109,10 @@ func TestSimplePriceMatching_processKLine(t *testing.T) { t1 := time.Date(2021, 7, 1, 0, 0, 0, 0, time.UTC) engine := &SimplePriceMatching{ - Account: account, - Market: market, - CurrentTime: t1, + Account: account, + Market: market, + CurrentTime: t1, + closedOrders: make(map[uint64]types.Order), } for i := 0; i <= 5; i++ { @@ -172,8 +174,9 @@ func TestSimplePriceMatching_PlaceLimitOrder(t *testing.T) { } engine := &SimplePriceMatching{ - Account: account, - Market: market, + Account: account, + Market: market, + closedOrders: make(map[uint64]types.Order), } for i := 0; i < 5; i++ {