Here's how to use the level of VIX, or any symbol's price, to drive trading in a backtest by using Entry and Exit Triggers.

Let’s say you only want to enter a VIX trade with the VIX price below 15 and you would exit if it gets over 20 and wait until under 15 to re-enter. In our backtester the header pxAtmIV is the price of the stock taken when the options snapshot is taken. Set the Entry Trigger to 'Max = 15' and set the Exit Trigger to 'Max = 20'. That will drive the backtest to only enter trades when the VIX is < 15 and exit if VIX is > 20.

Here's what the backtest input form looks like for the Entry Trigger:

null
 

Here's what the backtest input form looks like for the Exit Trigger:

null
 

Click Submit and check the results. The trades should only enter when the VIX is < 15 and should exit when the VIX is > 20.

null
 

Note that the pxAtmIV is the spot VIX and the EntryStockPx & ExitStockPx in the trades section is the VIX future for the expiration solved at the time of the trade. So the EntryStockPx may be above 15 and the ExitStockPx may be below 20 when trades occur but the spot won't be.

For example, look at thetrade on 3/13/12: the EntryStockPx was 21.03 but why was the trade entered? Because the SpotPrice was 14.8 and the 21.03 was the associated futures price with the 4/18/12 expiration of the call.

null
 

More reading:

Backtests Basics: How to Use Technical Indicators

Backtest Your Own Signals

 

 

related posts

Python Access to Our API
May
29
Data, data api, Python, code example

Python Access to Our API

Python is a popular programming language that lets you work quickly and integrate systems...

Read Post
Futures Prices Implied from Options Prices for Indexes
May
25
Data, Index Options, Futures Prices, Options Pricing

Futures Prices Implied from Options Prices for Indexes

Indexes price options off of futures prices for each expiration. Here's how ORATS does handles...

Read Post

We're here, if you need us.

Still curious how we can help you?




LET'S CHAT