Skip to content

Commit

Permalink
fix(ohlc): update to use orderbook vals if trades <= 10 (#937)
Browse files Browse the repository at this point in the history
  • Loading branch information
moo-onthelawn committed Aug 20, 2024
1 parent 3cc087a commit 6ac977d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/tradingView/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { Themes } from '@/styles/themes';

import { AppTheme, type AppColorMode } from '@/state/configs';

const MIN_NUM_TRADES_FOR_ORDERBOOK_PRICES = 10;

const getOhlcValues = ({
orderbookCandlesToggleOn,
trades,
Expand All @@ -29,7 +31,7 @@ const getOhlcValues = ({
}) => {
const useOrderbookCandles =
orderbookCandlesToggleOn &&
trades === 0 &&
trades <= MIN_NUM_TRADES_FOR_ORDERBOOK_PRICES &&
orderbookOpen !== undefined &&
orderbookClose !== undefined;

Expand Down

0 comments on commit 6ac977d

Please sign in to comment.