Daily returns Going selectively long on VIX

Course Name: Volatility Trading Strategies for Beginners, Section No: 16, Unit No: 14, Unit type: Notebook

Hi,

For this notebook is it suppossed that the signal for entry in trades is 5-SMA (Close) > Upperband (60-SMA, 1.5stdev) but in the code were we generate the signals with numpy we find the following:

prices["signals"] = np.where(prices["VIXY_ma5"] >= prices["VIXY_stdev"], 1, 0)

Hi Daniel,



In the code prices["VIXY_ma5"] is the 5-SMA, and prices["VIXY_stdev"] is the upperband of the Bollinger band with 60-SMA and 1.5 standard deviation. prices["VIXY_stdev"] is calculated as follows:

prices['VIXY_stdev'] = ta.BBANDS(prices['VIXY'], timeperiod=60, nbdevup=1.5)[0]

Here [0] in the end is for the upper band values.



Hope this helps!