hootnot / oanda-api-v20

OANDA REST-V20 API wrapper. Easy access to OANDA's REST v20 API with oandapyV20 package. Checkout the Jupyter notebooks!
MIT License
397 stars 107 forks source link

Time is in the future #103

Closed JTInfinite closed 6 years ago

JTInfinite commented 6 years ago

Hi hootnot,

I have recently been getting the following error from the wrapper:

ERROR : 12/10/2017 12:34:57 PM : {"errorMessage":"Invalid value specified for 'to'. Time is in the future"}

My code for getting the 'to':

now = datetime.datetime.utcnow().isoformat('T')+'Z'
now = str(now[:-8] + 'Z')

I did notice you fixed this issue in version 0.4.2 - Am I doing something I shouldnt?

Thanks again so much!

JTInfinite commented 6 years ago

Just to add - I changed my computers time -1 minute and it ran. Possibly a system/time issue at my end?

hootnot commented 6 years ago

Hi 4Eye,

before I look in code: there should be no need to pass 'now' as 'to'. Only 'from' will do if you want up to 'now'. If you still get the error after removing your 'now', pls. provide me the piece of code and I will check on things (asuming you refer to InstrumentsCandlesFactory)

JTInfinite commented 6 years ago

I see. I'll give that a go. Thanks again for the swift response! I'll report back shortly.

JTInfinite commented 6 years ago

Works fine. Thanks again dude!

hootnot commented 6 years ago

... then I will close this one