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

contrib.factories.history.InstrumentCandleFactory ignoring 'params' incorrectly using 'yparams' #116

Closed svenissimo closed 6 years ago

svenissimo commented 6 years ago

If running something like below. it ignores the granularity.

for r in InstrumentsCandlesFactory('EUR_USD', params={'granularity': 'D'}):

Seems that below should be using params not yparams (as its empty anyway)

    yparams = dict()
    if not params or 'from' not in params:
        yield instruments.InstrumentsCandles(instrument=instrument,
                                             params=yparams)   # should use params if  'from' not supplied
    else:
hootnot commented 6 years ago

@svenissimo : I'll take a look and come back to it

hootnot commented 6 years ago

@svenissimo

fixed it. Thanks.

svenissimo commented 6 years ago

Nice one. Thanks!

On 25 Mar 2018, at 19:35, Feite Brekeveld notifications@github.com wrote:

@svenissimo

fixed it. Thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.