def dump_eod_estimated_data(current_date, product_type="future", data_source="csi"):
    # Connect to db
    try:
        db = connect_to_db("fixed-income1.clmdxgxhslqn.us-east-1.rds.amazonaws.com", "live_trading", "w")
        db_cursor = db.cursor(MySQLdb.cursors.DictCursor)
    except Exception, err:
        send_mail(err, "Could not connect to db")
        print traceback.format_exc()
def manage_inventory( current_date, config_file, data_source, product_type, read_positions ):
    
    # Connect to db
    try:
        db = connect_to_db("fixed-income1.clmdxgxhslqn.us-east-1.rds.amazonaws.com", "live_trading", 'w')
        db_cursor = db.cursor(MySQLdb.cursors.DictCursor)
    except Exception, err:
        send_mail( err, 'Could not connect to db' )
        print traceback.format_exc()
def reconcile(current_date, to_check):    
    all_good = True
    # Connect to db
    try:
        db = connect_to_db("fixed-income1.clmdxgxhslqn.us-east-1.rds.amazonaws.com", "live_trading", 'w')
        db_cursor = db.cursor(MySQLdb.cursors.DictCursor)
    except Exception, err:
        print traceback.format_exc()
        send_mail( err, 'Could not connect to db' )
        sys.exit()
Beispiel #4
0
def manage_inventory(current_date, config_file, data_source, product_type,
                     read_positions):

    # Connect to db
    try:
        db = connect_to_db(
            "fixed-income1.clmdxgxhslqn.us-east-1.rds.amazonaws.com",
            "live_trading", 'w')
        db_cursor = db.cursor(MySQLdb.cursors.DictCursor)
    except Exception, err:
        send_mail(err, 'Could not connect to db')
        print traceback.format_exc()
def dump_eod_estimated_data(current_date,
                            product_type='future',
                            data_source='csi'):
    # Connect to db
    try:
        db = connect_to_db(
            "fixed-income1.clmdxgxhslqn.us-east-1.rds.amazonaws.com",
            "live_trading", 'w')
        db_cursor = db.cursor(MySQLdb.cursors.DictCursor)
    except Exception, err:
        send_mail(err, 'Could not connect to db')
        print traceback.format_exc()
Beispiel #6
0
def reconcile(current_date, to_check):
    all_good = True
    # Connect to db
    try:
        db = connect_to_db(
            "fixed-income1.clmdxgxhslqn.us-east-1.rds.amazonaws.com",
            "live_trading", 'w')
        db_cursor = db.cursor(MySQLdb.cursors.DictCursor)
    except Exception, err:
        print traceback.format_exc()
        send_mail(err, 'Could not connect to db')
        sys.exit()
def demystify_pnl(current_date, to_check):
    benchmarks = ["VBLTX", "VTSMX", "AQRIX", "AQMIX"]

    global db
    global db_cursor
    # Connect to db
    try:
        db = connect_to_db("fixed-income1.clmdxgxhslqn.us-east-1.rds.amazonaws.com", "live_trading", "w")
        db_cursor = db.cursor(MySQLdb.cursors.DictCursor)
    except Exception, err:
        send_mail(err, "Could not connect to db")
        print traceback.format_exc()
def demystify_pnl(current_date, to_check):
    benchmarks = ['VBLTX', 'VTSMX', 'AQRIX', 'AQMIX']

    global db
    global db_cursor
    # Connect to db
    try:
        db = connect_to_db(
            "fixed-income1.clmdxgxhslqn.us-east-1.rds.amazonaws.com",
            "live_trading", 'w')
        db_cursor = db.cursor(MySQLdb.cursors.DictCursor)
    except Exception, err:
        send_mail(err, 'Could not connect to db')
        print traceback.format_exc()
Beispiel #9
0
def main():
    # Parse arguments
    parser = argparse.ArgumentParser()
    parser.add_argument('--check', help='Do not send to slack\nEg: --check\n Default is to send to slack', default=False, dest='check', action='store_true')
    args = parser.parse_args()

    global db
    global db_cursor
    # Connect to db
    try:
        db = connect_to_db("fixed-income1.clmdxgxhslqn.us-east-1.rds.amazonaws.com", "live_trading", 'w')
        db_cursor = db.cursor(MySQLdb.cursors.DictCursor)
    except Exception, err:
        send_mail( err, 'Could not connect to db' )
        print traceback.format_exc()
def dump_statement_data(date):
    # mny20150427.csv  mtdvolfeed20150427.csv  pos20150427.csv  prltrades2_20150427.csv  st420150427.csv  statement.pdf
    dir_path = '/apps/wedbush/' + date + '/'
    order_file = dir_path + 'st4' + date + '.csv'
    positions_file = dir_path + 'pos' + date + '.csv'
    commission_file = dir_path + 'mtdvolfeed' + date + '.csv'
    money_file = dir_path + 'mny' + date + '.csv'

    # Connect to db
    try:
        db = connect_to_db("fixed-income1.clmdxgxhslqn.us-east-1.rds.amazonaws.com", "live_trading", 'w')
        db_cursor = db.cursor(MySQLdb.cursors.DictCursor)
    except Exception, err:
        print traceback.format_exc()
        send_mail( err, 'Could not connect to db' )
def dump_statement_data(date):
    # mny20150427.csv  mtdvolfeed20150427.csv  pos20150427.csv  prltrades2_20150427.csv  st420150427.csv  statement.pdf
    dir_path = '/apps/wedbush/' + date + '/'
    order_file = dir_path + 'st4' + date + '.csv'
    positions_file = dir_path + 'pos' + date + '.csv'
    commission_file = dir_path + 'mtdvolfeed' + date + '.csv'
    money_file = dir_path + 'mny' + date + '.csv'

    # Connect to db
    try:
        db = connect_to_db(
            "fixed-income1.clmdxgxhslqn.us-east-1.rds.amazonaws.com",
            "live_trading", 'w')
        db_cursor = db.cursor(MySQLdb.cursors.DictCursor)
    except Exception, err:
        print traceback.format_exc()
        send_mail(err, 'Could not connect to db')
Beispiel #12
0
def main():
    # TODO update realized pnl
    # Parse arguments
    parser = argparse.ArgumentParser()
    parser.add_argument('order_file')
    parser.add_argument('-t', type=str, help='Type  for products being ETFs\nEg: -t etf\n Default is future i.e. trading futures',default='future', dest='product_type')
    parser.add_argument('-t', type=str, help='Type  for products being ETFs\nEg: -t etf\n Default is future i.e. trading futures',default='future', dest='product_type')
    args = parser.parse_args()
    product_type = args.product_type

    # Connect to db
    try:
        db = connect_to_db("fixed-income1.clmdxgxhslqn.us-east-1.rds.amazonaws.com", "live_trading", 'w')
        db_cursor = db.cursor(MySQLdb.cursors.DictCursor)
    except Exception, err:
        send_mail( err, 'Could not connect to db' )
        print traceback.format_exc()