# VXX Directional Trading Strategy Part 2: Signals based on Oscillators

Previously, at VXX Directional Trading Strategy Part 1, I  posted research on a VXX Directional Trading System based on constant values. This post will be about a trading system on VXX using 3 oscillators William’s %R, RSI, and Stochastic.

My commissions are set at 7\$ per trade with a capital base of 10,000\$. All signals are based on the opening price of the day after the signal was generated. The software used is AmiBroker. The objective function used in optimization and walk-forward analysis is RAR/MDD. The data is from 1/30/2009 – 7/30/2012. The RAR/MDD of short & hold (the benchmark we are trying to beat) is 1.17. This is chart of VXX, William’s % R(First), RSI (Second), and Stochastic %D (Third). All of these 3 indicators have been visually optimized (meaning that I adjusted the parameters to what seems to me the best fit). My system will generally be:

• Short VXX if Oscillator < Constant Value
• Long VXX if Oscillator > Same Constant Value

William’s % R:

• Short VXX if William’s % R < Constant Value
• Long VXX if William’s % R > Same Constant Value
```// William's %R VXX System
function PercentR( periods )
{
return -100 * ( HHV( H, periods ) - C )/( HHV( H, periods ) - LLV( L, periods ) );
}

BuyPrice = SellPrice = CoverPrice = ShortPrice = O;
WilliamLength = Optimize("WLength",80,1,100,1);
William = PercentR(WilliamLength);
Constant = Optimize("Constant",-70,-100,0,1);
Sell = Short = Cross(Constant,William);``` This is an optimization of William’s %R Period vs the Constant Value. There are two stable regions: when William’s %R Period is approximately 55-90 and Constant is approximately 60-75, and also when William’s %R Period is approximately 20-40 and Constant is approximately 20-40. The water line represents the RAR/MDD of Short & Hold

Here is a detailed backtest report for when William’s %R Period is 80 and the Constant 70. I chose these two values because they seem to be in the middle of the stable region.

Even though there are only 21 total trades in the 70-80 system, because of the hilly region near the beginning, it warrants further exploration of this system.

Here is a detailed backtest report for when William’s %R Period is 30 and the Constant 30. I chose these two values because they seem to be in the middle of the second (and more profitable) stable region.

The results of this system are much more impressive than the previous system. The CAR & the RAR/MDD are higher. Also, this system has almost double the amount of trades (41 vs 21) meaning that these results are also more statistically significant, definitely warranting further exploration.

RSI:

• Short VXX if RSI < Constant Value
• Long VXX if RSI > Same Constant Value
```// RSI VXX
BuyPrice = SellPrice = CoverPrice = ShortPrice = O;
// Optimization
RSILength = Optimize("RSILength",20,1,100,1);
Constant = Optimize("Constant",55,1,100,1);
Indicator = RSI(RSILength);
// Entry/Exit Signals
Short = Sell = Cross(Constant,Indicator);``` This is an optimization of RSI Period vs the Constant Value. There is a stable hilly region approximately when RSI Length is 10-30 and Constant is 45-60. There are also random spikes that will be disregarded. The water line represents the RAR/MDD of Short & Hold

Here is a detailed backtest report for when RSI Length is 20 and the Constant is 55. I chose these two values because they seem to be in the middle of the stable region. In this system the long only system has a RAR/MDD of 2.78, short only has a RAR/MDD of 1.85, and long & short has a RAR/MDD of 1.74.                                 Long > Short > Long & Short Even though there are only 33 total trades in the RSI system, because of the hilly region near the beginning, it warrants further exploration of this system.

Stochastic

• Short VXX if Stochastic < Constant Value
• Long VXX if Stochastic > Constant Value

I am going to choose 3 and 3 for the D and K lengths so that there are only 2 variables left for optimization. I want D and K both to be low to produce a decent amount of trades so that the results of the backtest are statistically significant, and I chose these particular values because these values are the most commonly used. Optimization of Stochastic Length vs Constant buy/sell value. The water line represents the RAR/MDD of Short & Hold. There seems to be 2 stable/hilly regions.

The 2 regions are approximately:

• Constant of 30-45, Stochastic Length of 55-90
• Constant of 55-70, Stochastic Length of 15-30

Here is a detailed backtest report for when Stochastic Length is 75 and the Constant is 38. I chose these two values because they seem to be in the middle of the stable region. Here is a detailed backtest report for when Stochastic Length is 18 and the Constant is 62. I chose these two values because they seem to be in the middle of the stable region.

In conclusion, it seems that all 3 oscillator systems are more profitable (by means of RAR/MDD and CAR) than short & hold. The best performing system seems to be the William’s %R.