Ejemplo n.º 1
0
    def updated_assets_values_gen(self, forced=False):
        '''Crea un dataframe dei valori attuali di stock e currency dal sito Yahoo Finance'''

        last_download = dt.datetime.fromtimestamp(
            stat('stock_value.csv').st_mtime).strftime("%d/%m/%y")

        if last_download != self.date or forced:
            try:
                # stocks
                self.updated_stock_values = DataFrame()
                for symbol in list(set(self.assets['stock']['simbolo'])):
                    temp = data.get_quote_yahoo(symbol)
                    self.updated_stock_values = self.updated_stock_values.append(
                        temp)
                self.updated_stock_values.index.name = 'simbolo'
                self.updated_stock_values = self.updated_stock_values.drop(
                    ['PE', 'short_ratio', 'time', 'change_pct'], axis=1)

                # currency
                self.updated_currency_values = DataFrame()
                for symbol in list(set(self.assets['currency']['simbolo'])):
                    temp = data.get_quote_yahoo(symbol)
                    self.updated_currency_values = self.updated_currency_values.append(
                        temp)
                self.updated_currency_values.index.name = 'simbolo'
                self.updated_currency_values = self.updated_currency_values.drop(
                    ['PE', 'short_ratio', 'time', 'change_pct'], axis=1)

                self.updated_asset_values_save()
            except ConnectionError:
                self.updated_stock_values = DataFrame().from_csv('stock_value.csv')
                self.updated_currency_values = DataFrame().from_csv('currency_value.csv')
        else:
            self.updated_stock_values = DataFrame().from_csv('stock_value.csv')
            self.updated_currency_values = DataFrame().from_csv('currency_value.csv')
Ejemplo n.º 2
0
def get_market_caps(symbols=['GOOG', 'AMZN'], method='yahoo', debug=False):

    if method == 'yahoo':
        if debug:
            print(data.get_quote_yahoo(symbols)['Market Cap'])

        w_m = [
            float(mcap[:-1])
            for mcap in data.get_quote_yahoo(symbols)['Market Cap'].values
        ]

        if debug:
            print(w_m)

    elif method == 'etfdb':
        r = requests.get("http://etfdb.com/compare/market-cap/")
        soup = BeautifulSoup(r.text, 'html5lib')
        rows = soup.find_all('tr')

        aums = {}
        for row in rows:
            columns = row.find_all('td')
            if len(columns) > 0:
                sym = columns[0].get_text()
                aum = columns[2].get_text()

                if sym in symbols:
                    print("Found symbol {}, adding...".format(sym))
                    aums[sym] = float(aum[1:].replace(',', ''))

        w_m = [aums[sym] for sym in portfolio]

    return w_m
Ejemplo n.º 3
0
 def test_get_quote_series(self):
     stringlist = ['GOOG', 'AAPL']
     fields = ['exchange', 'sharesOutstanding', 'epsForward']
     try:
         AAPL = web.get_quote_yahoo('AAPL')
         df = web.get_quote_yahoo(pd.Series(stringlist))
     except ConnectionError:
         pytest.xfail(reason=XFAIL_REASON)
     tm.assert_series_equal(AAPL.iloc[0][fields], df.loc['AAPL'][fields])
     assert sorted(stringlist) == sorted(list(df.index.values))
Ejemplo n.º 4
0
 def test_get_quote_series(self):
     stringlist = ["GOOG", "AAPL"]
     fields = ["exchange", "sharesOutstanding", "epsForward"]
     try:
         AAPL = web.get_quote_yahoo("AAPL")
         df = web.get_quote_yahoo(pd.Series(stringlist))
     except ConnectionError:
         pytest.xfail(reason=XFAIL_REASON)
     tm.assert_series_equal(AAPL.iloc[0][fields], df.loc["AAPL"][fields])
     assert sorted(stringlist) == sorted(list(df.index.values))
