MCPcopy Create free account
hub / github.com/Open-Quant/openquant / _interval_to_seconds

Function _interval_to_seconds

python/openquant/data.py:157–167  ·  view source on GitHub ↗
(interval: str)

Source from the content-addressed store, hash-verified

155
156
157def _interval_to_seconds(interval: str) -> int:
158 s = interval.strip().lower()
159 if s.endswith("d"):
160 return int(s[:-1]) * 24 * 3600
161 if s.endswith("h"):
162 return int(s[:-1]) * 3600
163 if s.endswith("m"):
164 return int(s[:-1]) * 60
165 if s.endswith("s"):
166 return int(s[:-1])
167 raise ValueError(f"unsupported interval format: {interval}")
168
169
170def clean_ohlcv(

Callers 1

align_calendarFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected