Notebook
In [134]:
vixx = local_csv('Book3.csv',  date_column='Date', symbol_column='Symbol')
In [102]:
print vixx.rank(pct=True).sort_values(by='Value', ascending=False)
                              Value
Date                               
2014-10-01 00:00:00+00:00  1.000000
2014-12-01 00:00:00+00:00  0.993590
2014-08-01 00:00:00+00:00  0.987179
2014-07-01 00:00:00+00:00  0.980769
2014-11-01 00:00:00+00:00  0.974359
2014-06-01 00:00:00+00:00  0.967949
2014-01-01 00:00:00+00:00  0.961538
2013-04-01 00:00:00+00:00  0.955128
2013-10-01 00:00:00+00:00  0.948718
2013-11-01 00:00:00+00:00  0.942308
2014-03-01 00:00:00+00:00  0.935897
2013-07-01 00:00:00+00:00  0.929487
2007-03-01 00:00:00+00:00  0.923077
2014-02-01 00:00:00+00:00  0.916667
2014-04-01 00:00:00+00:00  0.910256
2014-05-01 00:00:00+00:00  0.903846
2007-02-01 00:00:00+00:00  0.897436
2013-09-01 00:00:00+00:00  0.891026
2013-12-01 00:00:00+00:00  0.884615
2014-09-01 00:00:00+00:00  0.878205
2006-08-01 00:00:00+00:00  0.871795
2007-11-01 00:00:00+00:00  0.865385
2007-01-01 00:00:00+00:00  0.858974
2008-04-01 00:00:00+00:00  0.852564
2013-05-01 00:00:00+00:00  0.846154
2013-02-01 00:00:00+00:00  0.839744
2007-04-01 00:00:00+00:00  0.833333
2006-07-01 00:00:00+00:00  0.826923
2013-08-01 00:00:00+00:00  0.820513
2006-04-01 00:00:00+00:00  0.814103
...                             ...
2009-08-01 00:00:00+00:00  0.192308
2010-06-01 00:00:00+00:00  0.185897
2011-09-01 00:00:00+00:00  0.179487
2003-09-01 00:00:00+00:00  0.173077
2010-10-01 00:00:00+00:00  0.166667
2003-12-01 00:00:00+00:00  0.160256
2010-07-01 00:00:00+00:00  0.153846
2011-11-01 00:00:00+00:00  0.147436
2003-07-01 00:00:00+00:00  0.141026
2009-01-01 00:00:00+00:00  0.134615
2003-05-01 00:00:00+00:00  0.128205
2003-10-01 00:00:00+00:00  0.121795
2003-08-01 00:00:00+00:00  0.115385
2003-06-01 00:00:00+00:00  0.108974
2002-12-01 00:00:00+00:00  0.102564
2003-04-01 00:00:00+00:00  0.096154
2003-02-01 00:00:00+00:00  0.089744
2002-10-01 00:00:00+00:00  0.083333
2003-03-01 00:00:00+00:00  0.076923
2003-01-01 00:00:00+00:00  0.070513
2002-04-01 00:00:00+00:00  0.064103
2002-11-01 00:00:00+00:00  0.054487
2002-03-01 00:00:00+00:00  0.054487
2002-01-01 00:00:00+00:00  0.044872
2002-05-01 00:00:00+00:00  0.035256
2002-02-01 00:00:00+00:00  0.035256
2002-06-01 00:00:00+00:00  0.025641
2002-08-01 00:00:00+00:00  0.019231
2002-07-01 00:00:00+00:00  0.012821
2002-09-01 00:00:00+00:00  0.006410