Ejemplo n.º 5
0
def percentage_change():
    with open("nasdaqnamesandticker.pickle",
              "rb") as f:  ##wb is write bytes, rb is read bytes
        nat = pickle.load(f)  ##think we got the ticker list
        #print(tickers) OK
        start = dt.datetime(2015, 1, 1)
        end = dt.datetime(2016, 1, 1)
        #df = web.DataReader('ASSA-B.ST', 'yahoo', start, end)
        for lst in nat:
            #print(ticker)
            ticker = lst[1]
            ticker = ticker.replace(' ', '-')
            ticker = ticker + '.ST'
            df = web.get_quote_yahoo(ticker)
            df.drop(['PE', 'short_ratio'], 1, inplace=True)
            name = lst[0]
            #print(df.head())
            requirement = 2.00
            #if df(['change_pct'] > abs(requirement):
            s = df['change_pct']
            #if df.iloc[lambda df: df.change_pct > abs(requirement)]:
            #print(s)
            #df.iloc[0]
            df['change_pct'] = pd.to_numeric(df['change_pct'].str.replace(
                '%', ''))  #.str.replace('+', '').str.replace('-', ''))
            #print(df.dtypes)
            #if df.loc[lambda df: df.change_pct > abs(requirement)]:
            for num in df['change_pct']:
                if num > requirement:
                    print('Buy: ', name, ticker, num)
Ejemplo n.º 6
0
 def get_market_cap(self):
     try:
         market_cap = data.get_quote_yahoo(self.Symbol)['marketCap']
         return market_cap.values[0]
     except Exception as e:
         print(str(e))
         return 0.0
Ejemplo n.º 7
0
def get_market_cap(symbol):
    """
    Finds company's market cap based off the company's ticker symbol.
    Value returned will be USD for US companies. 
    **Need to address different currencies and possibly include currency conversion

    e.g. get_market_cap('GOOG')
         returns 1034277860323

    Parameters:
    -------------
    symbol: str - Company's ticker symbol

    Returns:
    -------------
    cap: int - Market cap of company in currency of country company is located in
    """
    try:
        cap = pd_data.get_quote_yahoo(symbol)["marketCap"]
        cap = cap[symbol]

    except:
        print(f"Market cap for {symbol} not found.")
        cap = "n/a"

    return cap
Ejemplo n.º 8
0
def cleanup_data(ticker):
    keys = [
        'shortName', 'price', 'regularMarketChangePercent',
        'regularMarketOpen', 'regularMarketDayHigh', 'regularMarketDayLow',
        'regularMarketVolume', 'marketCap', 'earningsTimestampStart',
        'earningsTimestampEnd', 'postMarketPrice', 'postMarketChangePercent',
        'preMarketPrice', 'preMarketChangePercent'
    ]
    ticker = ticker.upper()
    res = {}
    ticker_data = data.get_quote_yahoo(ticker)
    for key in keys:
        if key in ticker_data:
            res[key] = ' '.join(' '.join(
                ticker_data[key].to_string().split()).split(' ')[1:])
        else:
            res[key] = '0'
    res['regularMarketChangePercent'] = str(
        round(float(res['regularMarketChangePercent']), 2)) + '%'
    res['regularMarketVolume'] = "{:,}".format(int(res['regularMarketVolume']))
    res['marketCap'] = millify(res['marketCap'])
    res['postMarketChangePercent'] = str(
        round(float(res['postMarketChangePercent']), 2)) + '%'
    res['preMarketChangePercent'] = str(
        round(float(res['preMarketChangePercent']), 2)) + '%'
    res['earning'] = convert_er(
        [res['earningsTimestampStart'], res['earningsTimestampEnd']])
    #print (res['preMarketPrice'],res['postMarketPrice'])
    return res
Ejemplo n.º 9
0
def quotes(symbols, provider='yahoo'):
    if provider == 'robinhood':
        quote_df = web.get_quotes_robinhood(map(str, symbols))
        return quote_df.loc['last_trade_price'].astype(float)
    elif provider == 'yahoo':
        quote_df = web.get_quote_yahoo(map(str, symbols))
        return quote_df.price.astype(float)
Ejemplo n.º 10
0
def pe_ratio(ticker, components): 
	quote = data.get_quote_yahoo(ticker)
	PE = quote['PE'][0]
	if PE=='N/A':
		return {"message": Response.pe_notfound(ticker)}
	PE = ('%.2f' % PE)
	return {"message": Response.pe_response(ticker, PE)}
Ejemplo n.º 11
0
def quote(symbol, provider='yahoo'):
    if provider == 'robinhood':
        quote_df = web.get_quotes_robinhood(str(symbol))
        return float(quote_df.loc['last_trade_price'].iloc[0])
    elif provider == 'yahoo':
        quote_df = web.get_quote_yahoo(str(symbol))
        return float(quote_df.price.iloc[0])
