Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instrument Accept-Datetime-Format Bug #22

Open
ghost opened this issue Apr 3, 2017 · 2 comments
Open

Instrument Accept-Datetime-Format Bug #22

ghost opened this issue Apr 3, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 3, 2017

No matter which date time format I choose I get back UNIX datetime. This doesn't seem to be an issue with this module but an underlying problem with the v20 api. I didn't know where else to report it. See examples using curl below:

curl -H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" -H "Accept-Datetime-Format: UNIX" "https://api-fxtrade.oanda.com/v3/instruments/USD_JPY/candles?count=1"

{"granularity":"S5","instrument":"USD_JPY","candles":[{"complete":false,"time":"1491201560.000000000","volume":8,"mid":{"o":"111.467","h":"111.469","l":"111.467","c":"111.469"}}]}

curl -H "Content-Type: application/json" -H "Authorization: Bearer TOKEN" -H "Accept-Datetime-Format: RFC3339" "https://api-fxtrade.oanda.com/v3/instruments/USD_JPY/candles?count=1"

{"granularity":"S5","instrument":"USD_JPY","candles":[{"complete":false,"time":"1491201650.000000000","volume":1,"mid":{"o":"111.460","h":"111.460","l":"111.460","c":"111.460"}}]}

@hootnot
Copy link

hootnot commented Apr 3, 2017

seems to vary between the environments, on practice I get:

curl -H 'Content-Type: application/json' -H 'Authorization: Bearer TOK' -H 'Accept-Datetime-Format: RFC3339' -X GET 'https://api-fxpractice.oanda.com/v3/instruments/DE30_EUR/candles?count=1&granularity=M5'
{"granularity":"M5",
 "instrument":"DE30_EUR",
 "candles":[{"complete":false,"time":"2017-04-03T03:50:00.000000000Z","volume":109,"mid":{"o":"12358.2","h":"12365.0","l":"12358.2","c":"12363.5"}}]}

Setting it to UNIX delivers the unix-time format. So the practice-environment seems to work OK.

While on fxtrade I get:
curl -H 'Content-Type: application/json' -H 'Authorization: Bearer TOK' -H 'Accept-Datetime-Format: RFC3339' -X GET 'https://api-fxtrade.oanda.com/v3/instruments/DE30_EUR/candles?count=1&granularity=M5'
{"granularity":"M5","instrument":"DE30_EUR","candles":[{"complete":false,"time":"1491206100.000000000","volume":52,"mid":{"o":"12360.6","h":"12362.1","l":"12360.3","c":"12361.4"}}]}

@dmpettyp
Copy link

dmpettyp commented Apr 3, 2017

This is a know bug that is in the pipeline to be fixed. It appears that the fix has already landed in FXTrade Practice and will go to FXTrade with its next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants