Beispiel #1
0
def test():
    watchlist = ["USO"]
    marketData = USMarket(watchlist, "2016-04-05")
    dataset, missing = marketData.getData("daily")
    symset = [sym for sym in watchlist if sym not in missing]
    cp = ChartPatterns(symset, dataset)
    cp.run()
Beispiel #2
0
def main():
    args = arg_parser()
    if args.symbol != None:
        watchlist = [args.symbol]
    else:
        watchlist = read_watchlist(args.filename)

    if args.date != None:
        marketData = USMarket(watchlist, args.date)
    else:
        marketData = USMarket(watchlist)

    print_progress("requesting daily data")
    daily, missing1 = marketData.getData("daily")
    print_progress("requesting weekly data")
    weekly, missing2 = marketData.getData("weekly")
    all_missing = set(missing1) | set(missing2)
    if len(all_missing) > 0:
        print("symbols missing data: " + str(all_missing))
    symlist = [sym for sym in watchlist if sym not in all_missing]

    print(" ----------- ChartPatterns Weekly -------------")
    cp_weekly = ChartPatterns(symlist, weekly)
    cp_weekly.run()

    print(" ----------- ChartPatterns Daily  -------------")
    cp_daily = ChartPatterns(symlist, daily)
    cp_daily.run()

    print(" ----------- TripleScreen Screen (2 screens)---")
    ts = TripleScreen(symlist, weekly, daily)
    decision = ts.run()
    longStr = shortStr = "(None)"
    if decision["long"] != None and len(decision["long"]) > 0:
        longStr = " ".join(decision["long"])
    if decision["short"] != None and len(decision["short"]) > 0:
        shortStr = " ".join(decision["short"])
    print("long: " + longStr)
    print("short: " + shortStr)

    """