Exemplo n.º 1
0
 def test_name_apple(self):
     name = r.get_name_by_symbol('aapl')
     assert name == "Apple"
Exemplo n.º 2
0
historicalData list and you are free to do whatever you want with it.

NOTE: closing prices are plotted in red and opening prices plotted in blue.
Matplotlib also has a candlestick option that you can use.
'''

#!!! Fill out username and password
username = ''
password = ''
#!!!

login = r.login(username, password)

#!!! fill out the specific option information
symbol = 'AAPL'
symbol_name = r.get_name_by_symbol(symbol)
expirationDate = '2020-07-02'  # format is YYYY-MM-DD.
strike = 300
optionType = 'call'  # available options are 'call' or 'put' or None.
interval = 'hour'  # available options are '5minute', '10minute', 'hour', 'day', and 'week'.
span = 'week'  # available options are 'day', 'week', 'year', and '5year'.
bounds = 'regular'  # available options are 'regular', 'trading', and 'extended'.
info = None
#!!!

historicalData = r.get_option_historicals(symbol, expirationDate, strike,
                                          optionType, interval, span, bounds,
                                          info)

dates = []
closingPrices = []
Exemplo n.º 3
0
 def test_name_by_symbol(self):
     name = r.get_name_by_symbol(self.single_stock)
     assert (name == 'Apple')
     fake_name = r.get_name_by_symbol(self.fake_stock)
     assert (fake_name == '')