fix SimplePriceMatching test

Signed-off-by: c9s <yoanlin93@gmail.com>
This commit is contained in:
c9s 2022-06-27 00:13:57 +08:00
parent a9ab77f6d3
commit d46954a4b1
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 18 additions and 14 deletions

View File

@ -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<Order> | void): Array<M
position: 'belowBar',
color: '#239D10',
shape: 'arrowUp',
text: ''+order.price
text: '' + order.price
//text: 'B',
});
break;
@ -188,7 +187,7 @@ const ordersToMarkets = (interval: string, orders: Array<Order> | void): Array<M
position: 'aboveBar',
color: '#e91e63',
shape: 'arrowDown',
text: ''+order.price
text: '' + order.price
//text: 'S',
});
break;
@ -490,7 +489,9 @@ const TradingViewChart = (props: TradingViewChartProps) => {
<div>
<div>
<SegmentedControl
data={intervals.map((interval) => { return { label: interval, value: interval } })}
data={intervals.map((interval) => {
return {label: interval, value: interval}
})}
onChange={setCurrentInterval}
/>
</div>

View File

@ -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++ {