Пример #1
0
def update_quotes():
    """Retrieves all required historical quotes"""
    logger = logging.getLogger(__name__)
    logger.info('Updating quotes ...')

    all_symbols = [
        'VIX', 'VXST', 'VXV', 'VXMT', 'VVIX', 'SPX', 'XIV', 'VXX', 'TLT']
    for symbol in all_symbols:
        stocks.fetch_historical(symbol)
    structures.update_stocks_vol('SPX')

    futures.fetch_historical('VX')
    options.fetch_historical('SPX')
    logger.info('Done')
Пример #2
0
 def test_query_historical_vx(self):
     test_date = date(2015, 12, 4)
     futures.fetch_historical('VX', TEST_DB_NAME)
     quotes = futures.query_historical('VX', test_date, TEST_DB_NAME)
     self._check_quotes(quotes, 'VX', test_date)
Пример #3
0
 def test_fetch_historical_vx(self):
     lines = futures.fetch_historical('VX', TEST_DB_NAME)
     self.assertGreater(lines, 0)
     self._check_database_quotes('VX', lines, date(2015, 12, 15), 9)