Backtests
...
Running a Backtest
Positions

Entry Filters

Entry filters can be used to control when your backtest sits on the sidelines, with no open trade, and waits for the right market conditions to enter a new trade.

These entry filters are only used at trade entry. Once a trade is entered, it will only exit based on the position's exit conditions. It will not exit if your entry filters (defined below) are no longer met.

VIX

This comes with optional min and max VIX values. If specified, your backtest position will only open new trades if the current VIX value meets your min and/or max.

IV

This includes optional min and max implied volatility (IV) values for your position's underlying. This IV is measured at-the-money rather than at your specific strike.

Implied volatility changes based on duration. Implied volatility for a strike 1 day to expiration is different from a strike 45 days to expiration, for instance. Our quotes include IV 0, 1, 2, 3, 4, 5, 10, 20, 30, and 45 days to expiration for each underlying. When using IV filters, the backtester will use the IV value that is closest to your position's target days to expiration.

IVR

This includes optional min and max implied volatility rank (IVR) values for your position's underlying. IVR represents the current IV relative to IV over the prior year. It is measured from 0-100% wherein 0 represents the lowest IV recorded over the last year and 100% represents the highest IV recorded over the last year. IVR at 60 would indicate that approximately 60% of the prior year's IV readings were below the current level and 40% over IV readings were above.

We calculate IVR as follows:

Document image


Implied volatility changes based on duration. Implied volatility for a strike 1 day to expiration is different from a strike 45 days to expiration, for instance. Our quotes include IV 0, 1, 2, 3, 4, 5, 10, 20, 30, and 45 days to expiration for each underlying. When using IV filters, the backtester will use the IV value that is closest to your position's target days to expiration.

% Move from Close

This filter will only allow entries after the underlying has moved a certain percent from the prior closing price. You can specify min and/or max % move from close. This is evaluated at the time of trade entry.

In the example brelow, the backtest will only enter a trade once the underlying is 1% below the prior closing price.

Document image


% Move from Open

This filter will only allow backtest trades after the underlying has moved a certain percent from the opening price. You can specify min and/or max % move from open. This is evaluated at the time of trade entry.

In the example brelow, the backtest will only enter a trade once the underlying is 0.7% above the opening price.

Document image


MA Crossover

If you'd like to only enter a new position when two moving averages cross each other, you can do that here.

Document image


The above example will allow entry when the 5-minute EMA is 0.1% above the 40-minute EMA. For MA Crossover, you have a number of available Exponential Moving Averages (EMA) and Simple Moving Averages (SMA).

Simple Moving Averages (SMA)

SMAs all use days for the period. 200-day SMA represents the average closing price over the last 200 days. For the current day that the backtest is trading, the backtester will include the intraday underlying price for that day's price. If you are using the 200-day SMA, the average will come from the current intraday underlying price and the 199 daily closing prices before that.

SMAs use unadjusted prices, which can lead to false signals following stock splits.

Exponential Moving Averages (EMA)

EMAs all use minutes for the period. 50-minute EMA represents the average OHLC4 price over the last 50 minutes. OHLC4 is (open + high + low + close) / 4. The backtest will enter a new position on the bar with OHLC4 that meets your criteria.

EMAs reset daily and do not include prices from the prior session. This means that your EMA is not complete until the number of minutes in the EMA length have occurred for the current session. If using a 50-minute EMA while only 5 minutes into the session, the EMA at that point in time will only reflect the average for the first 5 minutes, not 50 minutes. You may wish to restrict backtest entry until a time of day when your EMA calculations are complete for your selected length.

MA Value

To limit entry until the underlying price is above or below a moving average, you can select the MA Value entry filter.

Document image


The example above will only allow entry when the underlying price is at least 0.2% below the 50-day SMA. You have a number of available Exponential Moving Averages (EMA) and Simple Moving Averages (SMA) to choose from.

Simple Moving Averages (SMA)

SMAs all use days for the period. 200-day SMA represents the average closing price over the last 200 days. For the current day that the backtest is trading, the backtester will include the intraday underlying price for that day's price. If you are using the 200-day SMA, the average will come from the current intraday underlying price and the 199 daily closing prices before that.

SMAs use unadjusted prices, which can lead to false signals following stock splits.

Exponential Moving Averages (EMA)

EMAs all use minutes for the period. 50-minute EMA represents the average OHLC4 price over the last 50 minutes. OHLC4 is (open + high + low + close) / 4. The backtest will enter a new position on the bar with OHLC4 that meets your criteria.

EMAs reset daily and do not include prices from the prior session. This means that your EMA is not complete until the number of minutes in the EMA length have occurred for the current session. If using a 50-minute EMA while only 5 minutes into the session, the EMA at that point in time will only reflect the average for the first 5 minutes, not 50 minutes. You may wish to restrict backtest entry until a time of day when your EMA calculations are complete for your selected length.

Economic Events

If you would like to avoid or specifically target scheduled economic releases such as FOMC, GDP, NFP (jobs), CPI, or Earnings, you may control that under the Economic Events section for the backtest position. Right now, the only supported events are CPI, FOMC, GDP, and NFP, but we will expand to more events in the future.

Example: Avoid FOMC

In the example below, the backtest will exit any open trades 1 day before FOMC and then wait to re-enter 1 day after FOMC. If FOMC is on a Wednesday, the backtest will close trades Tuesday at market close and then open new trades Thursday at market open (if your other position entry conditions are met).

Document image


Example: Trade FOMC

In the example below, the backtest will only enter new trades on the day of FOMC. For FOMC meetings that are on a Wednesday, the backtest will only enter trades the morning of FOMC (if all other entry conditions are met). It will then hold that trade until 2 days later, exiting by market close on Friday.

Document image


If you'd like to avoid or trade multiple events, go ahead and toggle as many as you'd like!

TIP: Run small backtests before large ones

Some of the entry filters, particularly Economic Events, can be a little confusing to figure out how they work. You may put in a filter and then find that it doesn't do what you anticipated. To avoid wasting your time and money on this, we recommend restricting your backtest start and end date to a tight range while you are trying to figure out the right settings for the backtest. Review the backtest trade log, ensure it is doing what you expect, and then expand the backtest date range to a wide range.

This way you don't waste money running large backtests only to discover that it doesn't trade as you expected!