Ejemplo n.º 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()
Ejemplo n.º 2
0
 def test_getData(self):
     watchlist = ['AAPL']
     # usm = USMarket(watchlist, '2016-01-04')
     usm = USMarket(watchlist)
     daily, missing1 = usm.getData('daily')
     weekly, missing2 = usm.getData('weekly')
     print(str(daily))
     print(str(weekly))
Ejemplo n.º 3
0
def main() :
    watchlist = ['AAPL', 'GPRO', 'PANW', 'TWTR']
    print(watchlist)
    marketData = USMarket(watchlist, '2016-06-10')

    data, missing = marketData.getData('daily')
    ta = ChartPatterns(watchlist, data)
    ta.run()
    print('missing? '+str(missing))
Ejemplo n.º 4
0
def main() :
    watchlist = ['ORBC']
    marketData = USMarket(watchlist, '2016-06-19')

    weekly, missing1 = marketData.getData('weekly')
    daily, missing2 = marketData.getData('daily')
    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]
    ts = TripleScreen(symlist, weekly, daily)
    decision = ts.run()
    print(str(decision))
Ejemplo n.º 5
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)

    """