Example #1
0
def crypto_history(symbol, interval, span):
    ui.success(f'\nGetting {interval} stock historicals for {symbol} for the past {span}....\n')
    result = rh.get_crypto_historicals(symbol, interval, span)

    for i in result:
        for x in i:
            ui.success(f'{x}: {i[x]}')
        ui.bar()
Example #2
0
def watchlist():
    print('\nGetting quotes for watchlist....\n')
    
    with open('watchlist') as f:
        symbols = f.read().splitlines()

    quotes = rh.get_quotes(symbols)

    for quote in quotes:
        ui.success(quote)
        ui.bar()
Example #3
0
 def test_find_avg_syl(self):
     #统计历史平均市盈率小于某值的个数
     scopre = [10, 15, 20, 30]
     nums = []
     codes = stock.get_codes()
     #codes = ['300033']
     df_jll = stock.THS().df_year
     for v in scopre:
         cur_codes = find_avg_syl(codes, df_jll, syl=v)
         print len(cur_codes)
         nums.append(len(cur_codes))
     ui.bar(pl, scopre, nums)
Example #4
0
def get_lines(symbol, interval, span):
    ui.success(f'\nGetting {interval} stock historicals for {symbol} for the past {span}....\n')
    result = rh.get_stock_historicals(symbol, interval, span)

    price = rh.get_quotes(symbol)[0]['last_extended_hours_trade_price']

    ui.bar()
    print(f"Value: {price}")
    ui.bar()
    df = funcs.make_df(result)
    funcs.get_s_r(df)
    ui.bar()