all_bars = []before_time = Nonewhile True: params = {"symbol": "EURUSD", "timeframe": 60, "limit": 1000} if before_time: params["before_time"] = before_time response = requests.get(url, params=params, headers=headers) data = response.json() all_bars.extend(data["bars"]) if not data["pagination"]["has_more"]: break before_time = data["pagination"]["oldest_time"]print(f"Fetched {len(all_bars)} total bars")
The time field is the real Unix timestamp from the market data source.
Always use this value when submitting signals to ensure correct positioning on the chart.