[156 rows x 1 columns]
In [ ]:
get_pricing(symbols('VIXYAHOO'), start_date='2013-01-03', end_date='2014-01-03', symbol_reference_date=None, frequency='daily', fields=None, handle_missing='raise')
In [96]:
'''from quantopian.research import run_pipeline
from quantopian.pipeline import Pipeline, CustomFactor

s1 = pd.Series(vixx, index=Date)

class house_value_factor(CustomFactor):  
    inputs = [vixx['Value']]
    window_length = 1

    def compute(self, today, assets, out, vix):  
        out[:] = assets
  
house = house_value_factor()

pipe = Pipeline()  
pipe.add(house, 'house')  
    
run_pipeline(pipe, start_date='2015-11-01', end_date='2015-11-25')
'''
Out[96]:
"from quantopian.research import run_pipeline\nfrom quantopian.pipeline import Pipeline, CustomFactor\n\ns1 = pd.Series(vixx, index=Date)\n\nclass house_value_factor(CustomFactor):  \n    inputs = [vixx['Value']]\n    window_length = 1\n\n    def compute(self, today, assets, out, vix):  \n        out[:] = assets\n  \nhouse = house_value_factor()\n\npipe = Pipeline()  \npipe.add(house, 'house')  \n    \nrun_pipeline(pipe, start_date='2015-11-01', end_date='2015-11-25')\n"
In [135]:
vixx
Out[135]:
Symbol Price
Date
2014-01-01 00:00:00+00:00 NaN 39
2014-01-02 00:00:00+00:00 NaN 35
2014-01-03 00:00:00+00:00 NaN 51
2014-01-04 00:00:00+00:00 NaN 20
2014-01-05 00:00:00+00:00 NaN 79
2014-01-06 00:00:00+00:00 NaN 84
2014-01-07 00:00:00+00:00 NaN 18
2014-01-08 00:00:00+00:00 NaN 95
2014-01-09 00:00:00+00:00 NaN 60
2014-01-10 00:00:00+00:00 NaN 26
2014-01-11 00:00:00+00:00 NaN 27
2014-01-12 00:00:00+00:00 NaN 10
2014-01-13 00:00:00+00:00 NaN 32
2014-01-14 00:00:00+00:00 NaN 45
2014-01-15 00:00:00+00:00 NaN 88
2014-01-16 00:00:00+00:00 NaN 15
2014-01-17 00:00:00+00:00 NaN 51
2014-01-18 00:00:00+00:00 NaN 50
2014-01-19 00:00:00+00:00 NaN 38
2014-01-20 00:00:00+00:00 NaN 31
2014-01-21 00:00:00+00:00 NaN 88
2014-01-22 00:00:00+00:00 NaN 68
2014-01-23 00:00:00+00:00 NaN 52
2014-01-24 00:00:00+00:00 NaN 74
2014-01-25 00:00:00+00:00 NaN 54
2014-01-26 00:00:00+00:00 NaN 90
2014-01-27 00:00:00+00:00 NaN 86
2014-01-28 00:00:00+00:00 NaN 85
2014-01-29 00:00:00+00:00 NaN 87
2014-01-30 00:00:00+00:00 NaN 63
... ... ...
2015-10-29 00:00:00+00:00 NaN 52
2015-10-30 00:00:00+00:00 NaN 93
2015-10-31 00:00:00+00:00 NaN 32
2015-11-01 00:00:00+00:00 NaN 28
2015-11-02 00:00:00+00:00 NaN 19
2015-11-03 00:00:00+00:00 NaN 89
2015-11-04 00:00:00+00:00 NaN 31
2015-11-05 00:00:00+00:00 NaN 62
2015-11-06 00:00:00+00:00 NaN 29
2015-11-07 00:00:00+00:00 NaN 55
2015-11-08 00:00:00+00:00 NaN 74
2015-11-09 00:00:00+00:00 NaN 75
2015-11-10 00:00:00+00:00 NaN 34
2015-11-11 00:00:00+00:00 NaN 95
2015-11-12 00:00:00+00:00 NaN 57
2015-11-13 00:00:00+00:00 NaN 23
2015-11-14 00:00:00+00:00 NaN 36
2015-11-15 00:00:00+00:00 NaN 95
2015-11-16 00:00:00+00:00 NaN 51
2015-11-17 00:00:00+00:00 NaN 17
2015-11-18 00:00:00+00:00 NaN 43
2015-11-19 00:00:00+00:00 NaN 75
2015-11-20 00:00:00+00:00 NaN 14
2015-11-21 00:00:00+00:00 NaN 20
2015-11-22 00:00:00+00:00 NaN 39
2015-11-23 00:00:00+00:00 NaN 93
2015-11-24 00:00:00+00:00 NaN 94
2015-11-25 00:00:00+00:00 NaN 71
2015-11-26 00:00:00+00:00 NaN 80
2015-11-27 00:00:00+00:00 NaN 68

696 rows × 2 columns

In [141]:
symbols(hc31, symbol_reference_date='01/01/2014 00:00:00+00:00', handle_missing='log')
NoSuchSymbolsTraceback (most recent call last)
<ipython-input-141-e729ddad45fd> in <module>()
      1 
----> 2 symbols(vixx, symbol_reference_date='01/01/2014 00:00:00+00:00', handle_missing='log')

/build/src/qexec_repo/qexec/research/_api.pyc in symbols(symbols, symbol_reference_date, handle_missing)
    611     )
    612     if len(resolved_securities) == 0:
--> 613         raise NoSuchSymbols(symbols)
    614 
    615     if symbols_is_scalar:

NoSuchSymbols: Failed to find securities matching ['Symbol', 'Price']
In [ ]:
 
