title: VIX-Model in Python
body: <p>I read a paper about a model that uses signals of the Standard Deviation of the VIX Index.
  I first tested the model in Excel and now I want to transform the model in Python code. I'm not that advanced yet in Python and got stuck.
  The model is simple. Calculate the rolling 20-day standard deviation of the VIX closing prices. Signals are generated if the Standard Deviation is below 0.86 AND the prior 10 days did not generate a signal. So, calculating the 0.86 threshold is easy but how do I include the piece that no signal occurred the prior 10 days.</p>
  <pre><code>vix['std_dev'] = vix['CLOSE'].rolling(window=20).std()
  
  vix['signal'] = np.where(vix['std_dev'] &lt;= 0.86,1,0)
  </code></pre>
  <p>vix is just the data of OHLC prices for the VIX index.
  I would suggest working with <code>.shift()</code>?</p>