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

price range request not working #15

Open
mwelzl opened this issue Mar 31, 2021 · 0 comments
Open

price range request not working #15

mwelzl opened this issue Mar 31, 2021 · 0 comments

Comments

@mwelzl
Copy link

mwelzl commented Mar 31, 2021

Calling
response = ctx.pricing.getPriceRange(request);
(where ctx is the context and response is of type PricingGetPriceRangeResponse)
gives me:
com.oanda.v20.ExecuteException: No key {instrument} found in path '/v3/pricing/range'

I believe I have correctly initialized the PricingGetPriceRangeRequest object, including the instrument, like this:
PricingGetPriceRangeRequest request = new PricingGetPriceRangeRequest(new InstrumentName("EUR_USD"), new DateTime(beginTime+".0"));

Here, beginTime is a long value in milliseconds; I did try it with a PricingGetRequest and ctx.pricing.get, and there it works fine with the same value for "beginTime".

pricing.get needs the AccountId, and getPriceRange does not... could it be that the missing AccountID parameter is the mistake? When getPriceRange didn't work, I switched to using ctx.pricing.candles, which works, because I locally applied PR #14 - also there, the AccountID parameter was missing, and adding it fixed it, so I suspect that this might be the same problem.

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

1 participant