Ejemplo n.º 12
0
    def test_get_quote_string(self):
        try:
            df = web.get_quote_yahoo("GOOG")
        except ConnectionError:
            pytest.xfail(reason=XFAIL_REASON)

        assert not pd.isnull(df["marketCap"][0])
Ejemplo n.º 13
0
def getQuote(port):
    quote=data.get_quote_yahoo(port.Symbol).price
    quote=quote.rename('currentPrice')
    port=port.merge(quote.to_frame(),left_on='Symbol', right_index=True)
    port['Profit']=(port.currentPrice-port.Price)*port.Share
    port['Total']=port.currentPrice*port.Share
    return port, datetime.now().strftime("%m/%d/%Y, %H:%M:%S")
Ejemplo n.º 14
0
 def test_get_quote_stringlist(self):
     stringlist = ["GOOG", "AAPL"]
     try:
         df = web.get_quote_yahoo(stringlist)
     except ConnectionError:
         pytest.xfail(reason=XFAIL_REASON)
     assert sorted(stringlist) == sorted(list(df.index.values))
Ejemplo n.º 15
0
    def prepare_input(self):
        # 1. Collect user selected tickers' stock price
        all_data_df = pd.DataFrame({})
        time_step = 180

        for ticker in self.selected_tickers:
            train_df, test_df = self.read_stock_file(ticker)
            # axis=0 -> combine vertically
            dataset_total = pd.concat([train_df, test_df], axis=0)
            inputs = dataset_total[len(dataset_total) - len(test_df) -
                                   time_step:]['adj_close']
            all_data_df[ticker] = inputs

        # 2. Prepare main markowitz inputs
        # 2-1. price_df -> price_list
        prices_list = []
        for i in range(time_step, len(all_data_df)):
            price_t = all_data_df[i - time_step:i].T
            prices_list.append(price_t)

        # 2-2. get market capitalization
        end = dt.datetime(2016, 12, 31)
        market_caps = list(
            data.get_quote_yahoo(self.selected_tickers, end)['marketCap'])

        return prices_list, market_caps
Ejemplo n.º 16
0
    def buy_sell_hold(self):
        """
        Sentiment > 6: buy 3x (change to distance from high)
        Sentiment > 4: buy 2x
        Sentiment > 2: buy 1x
        :param sentiment:
        :return:
        """
        etfs = []
        # Check if we are holding
        if len(buys) > 0:
            for buy in buys:
                last = get_quote_yahoo(buy[0])
                if self.sentiment <= 6.0:
                    if buy[0] == 'UDOW':
                        sells.append({})
                    elif buy[0] == 'SPXL':
                        sells.append({})
                    elif buy[0] == 'TQQQ':
                        sells.append({})

        # Check sentiment to buy
        if self.sentiment > 6.0:
            etfs.append('UDOW')
            etfs.append('SPXL')
            etfs.append('TQQQ')
        elif self.sentiment > 4.0:
            etfs.append('DDM')
            etfs.append('SSO')
            etfs.append('QLD')
        elif self.sentiment > 2.0:
            etfs.append('DIA')
            etfs.append('SPY')
            etfs.append('QQQ')
        if len(etfs) == 0:
            print("No ETFs to buy")
        else:
            for etf in etfs:
                # Record last price (potential buy)
                last = get_quote_yahoo(etf)
                print("Last %s price: %f" % (etf, last['price']))
                buys.append({
                    etf:
                    last['price'],
                    'timestamp':
                    str(time.strftime("%Y/%m/%d %H:%M:%S"))
                })
Ejemplo n.º 17
0
    def test_get_quote_string(self):
        _yahoo_codes.update({'MarketCap': 'j1'})
        try:
            df = web.get_quote_yahoo('GOOG')
        except ConnectionError:
            pytest.xfail(reason=XFAIL_REASON)

        assert not pd.isnull(df['MarketCap'][0])
Ejemplo n.º 18
0
 def test_get_quote_comma_name(self):
     _yahoo_codes.update({'name': 'n'})
     try:
         df = web.get_quote_yahoo(['RGLD'])
     except ConnectionError:
         pytest.xfail(reason=XFAIL_REASON)
     del _yahoo_codes['name']
     assert df['name'][0] == 'Royal Gold, Inc.'
