__author__ = 'cgomezfandino@gmail.com'

import pandas as pd
import configparser
import v20
import json


config = configparser.ConfigParser()

### Connection to know the account number

config.read('../API_Connection_Oanda/pyalgo.cfg')
ctx = v20.Context(
    'api-fxpractice.oanda.com',
    443,
    True,
    application= 'sample_code',
    token= config['oanda_v20']['access_token'],
    datetime_format= 'RFC3339')

response = ctx.account.list()

accounts = response.get('accounts')

for accounts in accounts:
    print('Account: %s' %accounts)


### Retrive all Instruments

response = ctx.account.instruments(
    config['oanda_v20']['account_id'])

instruments = response.get('instruments')

print(instruments[0].dict())

# symbols = []

for instrument in instruments:
    ins = instrument.dict()
    print('%20s | %10s | %20s' % (ins['displayName'],
                           ins['name'],
                            ins['type']))
    # symbols.append([ins['displayName'],ins['name'],ins['type']])

# sym = pd.DataFrame(symbols, columns=['displayName','Name','Type'])
# sym.to_csv('Instrumens.csv',';')
# print(pd.DataFrame(symbols, columns=['displayName','Name','Type']))





c97b55d9cacc2b86002d6fda06ce928070e6683a
<mask token>

<mask token>
config.read('../API_Connection_Oanda/pyalgo.cfg')
<mask token>
for accounts in accounts:
    print('Account: %s' % accounts)
<mask token>
print(instruments[0].dict())
for instrument in instruments:
    ins = instrument.dict()
    print('%20s | %10s | %20s' % (ins['displayName'], ins['name'], ins['type'])
        )

__author__ = 'cgomezfandino@gmail.com'
<mask token>
config = configparser.ConfigParser()
config.read('../API_Connection_Oanda/pyalgo.cfg')
ctx = v20.Context('api-fxpractice.oanda.com', 443, True, application=
    'sample_code', token=config['oanda_v20']['access_token'],
    datetime_format='RFC3339')
response = ctx.account.list()
accounts = response.get('accounts')
for accounts in accounts:
    print('Account: %s' % accounts)
response = ctx.account.instruments(config['oanda_v20']['account_id'])
instruments = response.get('instruments')
print(instruments[0].dict())
for instrument in instruments:
    ins = instrument.dict()
    print('%20s | %10s | %20s' % (ins['displayName'], ins['name'], ins['type'])
        )

__author__ = 'cgomezfandino@gmail.com'
import pandas as pd
import configparser
import v20
import json
config = configparser.ConfigParser()
config.read('../API_Connection_Oanda/pyalgo.cfg')
ctx = v20.Context('api-fxpractice.oanda.com', 443, True, application=
    'sample_code', token=config['oanda_v20']['access_token'],
    datetime_format='RFC3339')
response = ctx.account.list()
accounts = response.get('accounts')
for accounts in accounts:
    print('Account: %s' % accounts)
response = ctx.account.instruments(config['oanda_v20']['account_id'])
instruments = response.get('instruments')
print(instruments[0].dict())
for instrument in instruments:
    ins = instrument.dict()
    print('%20s | %10s | %20s' % (ins['displayName'], ins['name'], ins['type'])
        )

__author__ = 'cgomezfandino@gmail.com'

import pandas as pd
import configparser
import v20
import json


config = configparser.ConfigParser()

### Connection to know the account number

config.read('../API_Connection_Oanda/pyalgo.cfg')
ctx = v20.Context(
    'api-fxpractice.oanda.com',
    443,
    True,
    application= 'sample_code',
    token= config['oanda_v20']['access_token'],
    datetime_format= 'RFC3339')

response = ctx.account.list()

accounts = response.get('accounts')

for accounts in accounts:
    print('Account: %s' %accounts)


### Retrive all Instruments

response = ctx.account.instruments(
    config['oanda_v20']['account_id'])

instruments = response.get('instruments')

print(instruments[0].dict())

# symbols = []

for instrument in instruments:
    ins = instrument.dict()
    print('%20s | %10s | %20s' % (ins['displayName'],
                           ins['name'],
                            ins['type']))
    # symbols.append([ins['displayName'],ins['name'],ins['type']])

# sym = pd.DataFrame(symbols, columns=['displayName','Name','Type'])
# sym.to_csv('Instrumens.csv',';')
# print(pd.DataFrame(symbols, columns=['displayName','Name','Type']))




