Esempio n. 1
0
def test5():
    symbol_list = []
    lines = open(config.TRADABLE_STOCKS, 'r').read().split('\n')
    for line in lines:
        if len(line) > 0:
            symbol_list.append(line)

    #symbol_list = ['CSCO']

    q = Quote()
    a = Analysis()
    p = RenkoPatterns()
    spy_df = q.get('spy', 'google')

    for sym in symbol_list:
        df = q.get(sym, 'google')
        if df is not None:
            a.analysis(sym, df, spy_df)
            df.to_csv(DATA_DIR + sym + '.csv')
Esempio n. 2
0
def test8():
    q = Quote()
    filelist = [
        f for f in os.listdir(DATA_DIR) if f.endswith('.csv')
        and not f.endswith('_analysis.csv') and not f.endswith('_renko.csv')
    ]
    for f in filelist:
        sym = f.split('.')[0]
        if sym == 'SPY':
            continue
        print 'Analysing', sym, '....'
        df = pd.read_csv(DATA_DIR + f, index_col=0)

        if df.loc['2017-07-31']['open'] == '-' or df.loc['2017-07-31'][
                'high'] == '-' or df.loc['2017-07-31']['low'] == '-' or df.loc[
                    '2017-07-31']['close'] == '-':
            ndf = q.get(sym, 'nasdaq')
            print df.loc['2017-07-31']
            print ndf.loc['2017-07-31']

            df.replace(df.loc['2017-07-31'], ndf.loc['2017-07-31'], True)
            print df.loc['2017-07-31']
            print ndf.loc['2017-07-31']
            df.to_csv(DATA_DIR + sym + '.csv')
Esempio n. 3
0
def test1(sym):
    q = Quote()
    df = q.get(sym, 'nasdaq')

    print df