oanda / v20-python

OANDA v20 bindings for Python
MIT License
225 stars 91 forks source link

Accept-Datetime-Format bug #16

Closed alekna closed 7 years ago

alekna commented 7 years ago

Accept-Datetime-Format is not respected in heartbeat messages:

This is what I get when Accept-Datetime-Format is set to UNIX

Pricing Heartbeat 2016-12-13T13:41:27.222512838Z
================================================

type = HEARTBEAT
time = 2016-12-13T13:41:27.222512838Z

Type = PRICE
instrument = EUR_NZD
time = 1481636487.426472413
status = tradeable
bids = [1]
asks = [1]
closeoutBid = 1.47247
closeoutAsk = 1.47301

Type = PRICE
instrument = EUR_HKD
time = 1481636487.296723637
status = tradeable
bids = [1]
asks = [1]
closeoutBid = 8.24445
closeoutAsk = 8.24594

Could you please also unify __str__() implementation for different entities? Currently it's not the same at least for PRICE and HEARTBEAT messages. I suppose Type in PRICE should be lowercase.

dmpettyp commented 7 years ago

The heartbeat problem was a known bug that was fixed recently. I'll check why it hasn't been released yet. To my knowledge it should at least be on fxtrade practice by now.

The str inconsistencies are because those strings are generated using the property's "display names", however no display names were provided for those entities. I'll add them and push out a build. The truth is I'm not super happy with the the str representations provided, but they are what we have for now. Maybe just dumping YAML from str would look nice...

alekna commented 7 years ago

Let me know when it is released to fxTrade live.

As for dumping YAML, I think it's a good idea. As long as it makes output consistent.

dmpettyp commented 7 years ago

The fix should be on fxtrade practice, but won't be promoted until the first maintenance of the new year (likely Jan 6)

alekna commented 7 years ago

Any updates on this issue?

alekna commented 7 years ago

Thanks for fixing this.

dmpettyp commented 7 years ago

Ah, thanks for checking and verifying.