Ejemplo n.º 19
0
def getprice(label="WIPRO.NS", sleep_time=1):
    # Pause for sleep_time number of seconds
    sleep(sleep_time)
    # Using yahoo finance to get the stock market live data
    quote = web.get_quote_yahoo(label)
    price = quote["price"].values[0]
    current_time = datetime.datetime.now()
    return tuple([price, current_time])
Ejemplo n.º 20
0
def realtime(company):
    stock = pdr.get_quote_yahoo(company)
    price = stock['price'][0]
    volume = stock['regularMarketVolume'][0]
    localtime = str(time.strftime("%Y-%m-%d %H:%M:%S",
                                  time.localtime()))  # record time
    # localtime=lt[0:4]+lt[5:7]+lt[8:10]+lt[11:13]+lt[14:16]+lt[17:19]
    return price, volume, localtime
Ejemplo n.º 21
0
 def get_ticker_data(self, ticker, start_date=None, end_date=None):
     if not start_date and not end_date:
         start_date = self.todays_date
         end_date = self.todays_date
     #panel_data = pdr.DataReader([ticker], self.data_source, start_date, end_date)
     todays_data = pdr.get_quote_yahoo(ticker)
     #todays_data = panel_data.ix['2017-09-19']
     return todays_data
Ejemplo n.º 22
0
def get_capweight():
    tickers = [
        'AAPL', 'AXP', 'BA', 'CAT', 'CSCO', 'CVX', 'DIS', 'DD', 'GS', 'HD',
        'IBM', 'INTC', 'JNJ', 'JPM', 'KO', 'MCD', 'MMM', 'MRK', 'MSFT', 'NKE',
        'PFE', 'PG', 'TRV', 'UNH', 'UTX', 'V', 'VZ', 'WBA', 'WMT', 'XOM'
    ]
    result = data.get_quote_yahoo(tickers)['marketCap']

    return result
Ejemplo n.º 23
0
def getQuoteYahoo(symbol):
    #symbol = 'GBPINR=X'   #'USDAUD=X'   #'BTCUSD=X'   #'USDINR=X'   #'^NSEI'    #AAPL
    #arrSymbol = ['USDAUD=X','USDAUD=X','BTCUSD=X','USDINR=X','^NSEI','AAPL',]
    panel_data = web.get_quote_yahoo(symbol)  #web.get_quote_yahoo(symbol)
    #pd.set_option("display.max_rows", None, "display.max_columns", None)
    #print(panel_data[['price','quoteType','exchangeDataDelayedBy','exchange']])
    #print(panel_data)
    #print(panel_data.columns)
    #print (f"{symbol}: <{panel_data.iloc[0]['price']}>")
    return (panel_data.iloc[0]['price'])
Ejemplo n.º 24
0
def GetDividendYieldAndPERatio(Ticker):
    import pandas as pd
    _ = data.get_quote_yahoo(Ticker)
    _ = _[[
        'trailingAnnualDividendRate', 'trailingPE',
        'trailingAnnualDividendYield', 'marketCap', 'priceToBook', 'forwardPE',
        'price', 'tradeable'
    ]]
    _['marketCap Billions'] = _['marketCap'] / 1000000000
    return _
Ejemplo n.º 25
0
def getSingleQuoteYahoo(symbol):
    print(f'Entering getSingleQuoteYahoo():: symbol:{symbol}')
    symMappings = {
        'NIFTY 50': '^NSEI',
        'USDINR': 'USDINR=X',
        'BTCUSD': 'BTCUSD=X'
    }
    yahooSym = symMappings.get(symbol)
    print(f'symbol:{symbol} yahooSym:{yahooSym}')
    panel_data = web.get_quote_yahoo(yahooSym)  #web.get_quote_yahoo(symbol)
    return (panel_data.iloc[0]['price'])
Ejemplo n.º 26
0
def main():
    companies = read_companies('companies.csv')
    append = False

    for chunk in chunks(companies, 100):
        tickers = [row["Symbol"] for row in chunk]
        market_cap_data = data.get_quote_yahoo(tickers)['marketCap']
        for market_cap, company in zip(market_cap_data, chunk):
            company["Market cap"] = market_cap

        write_companies('companies.csv', chunk, append)
        append = True
