Esempio n. 1
0
def stockPrice_check(stock, check_price):
    stockdf = intraday.trades(apiToken="你的Token",
                              output="dataframe",
                              symbolId=stock)
    nowprice = stockdf['price'].values[-1]
    if nowprice > check_price:
        print(stock + ' 目前價格 ' + str(nowprice))
Esempio n. 2
0
def test_intraday_trades_output_raw():
    trades = intraday.trades(output="raw")
    assert type(trades) is list
Esempio n. 3
0
def test_intraday_trades_output():
    with raises(ValueError) as excinfo:
        intraday.trades(output="")
    assert excinfo.type is ValueError
    assert str(excinfo.value) == 'output must be one of ["dataframe", "raw"]'
Esempio n. 4
0
def test_intraday_trades_output_dataframe():
    trades = intraday.trades(output="dataframe")
    assert type(trades) is DataFrame
Esempio n. 5
0
def test_intraday_trades():
    trades = intraday.trades()
    assert type(trades) is DataFrame