Exemplo n.º 1
0
CONFIG_PARSER = configparser.ConfigParser()
CONFIG_PARSER.read("gtja_trade.ini", encoding="utf-8")
ACCOUNT_NAME = CONFIG_PARSER['Account'].get('account_name')
PASSWORD = CONFIG_PARSER['Account'].get('password')
CONNECTION_STRING = CONFIG_PARSER['Database'].get('connection')
LOGGING_PATH = CONFIG_PARSER["Logging"].get("path")

# logger setup
logging.getLogger('sqlalchemy.engine').setLevel(logging.WARNING)
logging.getLogger('selenium.webdriver.remote.remote_connection').setLevel(
    logging.WARNING)

# set the DB connection string
stock_db.db_connection.default_connection_string = CONNECTION_STRING

STOCK_PROCESSOR = StockProcessor(ACCOUNT_NAME, PASSWORD)
logging.info("account: " + ACCOUNT_NAME)
logging.info("password: "******"600115", "601390", "600584", "000568", "601998", "002367", "601111",
    "601398", "600019", "601857"
])


def is_transaction_time():
    '''
Exemplo n.º 2
0

# read configuration
config = configparser.ConfigParser()
config.read("gtja_trade.ini", encoding="utf-8")
account_name = config['Account'].get('account_name')
password = config['Account'].get('password')
connection_string = config['Database'].get('connection')

# set the DB connection string
stock_db.db_connection.default_connection_string = connection_string

#commission_id = trade.get_last_commission_id("601398", 100)

#test
stock_processor = StockProcessor(account_name, password)
print(account_name, password)
 
#stock_processor.login()
 
#time.sleep(3)

symbol_list = ['600115']

stock_processor.set_stock_symbol_list(["600115"])

for symbol in symbol_list:
    total = stock_processor.get_stock_current_value(symbol)
    print("Stock symbol: {0}\t\tTotal Value: {1}".format(symbol, total))

stock_processor.close()