mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
Merge pull request #769 from c9s/feature/time-range-picker
backtest-report: sort intervals
This commit is contained in:
commit
3ea94871b0
|
@ -386,7 +386,19 @@ const TradingViewChart = (props: TradingViewChartProps) => {
|
|||
const chart = useRef<any>();
|
||||
const resizeObserver = useRef<any>();
|
||||
const intervals = props.reportSummary.intervals || [];
|
||||
const [currentInterval, setCurrentInterval] = useState(intervals.length > 0 ? intervals[0] : '1m');
|
||||
|
||||
intervals.sort((a,b) => {
|
||||
const as = parseInterval(a)
|
||||
const bs = parseInterval(b)
|
||||
if (as < bs) {
|
||||
return -1;
|
||||
} else if (as > bs) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
})
|
||||
|
||||
const [currentInterval, setCurrentInterval] = useState(intervals.length > 0 ? intervals[intervals.length - 1] : '1m');
|
||||
const [showPositionBase, setShowPositionBase] = useState(false);
|
||||
const [showCanceledOrders, setShowCanceledOrders] = useState(false);
|
||||
const [showPositionAverageCost, setShowPositionAverageCost] = useState(false);
|
||||
|
|
Loading…
Reference in New Issue
Block a user