Example #1
0
def get_graph_data(symbol, table, dict):
    print(symbol, table)
    trans_db = TransactionsDBManager(symbol, table)
    db = DBManager(symbol)
    running_date = start_date
    while running_date < end_date:
        if running_date not in dict.keys():
            dict[running_date] = 0

        transaction = trans_db.get_latest_transaction(running_date)
        dict[running_date] += transaction.depotkonto + \
                                     transaction.count * decimal.Decimal(db.get_closest_raw_day(running_date).close)

        running_date += datetime.timedelta(days=1)