示例#1
0
def main(amount, year, month):
    value = {}
    date_range = []
    sum, avg, std = 0, 0, 0
    conn = db.get_conn()
    cursor = db.get_conn()

    # Gather all dates in month
    cursor.execute(
        "select distinct d.date from asset_value av, dates d where av.date_id = d.date_id and d.year = \'"
        + year + "\' and d.month_num = " + month +
        " and av.asset = 'AAPL' and av.volume != 0 order by av.date_id")
    rows = cursor.fetchall()
    for row in rows:
        date_range.append(row)

    for process_date in date_range:
        print process_date[0]
        print amount, str(process_date[0]), "4", "30", ".0025", "2", "1", "20"
        value[process_date[0]] = run_all.main(amount, str(process_date[0]),
                                              "4", "30", ".0025", "2", "1",
                                              "20")
        print value[process_date[0]]

    try:
        sum, avg, std = meanstdv_dict(value)
    except:
        print "fail"
        print value

    print "Date = " + year + "-" + month + ", Average Return = " + str(
        avg) + ", Std dev = " + str(std) + ", Return = " + str(sum)
    return (sum)
    cursor.close()
    conn.commit()
示例#2
0
def start_app(n=None):
    if n==None:
        #这句话表示设备名称从命令行获取
        deviceName = main(sys.argv[1:])
    else:
        deviceName=n

    if deviceName=="leidian":
        des = des_leidian
    elif deviceName=="xiaomi9":
        des = des_xiaomi9
    else:
        des = des_leidian
    driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", des)
    return driver
示例#3
0
def main():
    import run_all
    run_all.main(devmode=True)
示例#4
0
def main() -> None:
    import run_all
    run_all.main(devmode=True)
示例#5
0
def run_prices():
    if check_weekday() == True:
        main(full_refresh=True)
        send_message_to_discord('buy_signal?7')