Ejemplo n.º 27
0
def append_detailed_info(_tickers_data):
    """ Includes additional info for each stock, downloaded from yahoo.com API """
    # https://stackoverflow.com/questions/54815864/downloading-a-companies-market-cap-from-yahoo
    from pandas_datareader import data

    _tickers_list = _tickers_data['Symbol'].values
    _tickers_extended_data = _tickers_data.set_index('Symbol')
    print('Downloading Market Cap data')
    _tmp_df = data.get_quote_yahoo(_tickers_list)['marketCap']
    _tickers_extended_data = _tickers_extended_data.join(_tmp_df)
    print('Downloading Dividend Date data')
    _tmp_df = data.get_quote_yahoo(_tickers_list)['dividendDate']
    _tickers_extended_data = _tickers_extended_data.join(
        pd.to_datetime(_tmp_df, unit='s'))
    print('Downloading Annual Dividend Yield data')
    _tmp_df = data.get_quote_yahoo(
        _tickers_list)['trailingAnnualDividendYield']
    _tickers_extended_data = _tickers_extended_data.join(_tmp_df)
    print('Downloading Annual Dividend Rate data')
    _tmp_df = data.get_quote_yahoo(_tickers_list)['trailingAnnualDividendRate']
    _tickers_extended_data = _tickers_extended_data.join(_tmp_df)
    print('Downloading Average Daily Volume data')
    _tmp_df = data.get_quote_yahoo(_tickers_list)['averageDailyVolume3Month']
    _tickers_extended_data = _tickers_extended_data.join(_tmp_df)
    print('Downloading Shares Outstanding data')
    _tmp_df = data.get_quote_yahoo(_tickers_list)['sharesOutstanding']
    _tickers_extended_data = _tickers_extended_data.join(_tmp_df)

    return _tickers_extended_data
Ejemplo n.º 28
0
def get_stocks(stock_index):
    stock_tickers = []
    stock_data = PyTickerSymbols()
    list_stocks = stock_data.get_stocks_by_index(stock_index)
    #st.write(list(german_stocks))
    for i in list_stocks:
        tickersymbol = i['symbols'][0]['yahoo']
        stock_tickers.append(tickersymbol)
    df = web.get_quote_yahoo(stock_tickers)
    df.set_index('shortName', inplace=True, drop=True)
    st.write(df[[
        'marketCap', 'bookValue', 'price', 'priceToBook', 'fiftyDayAverage',
        'fiftyTwoWeekRange', 'bidSize', 'askSize'
    ]])
    st.write(stock_tickers)
Ejemplo n.º 29
0
def load_mkt_caps(symbols, curr_date):
    print('loading market cap data')
    mcaps = pd_data.get_quote_yahoo(symbols)['marketCap']
    missing_mcap_symbols = mcaps[mcaps.isnull()].index
    for symbol in missing_mcap_symbols:
        print('attempting to find market cap info for', symbol)
        data = yfinance.Ticker(symbol)
        if data.info['quoteType'] == 'ETF' or data.info[
                'quoteType'] == 'MUTUALFUND':
            mcap = data.info['totalAssets']
            print('adding market cap info for', symbol)
            mcaps.loc[symbol] = mcap
        else:
            print('Failed to find market cap for', symbol)
            sys.exit(-1)
    return mcaps
Ejemplo n.º 30
0
def pull_data(begin_date, end_date, i):
    #pulling in df to set baseline for outstanding shares
    df3 = pdr.get_data_yahoo(i, dt.datetime(2020, 12, 23),
                             dt.datetime(2020, 12, 24))
    mkt_cap = pdr.get_quote_yahoo(i)['marketCap']
    outstanding_shares = mkt_cap / df3['Adj Close'][-1]
    #pulling in rest of data
    df = pdr.get_data_yahoo(i, begin_date, end_date)
    uat.uat_df_columns(df, outstanding_shares)
    #adjusting df before importing to db
    df.insert(0, 'ticker', i)  #putting ticket at beginning
    df = df.reset_index()  #date as index (to rename it)
    config.rename_df_columns(
        df)  #renaming columns so they are query-able in sql
    df = df.set_index("date")  #adding date back in as index
    print(i)
    return df
Ejemplo n.º 31
0
def getQuotes():
    tickers = data["Ticker"]

    print("Getting current prices from Yahoo Finance...")
    balances = []

    for i in range(0, len(tickers)):
        ac = data["AC"][i]
        # If Asset Class is cash, then get amount only
        if ac == "CASH" or ac == "P2P":
            balances.append(data["Amount"][i])
        else:
            try:
                currPrice = get_quote_yahoo(tickers[i])["price"][0]
                amount = data["Amount"][i]
                balances.append(round(currPrice * amount, 2))
            except Exception:
                print("No quote for this ticker")
    data["Balance"] = balances
