Skip to content

InstrumentsCandlesFactory not working for monthly granularity #148

@mpatkinson7

Description

@mpatkinson7

Hi

The InstrumentsCandlesFactory is not working for "monthly" granularity. Works fine for weekly and daily granularities.

Using parameters below.

params = {
    "price": "M",
    "granularity": "M",
    "from": "2005-01-01T00:00:00Z",
    "to": "2017-07-01T00:00:00Z",
    "dailyAlignment": 17,
    "alignmentTimezone": "America/New_York",
    "weeklyAlignment": "Friday"
}

Say instrument is "AU200_AUD"

Basically, calling line below:
client.request(factories.InstrumentsCandlesFactory(instrument=instrument, params=params))

Running line in Interactive Window in VSCode (using WinPython) yields error below.

AttributeError Traceback (most recent call last)
in

----> 1 client.request(factories.InstrumentsCandlesFactory(instrument=instrument, params=params))

C:\WPy64-3720\python-3.7.2.amd64\lib\site-packages\oandapyV20\oandapyV20.py in request(self, endpoint)
    274             V20Error in case of HTTP response code >= 400
    275         """
--> 276         method = endpoint.method
    277         method = method.lower()
    278         params = None

AttributeError: 'generator' object has no attribute 'method'
---------------------------------------------------------------------------

I've just run the script for daily & weekly data - so pretty sure OANDA is working fine.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions