MCPcopy Create free account
hub / github.com/ccxt/ccxt / round_timeframe

Method round_timeframe

python/ccxt/base/exchange.py:1881–1885  ·  view source on GitHub ↗
(timeframe, timestamp, direction=ROUND_DOWN)

Source from the content-addressed store, hash-verified

1879
1880 @staticmethod
1881 def round_timeframe(timeframe, timestamp, direction=ROUND_DOWN):
1882 ms = Exchange.parse_timeframe(timeframe) * 1000
1883 # Get offset based on timeframe in milliseconds
1884 offset = timestamp % ms
1885 return timestamp - offset + (ms if direction == ROUND_UP else 0)
1886
1887 def check_required_dependencies(self):
1888 pass

Callers 2

test_round_timeframeFunction · 0.95

Calls 1

parse_timeframeMethod · 0.80

Tested by 1

test_round_timeframeFunction · 0.76