Ejemplo n.º 32
0
def import_stock_market_data():
    import time
    from datetime import datetime
    import pandas_datareader.data as web
    from pandas_datareader.yahoo.quotes import _yahoo_codes

    _yahoo_codes.update({'MarketCap': 'j1'})
    _yahoo_codes.update({'LastTradeDate': 'd1'})

    stock_queryset = Stock.objects.filter(stock_code__endswith='.asx')

    for stock in stock_queryset:
        yahoo_code = stock.stock_code[0:3].upper() + '.AX'
        stock_quote = web.get_quote_yahoo(yahoo_code)

        if not stock_quote.empty:
            try:
                last_trade_date_str = stock_quote.loc[yahoo_code,
                                                      'LastTradeDate']
                if last_trade_date_str != 'N/A':
                    stock.market_data_date = datetime.strptime(
                        last_trade_date_str, '%m/%d/%Y')

                market_cap_str = stock_quote.loc[yahoo_code, 'MarketCap']
                market_cap_unit = market_cap_str[-1:]
                if market_cap_unit == 'M':
                    stock.market_value = float(market_cap_str[:-1]) * 1e6
                elif market_cap_unit == 'B':
                    stock.market_value = float(market_cap_str[:-1]) * 1e9
                else:
                    raise Exception(
                        'Unknown yahoo stock market value unit - {}'.format(
                            market_cap_str))

                stock.save()
            except Exception as exception:
                print(exception)
                continue

        # Do not do too quickly, or the Yahoo finance may block us
        time.sleep(0.01)
Ejemplo n.º 33
0
 def price(self):
     return pdr.get_quote_yahoo(self.ticker)['last'][0]
Ejemplo n.º 34
0
 def test_get_quote_stringlist(self):
     df = web.get_quote_yahoo(['GOOG', 'AAPL', 'GOOG'])
     assert_series_equal(df.ix[0], df.ix[2])
Ejemplo n.º 35
0
 def test_get_quote_string(self):
     _yahoo_codes.update({'MarketCap': 'j1'})
     df = web.get_quote_yahoo('GOOG')
     self.assertFalse(pd.isnull(df['MarketCap'][0]))
Ejemplo n.º 36
0
 def test_get_quote_string(self):
     df = web.get_quote_yahoo('GOOG')
Ejemplo n.º 37
0
 def test_get_quote_series(self):
     df = web.get_quote_yahoo(pd.Series(['GOOG', 'AAPL', 'GOOG']))
     assert_series_equal(df.ix[0], df.ix[2])
Ejemplo n.º 38
0
 def current_price(self, ticker):
     ticker = ticker + ".AX"
     quote = pd_data.get_quote_yahoo(ticker)
     return quote["last"][ticker]
Ejemplo n.º 39
0
def GetStockQuote(symbol) :
    quote = web.get_data_yahoo(symbol,thirty_days.strftime("%m/%d/%Y"), time.strftime("%m/%d/%Y"))
    #quote = web.get_data_yahoo(symbol,thirty_days.strftime("%m/%d/%Y"), twenty_days.strftime("%m/%d/%Y"))
    return quote


#from talib import MA_Type
from talib import MA_Type
upper, middle, lower = ta.BBANDS(close, matype=MA_Type.T3)
# Own test end


import pandas_datareader.data as web
from pandas.io.data import _yahoo_codes

a=web.get_quote_yahoo("MSFT")
b=_yahoo_codes.update({'MarketCap' : 'j1'})
print(a)
print(b)

a=web.get_quote_yahoo("GEN.CO")
b=_yahoo_codes.update({'52WeekLow' : 'j'})
print(a)
print(b)

print("stop")

aapl = web.get_data_yahoo("GEN.CO",'1/1/2016', '5/20/2016')
#appl = web.get_data_google("GEN",'1/1/2016', '5/20/2016')
#print(aapl.Close) # get all close price
Ejemplo n.º 40
0
 def test_get_quote_comma_name(self):
     _yahoo_codes.update({'name': 'n'})
     df = web.get_quote_yahoo(['RGLD'])
     del _yahoo_codes['name']
     self.assertEqual(df['name'][0], 'Royal Gold, Inc.')