コード例 #1
0
def get_market_gainers(*args, **kwargs):
    """
    MOVED to iexfinance.stocks.get_market_gainers
    """
    import warnings
    warnings.warn(WNG_MSG, ("get_market_gainers", "stocks.get_market_gainers"))
    return stocks.get_market_gainers(*args, **kwargs)
コード例 #2
0
 def get_winners(self):
     """
     Get winner values:
         ticker
         price
         $ & % change
         volume
     Save to excel
     """
     print("[SS]-[API] Getting winners...")
     winners_df = get_market_gainers(token=self.api_key,
                                     output_format="pandas")
     return StockInfo(winners_df)
コード例 #3
0
def data_parse():
    data = get_market_gainers(token=iex_key)
    datax = get_market_losers(token=iex_key)
    datay = get_market_most_active(token=iex_key)

    symbol = [data[0]['symbol'], data[1]['symbol'], data[2]['symbol']]
    df = yf.download(symbol,
                     period='6mo',
                     interval='1d',
                     group_by='ticker',
                     auto_adjust=True)

    data1 = df[symbol[0]]
    data2 = df[symbol[1]]
    data3 = df[symbol[2]]

    return data, datax, datay, data1, data2, data3, symbol
コード例 #4
0
    def test_market_gainers(self):
        li = get_market_gainers()

        assert isinstance(li, pd.DataFrame)
        assert len(li) == pytest.approx(10, 1)
コード例 #5
0
 def test_market_gainers(self):
     li = get_market_gainers()
     assert len(li) == pytest.approx(21, 1)
コード例 #6
0
def get_market_gainers(*args, **kwargs):
    return stocks.get_market_gainers(*args, **kwargs)
コード例 #7
0
# GET INTRADAY DATA
import datetime
import requests_cache

from iexfinance.stocks import (
    Stock,
    get_historical_intraday,
    get_collections,
    get_market_gainers,
    get_market_most_active,
)

# SET UP CACHE
expiry = datetime.timedelta(days=3)
session = requests_cache.CachedSession(
    cache_name="stock-data", backend="sqlite", expire_after=expiry
)

# date = datetime.datetime(2019, 5, 10)

# print(get_historical_intraday("AAPL", session=session))
# print(get_collections("Computer Hardware", output_format="pandas").head())
a = get_market_gainers(session=session)
# print(a)
print(a[["previousClose", "latestPrice", "changePercent"]])
b = Stock("MOGU")
b.get_quote(session=session)
print(b.get_quote()[["previousClose", "latestPrice", "changePercent"]])
# print(get_market_most_active())
コード例 #8
0
from iexfinance.stocks import get_market_gainers
from dotenv import load_dotenv
from ..core.output import printTable
from ..database.functions import dynamicUpdateCreate
import requests
import json
import sys
load_dotenv()

gainers = get_market_gainers()
print(gainers)

コード例 #9
0
def get_market_gainers(*args, **kwargs):
    import warnings
    warnings.warn(WNG_MSG % "get_market_gainers")
    return stocks.get_market_gainers(*args, **kwargs)