Skip to content

How do I get a list of all instruments #49

@wybren84

Description

@wybren84

Hello all,

I tried:
import configparser # 1
import oandapy as opy # 2

#read oanda.cfg
config = configparser.ConfigParser() # 3
config.read('oanda.cfg') # 4

#store token in variable
access_token_wk=config['oanda']['access_token']
account_id=config['oanda']['account_id']
print(account_id)
#print(access_token_wk)
oanda = opy.API(environment='practice',access_token=access_token_wk) # 5
list=oanda.get_instruments(account_id)
print(list)

but I get the next error:
OandaError: OANDA API returned error code 1 (Invalid or malformed argument: accountId)

How can I solve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions