Jump to content


  • Content count

  • Joined

  • Last visited

  1. I can get latest tick data when I don't supply from_ts or to_ts. But when I supply either timestamps I keep getting 'invalid request'. I'm testing my code in demo account. I also tried multiplying new_ts with 1000 to get milliseconds but still got the same result. I need help here as I can't do anything without historical data. Code: resp = client.client.get_market_info('AUD/USD') market_id = resp['Markets'][0]['MarketId'] bid_resp = client.client.get_prices(market_id=market_id, num_ticks=2,price_type='bid') for bid in bid_resp['PriceTicks']: bid_ts = re.findall('\((.+)\)',bid['TickDate'])[0] print('received ts:',bid_ts) new_ts = convert_date(convert_date(bid_ts) - datetime.timedelta(hours=1)) print('new ts:', new_ts) new_bid_resp = client.client.get_prices(market_id=market_id,num_ticks=2,to_ts=int(new_ts),price_type='bid') print(new_bid_resp) output: received ts: 1608328799510 new ts: 1608325199 {'Message': 'The request is invalid.'} received ts: 1608328799761 new ts: 1608325199 {'Message': 'The request is invalid.'} Process finished with exit code 0