import configparser from fast_arrow import Client # # initialize fast_arrow client and authenticate # config = configparser.ConfigParser() config.read('config.debug.ini') u = config['account']['username'] p = config['account']['password'] client = Client(username = u, password = p) client.authenticate() # # fetch positions # fopts = {} positions = fetch.option_positions(client, fopts) print("Fetched {} positions".format(len(positions))) # # export positions # fn = "option_positions.csv" eopts = {"filename": fn} export.option_positions(positions, opts) print("Finished writing positions to {}".format(fn))
from simple_portfolio import fetch import configparser import pprint config = configparser.ConfigParser() config.read('config.debug.ini') account = { 'username': config['account']['username'], 'password': config['account']['password'] } fetch_options = {} option_positions = fetch.option_positions(account, fetch_options) msg = "Fetched {} open option positions".format(len(option_positions)) pprint.pprint(msg) pprint.pprint("First option position in array ...\n\n\n") pprint.pprint(option_positions[0])
from simple_portfolio import fetch import configparser import pprint from fast_arrow import Client # # initialize fast_arrow client and authenticate # config = configparser.ConfigParser() config.read('config.debug.ini') u = config['account']['username'] p = config['account']['password'] client = Client(username=u, password=p) client.authenticate() fetch_options = {} option_positions = fetch.option_positions(client, fetch_options) msg = "Fetched {} open option positions".format(len(option_positions)) pprint.pprint(msg) pprint.pprint("First option position in array ...\n\n\n") pprint.pprint(option_positions[0])