In [117]:
idx = pd.date_range('01-01-2002 00:00:00+00:00', '09-30-2002 00:00:00+00:00')
s = vixx.reindex(idx, method='backfill')
s.head(35)
#output to csv, and then re-upload
Out[117]:
Value
2002-01-01 00:00:00+00:00 226900.0
2002-01-02 00:00:00+00:00 226900.0
2002-01-03 00:00:00+00:00 226900.0
2002-01-04 00:00:00+00:00 226900.0
2002-01-05 00:00:00+00:00 226900.0
2002-01-06 00:00:00+00:00 226900.0
2002-01-07 00:00:00+00:00 226900.0
2002-01-08 00:00:00+00:00 226900.0
2002-01-09 00:00:00+00:00 226900.0
2002-01-10 00:00:00+00:00 226900.0
2002-01-11 00:00:00+00:00 226900.0
2002-01-12 00:00:00+00:00 226900.0
2002-01-13 00:00:00+00:00 226900.0
2002-01-14 00:00:00+00:00 226900.0
2002-01-15 00:00:00+00:00 226900.0
2002-01-16 00:00:00+00:00 226900.0
2002-01-17 00:00:00+00:00 226900.0
2002-01-18 00:00:00+00:00 226900.0
2002-01-19 00:00:00+00:00 226900.0
2002-01-20 00:00:00+00:00 226900.0
2002-01-21 00:00:00+00:00 226900.0
2002-01-22 00:00:00+00:00 226900.0
2002-01-23 00:00:00+00:00 226900.0
2002-01-24 00:00:00+00:00 226900.0
2002-01-25 00:00:00+00:00 226900.0
2002-01-26 00:00:00+00:00 226900.0
2002-01-27 00:00:00+00:00 226900.0
2002-01-28 00:00:00+00:00 226900.0
2002-01-29 00:00:00+00:00 226900.0
2002-01-30 00:00:00+00:00 226900.0
2002-01-31 00:00:00+00:00 226900.0
2002-02-01 00:00:00+00:00 226500.0
2002-02-02 00:00:00+00:00 226500.0
2002-02-03 00:00:00+00:00 226500.0
2002-02-04 00:00:00+00:00 226500.0
In [108]:
vixx
Out[108]:
Value
Date
2014-12-01 00:00:00+00:00 377800.0
2014-11-01 00:00:00+00:00 344600.0
2014-10-01 00:00:00+00:00 380800.0
2014-09-01 00:00:00+00:00 319100.0
2014-08-01 00:00:00+00:00 356200.0
2014-07-01 00:00:00+00:00 345200.0
2014-06-01 00:00:00+00:00 338100.0
2014-05-01 00:00:00+00:00 323500.0
2014-04-01 00:00:00+00:00 325100.0
2014-03-01 00:00:00+00:00 331500.0
2014-02-01 00:00:00+00:00 325900.0
2014-01-01 00:00:00+00:00 337300.0
2013-12-01 00:00:00+00:00 321200.0
2013-11-01 00:00:00+00:00 335600.0
2013-10-01 00:00:00+00:00 335700.0
2013-09-01 00:00:00+00:00 321400.0
2013-08-01 00:00:00+00:00 310800.0
2013-07-01 00:00:00+00:00 329900.0
2013-06-01 00:00:00+00:00 306100.0
2013-05-01 00:00:00+00:00 314000.0
2013-04-01 00:00:00+00:00 337000.0
2013-03-01 00:00:00+00:00 300200.0
2013-02-01 00:00:00+00:00 312500.0
2013-01-01 00:00:00+00:00 306900.0
2012-12-01 00:00:00+00:00 299200.0
2012-11-01 00:00:00+00:00 290700.0
2012-10-01 00:00:00+00:00 285400.0
2012-09-01 00:00:00+00:00 297700.0
2012-08-01 00:00:00+00:00 305500.0
2012-07-01 00:00:00+00:00 282300.0
... ...
2004-06-01 00:00:00+00:00 263200.0
2004-05-01 00:00:00+00:00 260400.0
2004-04-01 00:00:00+00:00 269300.0
2004-03-01 00:00:00+00:00 261000.0
2004-02-01 00:00:00+00:00 264100.0
2004-01-01 00:00:00+00:00 262100.0
2003-12-01 00:00:00+00:00 253900.0
2003-11-01 00:00:00+00:00 268300.0
2003-10-01 00:00:00+00:00 242800.0
2003-09-01 00:00:00+00:00 254500.0
2003-08-01 00:00:00+00:00 241000.0
2003-07-01 00:00:00+00:00 248400.0
2003-06-01 00:00:00+00:00 239700.0
2003-05-01 00:00:00+00:00 243700.0
2003-04-01 00:00:00+00:00 237200.0
2003-03-01 00:00:00+00:00 231100.0
2003-02-01 00:00:00+00:00 233400.0
2003-01-01 00:00:00+00:00 230200.0
2002-12-01 00:00:00+00:00 237800.0
2002-11-01 00:00:00+00:00 227100.0
2002-10-01 00:00:00+00:00 231300.0
2002-09-01 00:00:00+00:00 215300.0
2002-08-01 00:00:00+00:00 221300.0
2002-07-01 00:00:00+00:00 217800.0
2002-06-01 00:00:00+00:00 225200.0
2002-05-01 00:00:00+00:00 226500.0
2002-04-01 00:00:00+00:00 228100.0
2002-03-01 00:00:00+00:00 227100.0
2002-02-01 00:00:00+00:00 226500.0
2002-01-01 00:00:00+00:00 226900.0

156 rows × 1 columns

In [ ]: