dv indicators manual v1 free
TRANSCRIPT
2010
Indicator Manual
DV Indicators | Copyright CSS Analytics Inc 2010 All Rights ReservedApril 2010 | Version 1.0 www.dvindicators.com
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 2
Introduction – Indicator Construction Principles page 1
DV Indicators Page 3
page page
DV Bounded (DVB) 3 DV Stochastic (DVS) 28
DV Unbounded (DVU) 5 DV Bands (DVBU/DVBL/DVBM) 29
DV Oscillator (DVO) 6 DV Band Indicator and DV Band Percentile (DVBI/DVBP) 30
DV Super-Charged Bounded (DVSC) 7 DV Zones (DVZN) 32
DV Intermediate Oscillator (DVI) 9 DV Super-Charged Percent Exposure (DVSE) 33
DV Mean-Median Divergence (DVMM) 10 DV Bounded Percent Exposure (DVBE) 34
Rolling Exponential Moving Average (REMA) 13 Daily Historical Volatility (DHV) 35
Rolling Relative Strength Index (RRSI) 14 DV Percentile Rank Volatility (DVPV) 36
DV Fractal RSI (DVFR) 15 DV Composite Volatility (DVCV) 37
DV Adaptive RSI (DVAR) 17 DV Breakout, Composite Vol Plus, Composite Vol Minus (DVBR) 38
DV Aggregate-M (DVAM) 19 DV R-Squared Autocorrelation (DVRAC) 39
DV Adaptive Agg-M (DVAA) 21 DV Differential Autocorrelation (DVDA) 40
DV Intermediate Stretch (DVIS) 22 DV Composite Fractal Efficiency (DVFE) 41
DV Intermediate Magnitude (DVIM) 23 DV Smoothed Trend (DVST) 42
Trend Stochastic (DVTS) 25 DV Self-Adaptive Slow (DVAS)/ DV Self-Adaptive Fast (DVAF) 43
DV Trend-Minus Cycle (DVTO) 26 CSS Analytics Adaptor One (CSSA1) 45
DV Super-Smoothed Double Stochastic (DVDS) 27
Example Applications Page 46
System One – DV Swing System 47
System Two – DV Combo System 49
Appendix – Amibroker Code & Installation Instructions Page 51
Contents
DV Bounded (DVB)
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 3
The DV Bounded is also known otherwise as the “DV2” and was created by David Varadi to capture the normalized relative close. The “DV2” versionof the DV Bounded represents the 2-period average of the relative close to the high-to-low range. The “bounded” portion represents thenormalization using a percentile rank function to re-scale the indicator on the basis of the historical distribution of values.
Type: Short-Term Mean Reversion
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyLong <= 0.50, Short > 0.50
Suggested Usage…
Description “The RSI Killer”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
September November December 2010 February March
SPY - Daily 12/03/2010 Close 115.46 115.46
SPY - DV Bounded (5, 252) = 0.51
0.50996
0.2
0.8
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 4
Example 1: DVB v RSI2 on SPY
Ticker: SPY
Rules: Long: DVB <= 0.50,Short: DVB > 0.50
Period: 1-Jan-00 to 14-Apr-10
MetricsCAGR: 30.40%Sharpe: 1.23Num Trades: 912Average Trade: 0.33%% Winners: 62.4%DVR: 0.70SPX Correlation: -30%
DVB 30.40% CAGR Since 2000
RSI2Ticker: SPY
Rules: Long: RSI2 <= 50,Short: RSI2 > 50
Period: 1-Jan-00 to 14-Apr-10
MetricsCAGR: 16.20%Sharpe: 0.50Num Trades: 60Average Trade: 0.20%% Winners: 66.7%DVR: 0.37SPX Correlation: -29%
16.20% CAGR Since 2000
Amibroker Codein Appendix 1
Amibroker Codein Appendix 1
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 5
DV Unbounded (DVU)
This is the unbounded variant of the DV2 that was originally introduced by Michael Stokes at MarketSci. Unlike the original DV2 - which is boundedby using a percentile rank function - the unbounded DV2 is simply a raw conversion of the average of the relative close to the high-to-low range.
Description “The RSI Killer”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
September November December 2010 February March
SPY - Daily 18/02/2010 Close 110.91 115.46
SPY - DV Unbounded (5) = 0.01
0.00000
-0.008
0.00099
0.008
Type: Short-Term Mean Reversion
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyLong <= 0.0, Short > 0.0
Suggested Usage…
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 6
DV Oscillator (DVO)
This is the “mother oscillator” framework from which the simpler DV Bounded variant was originally derived. It was conceived in its first form as aflexible blueprint for the selection of the optimal oscillator calculation. The DVO is partially adaptive and more accurate/reliable than the originalversion. As a consequence it requires more historical data, and the indicator values make smoother transitions to changing volatility. As of thecurrent writing, no other public indicator that we are aware of shows raw performance as strong as the DVO on the major indices.
Description “The Mother Oscillator”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
September November December 2010 February March
SPY - Daily 12/03/2010 Close 115.46 115.46
SPY - DV Oscillator = 0.65
0.649249
0.2
0.8
Type: Short-Term Mean Reversion
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyLong <= 0.50, Short > 0.50
Suggested Usage…
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 7
DV Super-Charged Bounded (DVSC)
This is the smoothed and slightly altered version of the DV Bounded that delivers superior performance. The nature of the calculation is very similar,but the differences make it more responsive with less whipsaws than the original.
Description “The big brother of the DV2”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
September November December 2010 February March
SPY - Daily 12/03/2010 Close 115.46 115.46
SPY - DV SuperChargedBounded (5, 252) = 0.55
0.545817
0.2
0.8
Type: Short-Term Mean Reversion
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyLong <= 0.50, Short > 0.50
Suggested Usage…
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 8
Example 2: DVU,DVB,DVO & DVSC
No. Net % Profit CAR Max. Sys % Drawdown Sharpe Ratio Avg Profit/Loss % % of Winners DVR Ratio SPX Correlation
DVU 1184% 28.17 -24.4 1.13 0.31 62.31 0.65 -0.32
DVB 1433% 30.4 -25.79 1.23 0.33 62.39 0.69 -0.3
DVO 2529% 37.42 -19.58 1.33 0.41 64.02 0.76 -0.33
DVSC 2152% 35.37 -19.76 1.29 0.4 63.89 0.82 -0.32
Baseline Strategy
DVULong: Enter DVU <= 0.0, Exit DVU > 0.0Short: Enter DVU > 0.0, Exit DVU <= 0.0
DVBLong: Enter DVB <= 0.50, Exit DVB > 0.50Short: Enter DVB > 0.50, Exit DVB <= 0.50
DVOLong: Enter DVO <= 0.50, Exit DVO > 0.50Short: Enter DVO > 0.50, Exit DVO <= 0.50
DVSCLong: Enter DVSC <= 0.50, Exit DVSC > 0.50Short: Enter DVSC > 0.50, Exit DVSC <= 0.50
NOTE: Back-test assumes 100,000 starting equitywith compounding of profits
System Metrics
Comparison of Baseline Strategies on SPY
-
500,000
1,000,000
1,500,000
2,000,000
2,500,000
3,000,000
Jan-00 Jan-01 Jan-02 Jan-03 Jan-04 Jan-05 Jan-06 Jan-07 Jan-08 Jan-09 Jan-10
Equi
ty
DVU
DVB
DVSC
DVO
Amibroker Codein Appendix 1
Amibroker Codein Appendix 1
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 9
DV Intermediate Oscillator (DVI)
This is the smoothed intermediate oscillator framework designed to complement the DVO. It was also designed to be flexible for use in adaptivesystems. The current DVI is a combination of two different indicators: 1) DVIM- DVI Magnitude which measures the distance price has travelled overmultiple intermediate time frames and 2) DVI Stretch which measures the net up or down days over multiple time frames. Both indicators arecomplementary and combine to produce a superior composite- the DVI- in most cases. The DVI line is very smooth and is designed to help identifyareas of higher or lower value rather than peaks or valleys as it stays in oversold or overbought territory for longer periods. This makes it ideal forcombination with intermediate trend systems, or for filtering DV2, DVSC or DVO trades.
Description “A Smoothed Intermediate Oscillator”
Type: Intermediate Mean Reversion
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyLong <= 0.50, Short > 0.50
Suggested Usage…
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
Sep Oct Nov Dec 2010 Feb Mar Apr
SPY - Daily 14/04/2010 Close 121.19 121.19
SPY - DV Intermediate(M+S) (5, 10, 252) = 0.68 0.677291
0.2
0.8
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 10
DV Mean-Median Divergence (DVMM)
This is the DV equivalent of the MACD, substituting the median for the average to make it more responsive to picking up acceleration in the trend. Itis one of the few indicators that are successful on noisy intraday data. It is one of the best intermediate term trend indicators we have tested, and canbe used numerous ways: 1) as a trend filter 2) as a trend indicator 3) an oscillator 4) it can be re-scaled to create a volatility measure.
Description “The DV MACD”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
December 2010 February March April
SPY - Daily 17/08/2005 Close 122.2 121.19
SPY - DV Mean-Median Divergence(26,12,9) = 0.06
0.8 0.2
1.41192
Type: Intermediate Trend
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyLong: Rising and/or >0.0,Short: Falling and/or <0.0
Suggested Usage…
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 11
Example 3: DVMM on WYNN,BIDU
Ticker: WYNN
Rules: Long: Enter DVMM > 0.0,Exit DVMM <= 0.0Short: None.
Period: 1-Jan-02 to 14-Apr-10
MetricsCAGR: 44.98%Sharpe: 1.26Num Trades: 41Average Trade: 8.66%% Winners: 56.10%DVR: 1.00SPX Correlation: 4%
WYNN 44.98% CAGR Since 2002
BIDUTicker: BIDU
Rules: Long: Enter DVMM > 0.0,Exit DVMM <= 0.0Short: None.
Period: 1-Jan-00 to 14-Apr-10
MetricsCAGR: 63.00%Sharpe: 1.25Num Trades: 27Average Trade: 11.69%% Winners: 51.85%DVR: 1.06SPX Correlation: -1%
63.00% CAGR Since 2000
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 12
Example 3: DVMM on WYNN,BIDU
WYNN Example Trades
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
WYNN 20.0
30.0
40.0
50.0
60.0
70.0
Oct Dec 2009 Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 2010 Feb
WYNN - Daily 25/10/2002 Open 13, Hi 13.15, Lo 12.85, Close 13.01 (0.0%)
63.68
-12.0
-8.0
-4.0
0.0
4.0
8.0WYNN - DV Mean-Median Divergence(26,12,9) = {EMPTY}
-1.25154 0.00000
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 13
Rolling Exponential Moving Average (REMA)
Jeff Pietsch, of Market Rewind fame, is the brain child behind this EMA alternative1. This is an exponential moving average that creates a “rollingmemory” as new price data is added to make it slightly less weighted than a standard EMA. It can be used to smooth indicators or as a replacementfor a moving average in a trend strategy. Our preferred use is to apply the REMA to a momentum or ROC series to enhance responsiveness forrelative strength applications. The DVST uses the REMA in this format and can be applied also as a trend indicator.
Description “The EMA Alternative”
Type: Trend Indicator
PlatformsExcel
Baseline StrategyLong when rising, Short when falling
Suggested Usage…
1. See http://marketrewind.blogspot.com/2009/02/solving-ema-backtest-dilemma.html
SPY - Daily April 2010
Sep 2009 Oct 2009 Nov 2009 Dec 2009 Jan 2010 Feb 2010 Mar 2010 Apr 2010
REMA 20
SMA 20
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 14
Rolling Relative Strength Index (RRSI)
The RRSI uses the REMA1 in the place of the conventional average in the RSI calculation. This makes it a more responsive price oscillator andsuperior to the RSI in many respects. All other features are identical to the RSI. Users can select their preferred time period, such as a 2-period.
Description “A More Responsive RSI”
Type: Mean Reversion
PlatformsExcel
Baseline StrategyLong <= 30, Short >= 70
Suggested Usage…
SPY - Daily April 2010
Feb 2010 Mar 2010 Apr 2010
SPY - Rolling Relative Strength Index 80
20
50
1. See http://marketrewind.blogspot.com/2009/02/solving-ema-backtest-dilemma.html
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 15
DV Fractal RSI (DVFR)
The Fractal RSI is a “Level 1” adaptive indicator that dynamically shifts weight in the RRSI between 2 and 30 days by default. This shifting is done toaccommodate changes in volatility and fracticality in the market price data. However users may select any two periods in between these bounds.The longer term bound (30 days by default) is always set to have a trend influence on the shorter-term bound. Some good parameter choices youmay wish to explore include 2/30, 2/15, 3/30,3/20, 10/30, 14/30.
Description “The Level 1 Adaptive RSI”
Type: Intermediate Mean Reversion
PlatformsExcel
Baseline StrategyLong >= 50, Short < 50
Suggested Usage…
Level 1Adaptive
SPY - Daily April 2010
Feb 2010 Mar 2010 Apr 2010
SPY - DV Fractal RSI 80
20
50
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 16
Equity Curve (Compounded)
-100%
0%
100%
200%
300%
400%
500%
2001 2002 2003 2004 2005 2006 2007 2008 2009
Equity Curve (Compounded)
0%
200%
400%
600%
800%
1,000%
2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010
Example 4: DVFR on SPY,IWM
Ticker: SPY
Rules: Long: Enter DVFR > 50,Exit DVFR < 50Short: DVFR < 50, Exit DVFR >50
Period: 18-Apr-00 to 23-Apr-10
MetricsCAGR: 26.17%Sharpe: 1.20DVR: 1.06
SPY 26.17% CAGR Since 2000
IWM 20.60% CAGR Since 2001
Ticker: IWM
Rules: Long: Enter DVFR > 50,Exit DVFR < 50Short: DVFR < 50, Exit DVFR >50
Period: 4-Jun-01 to 23-Apr-10
MetricsCAGR: 20.60%Sharpe: 0.79DVR: 0.70
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 17
DV Adaptive RSI (DVAR)
The Adaptive RSI is a “Level 2” adaptive indicator uses the same bounds as the Fractal RSI, but determines weight based on relative profitabilitywithin the bound spectrum instead of optimization. The Adaptive RSI performs well across a broad array of instruments and does a very good job ofadapting considering its limited input. It requires a lot of data to calculate and as such is only available in the Excel Plug-In.
Description “The Level 2 Adaptive RSI”
Type: Intermediate Mean Reversion
PlatformsExcel
Baseline StrategyLong: Falling or <= 50,Short: Rising or > 50
Suggested Usage…
^GSPC - Daily April 2010
Feb 2010 Mar 2010 Apr 2010
^GSPC - DV Adaptive RSI
50 Level 2Adaptive
Example 5: DVAR on ^GSPC
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 18
Ticker: ^GSPC
Rules: Long: Enter DVAR < .50,Exit DVAR > .50Short: DVAR > .50, Exit DVAR <.50
Period: 15-Jan-52 to 23-Apr-10
MetricsCAGR: 22.64%Sharpe: 1.49DVR: .87
^GSPC 22.64% CAGR Since 1952
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 19
DV Aggregate-M (DVAM)
The DV Aggregate M is a composite trend/mean-reversion indicator that is based on integrating the short-term and long-term price distributions. TheAggM assumes that prices are noisier and tend to mean-revert in the short to intermediate term, but tend to trend over longer time periods. It hasbeen shown to be effective across a wide array of markets and stocks and is one of the more general/robust DV Indicators.
Description “The Composite Trend / Mean-Reversion Indicator”
Type: Intermediate/Long Blended
PlatformsExcel
Baseline StrategyLong >= 0.50, Short < 0.50
Suggested Usage…
SPY - Daily April 2010
Feb 2010 Mar 2010 Apr 2010
SPY - DV Aggregate M 0.8
0.2
0.5
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 20
Example 6: AggM on SPY, EWZ
Ticker: SPY
Rules: Long: Enter AggM > 50,Exit AggM <= 50Short: Enter AggM <= 50, ExitAggM > 50
Period: 1-Jan-00 to 14-Apr-10MetricsCAGR: 14.43%Sharpe: 0.57Num Trades: 171Average Trade: 0.89%% Winners: 66.08%DVR: 0.47SPX Correlation: -38%
SPY 14.43% CAGR Since 2000
EWZTicker: EWZ
Rules: Long: Enter AggM > 50,Exit AggM <= 50Short: Enter AggM <= 50, ExitAggM > 50
Period: 1-Jan-01 to 14-Apr-10MetricsCAGR: 26.50%Sharpe: 0.73Num Trades: 136Average Trade: 2.11%% Winners: 67.65%DVR: 0.56SPX Correlation: -9%
26.50% CAGR Since 2001
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 21
DV Adaptive Agg-M (DVAA)
The Adaptive Aggregate M is a “Level 2” adaptive indicator like the Adaptive RSI that determines weight based on relative profitability within thebound spectrum but constrains the long-term setting to avoid changing the nature of the original indicator. It can be combined with the originalAggregate M to give more accurate signals.
Description “The Level 2 Adaptive Aggregate M”
Type: Intermediate/Long Blended
PlatformsExcel
Baseline StrategyLong >= 0.50, Short < 0.50
Suggested Usage…
Level 2Adaptive
^GSPC - Daily April 2010
Feb 2010 Mar 2010 Apr 2010
^GSPC - DV Adaptive Aggregate M
0.5
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 22
DV Intermediate Stretch (DVIS)
This is one component of the DVI that isolates the stretch in terms of net days up or down over a series of periods and is re-scaled to create anaccurate and consistent measure. The stretch is not like RSI because it does not consider the magnitude of up or down days but rather the netdifference. It also looks at the short, intermediate and long time frames with a net weighting on the intermediate. This is a very accurate and usefulindicator for identify mean-reversion areas of value rather than actual turning points. It can also be used as a trend measurement in conjunction withthe ADX (Average Directional Movement).
Description “The Stretch Isolator”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
December 2010 February March April
SPY - Daily 01/04/2010 Close 117.8 121.19
SPY - DV Intermediate Stretch(10, 252) = 0.24 0.8
0.2
0.932271
Type: Intermediate Mean Reversion
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyLong <= 0.50, Short > 0.50
Suggested Usage…
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 23
DV Intermediate Magnitude (DVIM)
This is the other component of the DVI that looks at the magnitude of up and down movements and is smoothed to reduce noise and also re-scaledto create an oscillator that appears to move in a “wave” format. The DVIM is a great complement to the DVIS because it measures the netpercentage move over a variety of look backs weighted primarily on the intermediate time-frame. Like the DVIM, it does not attempt to identifyturning points, and is instead a measure of relative value that does not change as frequently as other oscillators. The “wave” movement of theindicator is ideal for “hook” type mean-reversion strategies that buy or sell following a transition from overbought or oversold levels. It can also belengthened to create an excellent trend or relative strength indicator.
Description “The Magnitude Isolator”
Type: Intermediate Mean Reversion
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyLong <= 0.50, Short > 0.50
Suggested Usage…
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
Oct Dec 2010 Feb Mar Apr
SPY - Daily 29/03/2010 Close 117.32 121.19
SPY - DV Intermediate Magnitude (5, 252) = 0.40
0.613546
0.2
0.8
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 24
Example 7: DVIS/DVIM on SPY
Ticker: SPY
Rules: Long: Enter DVIS < 0.50,Exit DVIS >= 0.50Short: Enter DVIS >= 0.50, ExitDVIS < 0.50
Period: 1-Jan-01 to 14-Apr-10MetricsCAGR: 18.65%Sharpe: 0.78Num Trades: 245Average Trade: 0.71%% Winners: 68.57%DVR: 0.54SPX Correlation: -18%
DVIS: SPY 18.65% CAGR Since 2001
Ticker: SPY
Rules: Long: Enter DVIM< 0.50,Exit DVIM >= 0.50Short: Enter DVIM >= 0.50, ExitDVIM < 0.50
Period: 1-Jan-01 to 14-Apr-10MetricsCAGR: 13.92%Sharpe: 0.54Num Trades: 271Average Trade: 0.51%% Winners: 68.63%DVR: 0.48SPX Correlation: 8%
DVIM: SPY 13.92% CAGR Since 2001
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 25
DV Trend Stochastic (DVTS)
The Trend Stochastic is a super-smoothed 10-period stochastic that moves gradually relative to the standard indicator developed by George Lane. Itborrows from concepts used to smooth noisy data such as momentum. As a consequence it can be used as a trend indicator or a filter for mean-reversion trades. It is a number scaled between 0 and 1, where .5 is not necessarily the median point. It can be traded long anywhere above .4 to .6,and short below. Or it can be traded by observing whether the stochastic is rising or falling, and potentially a combination of both the direction ofmovement and relative position.
Description “A Super-Smoother Stochastic”
Type: Intermediate Trend
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyLong: Falling and/or >= 0.50,Short: Rising and/or < 0.50
Suggested UsageShort when it hits 0.20 from above,
and long when it hits 0.80 from below
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
A S O N D 2008 M A M J J A S O N D 2009 A M J J A S O N D 2010 A
SPY - Daily 20/01/2010 Close 113.89
121.19
SPY - DV Trend Stochastic(10) = 0.80
0.5
0.2
0.8 0.83337
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 26
DV Trend Minus Cycle (DVTO)
The Trend-Minus Cycle oscillator is a transform that nets the difference between the trend stochastic and a calculation related to the DVDS or super-smoothed double stochastic. The DVTO is useful for markets where an intermediate trend signal is hidden or obscured by a cyclic component. Thistrend may occur at medium frequencies such as the S&P500 or at extremes such as the case with Oil. If the DVTO is highly unprofitable on a givenmarket that is usually because it is mean-reverting at the intermediate level—this occurs in markets such as natural gas or gold stocks. The benefitof the DVTO is that you can use it to filter intermediate trend signals such as in the MACD or DVMM, or you can use it to combine with longer termtrend indicators to create a more accurate multiple time frame system.
Description “The De-Cycled Trend Indicator”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
May Jul Aug Sep Oct Nov Dec 2010 Feb Mar Apr
SPY - Daily 01/04/2010 Close 117.8 121.19
SPY - DV Trend Cycle Oscillator(3, 252) = 0.29
0.5 0.59761
Type: Short/Intermediate Trend
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyLong >= 0.50, Short < 0.50
Suggested Usage…
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 27
DV Super-Smoothed Double Stochastic (DVDS)
The super-smoothed double stochastic is the preferred mean-reversion variant to the conventional stochastic by George Lane. The DVDSnormalizes the 10-period stochastic position within the channel to increase peak/valley classification accuracy and is smoothed twice to make it lessprone to whipsaws. It does not use a percentile rank classification which tends to increase median accuracy versus extreme accuracy.As aconsequence is a good compliment to shorter –term oscillators like the DV2, DV Stochastic, or RSI2, or even intermediate oscillators like the DVI asit helps to increase the odds of finding a temporary bottom or top. DVDS levels below 10 and above 90 often coincide with peaks/valleys within a fewdays. With the broader trend, levels below 20 and above 80 tend to be the appropriate signal levels.
Description “A Super-Smooth Double Stochastic”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
Jul Aug Sep Oct Nov Dec 2010 Feb Mar Apr
SPY - Daily 01/04/2010 Close 117.8 121.19
SPY - DV Double Stochastic(10) = 0.41 0.891468
0.1
0.9
Type: Short Term/Intermediate MeanReversion
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyLong <= 0.20, Short >= 0.80
Suggested Usage…
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 28
DV Stochastic (DVS)
This is the short-term cousin of the DVDS and resembles a stochastic version of the dv2. Like a conventional stochastic it permits highly profitableentries from oversold/overbought levels when the indicator is rising/falling, and this is a much lower risk entry than classic rsi2 and dv2 variants. Itisn’t designed as much for binary use, although the binary version responds better to adaptation than DV2 or RSI2 variants because it is morepredictable in its oscillation. Itdoes use the percentile rank to permit a consistent number of entries.
Description “The Short-Term Stochastic”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
Sep Nov Dec 2010 Feb Mar Apr
SPY - Daily 01/04/2010 Close 117.8 121.19
SPY - DV Stochastic (2, 252) = 0.45
0.710344
0.2
0.8
Type: Sort Term/Intermediate MeanReversion
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyLong <= 0.50, Short > 0.50
Suggested Usage…
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 29
DV Bands (DVBU/DVBL/DVBM)
The DV Lower Band (DVBL) price is similar to the lower band of a standard Bollinger Band but is re-scaled to the annual lower band level frequency.The DV Middle Band (DVBM) price is similar to the middle band of a standard Bollinger Band--but is not the average price but rather the re-scaledaverage price. The DV Upper Band (DVBU) price is similar to the upper band of a standard Bollinger Band but is re-scaled to the annual upper bandlevel frequency. DV bands ‘contain’ price more effectively because they utilise the actual distribution of historical prices (unlike Bollinger Bands whichassume a normal distribution).
Description “The Rescaled Bollinger Band”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
November 2010 February March April
SPY - Daily 01/04/2010 Close 117.8 DV Bands(20,252,0.975, 0.5, 0.025) = 117.38
119.289
115.191
120.825 121.19
SPY - DV Band Indicator(20,252) = 0.70 0.9
0.5
0.992032
Type: Charting Indicator
PlatformsAmibroker, Tradestation, Excel
Suggested Usage…
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 30
DV Band Indicator and Percentile (DVBI/DVBP)
This is the DV Band Indicator for DV Bands. For the Excel Plug-In this is the percentile rank of the H,L,C version of the z-score. The DVBP returnsthe price associated with a user-defined percentile and H,L,C range. Thus if you wanted to know what the price of the S&P500 would be at the 95thpercentile based on the last 30 days of prices you would highlight the H,L,C range over the past “n” days and type in “95%.” In the case, with pricedata in a spreadsheet in descending order, you would type in as follows: =DVBP(C3:E32,95%)=$119.13
Both the DVBP and DVBI can be used as probability-based indicators, where the likelihood of exceeding the absolute extremes the next day is verylow. In our testing the upper and lower DV Bands contained up to 95% of closes out of sample—that is, the chances of exceeding the upper or lowerband or 97.5th and 2.5th percentiles were roughly equivalent to their promised probability (2.5+100-97.5=5% of values outside the range). Thismakes DV Bands a good tool for mean-reversion strategies and/or filtering for abnormal market conditions.
Description “The Rescaled Bollinger Band”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
November 2010 February March April
SPY - Daily 01/04/2010 Close 117.8 DV Bands(20,252,0.975, 0.5, 0.025) = 117.38
119.289
115.191
120.825 121.19
SPY - DV Band Indicator(20,252) = 0.70 0.9
0.5
0.992032
Type: Intermediate Mean Reversion
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyLong <= 0.10, Short > 0.90
Suggested Usage…
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 31
Example 8: DV Bands Price Containment
The following table empirically tests the DV bands ability to ‘contain’ price, as compared to the original Bollinger Bands ability to contain price. It isclear from these results that DV Bands do in fact contain significantly more of a stock’s price movement than Bollinger Bands. For example, theoriginal Bollinger Bands contain 82.4% of SPY prices (i.e. the close is within the bands), whereas DV Bands contain 89.6% of SPY prices.
Study
Ticker BarsBollinger BandContainment
DV BandsContainment Improvement
SPY 4333 82.4% 89.6% 7.2%XLB 2843 83.0% 89.8% 6.8%XLE 2843 82.7% 90.1% 7.4%XLF 2843 82.9% 90.3% 7.4%XLI 2842 81.9% 89.8% 8.0%XLK 2843 81.7% 90.1% 8.4%XLP 2843 83.1% 89.6% 6.5%XLU 2843 82.1% 90.4% 8.3%XLV 2843 82.3% 89.9% 7.6%XLY 2843 82.4% 89.7% 7.3%
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 32
DV Zones (DVZN) for Excel Plug-in Only
This is one method of identifying regimes, in this case DV Zones are constructed using DVRAC- a trend filter that uses multiple smoothed regressionslopes that are smoothed with a 30-day measurement periods, and DVPV which is the percentile rank of 30-day historical volatility. The followingtable shows the corresponding number codes and indicator values used to de-lineate the zones:
DV Zones are excellent for developing comprehensive trading systems. They are static regimes that capture a broad spectrum of market conditions.You also may wish to shift a portfolio allocation to various systems dynamically based on the current zone position. The most common use of zonesis to understand the performance of a given indicator within each zone, since they will be very different. It is instructive in some cases to considerlongs separately from shorts. For example, in up trends with low volatility, shorting using a short-term indicator like the RSI2 or DV2 might not bedesirable. The same may apply with going long in down trends with low volatility. As always taking a smaller position size is the least risky alternativeif you have a good system to avoid missing out. The zone concept can be applied using other indicators as well such as the 200 day movingaverage. DV Zones allow the user to create trading systems for each market regime, as opposed to one system for all market regimes.
Description “Define Market Regimes Empirically”
RegimeZone
NumberTrend
(DVRAC)Volatility(DVPV)
up trend low volatility 1 > 0.2 <.5
up trend high volatility 2 > 0.2 >.5
no trend low volatility 3 > -0.2, < 0.2 <.5
no trend high volatility 4 > -0.2, < 0.2 >.5
down trend low volatility 5 < - 0.2 <.5
down trend high volatility 6 < - 0.2 >.5
Type: Environmental Filter
PlatformsExcel Only
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 33
DV Super-Charged Percent Exposure (DVSE)
This is the DV Super-Charged DV2 percent exposure model that varies between 150% and -150% based on a simple algorithm. The DVSEincreases exposure on both the long and short side at extremes, and normalizes its exposure positioning to keep size proportionate.
Description “Determine exposure using the DVSC”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
November December 2010 February March April
SPY - Daily 14/04/2010 Close 121.19 121.19
SPY - DV Super Charged Pct Exposure(1,2,100,22) = 1.27 1.1
0.2
1.26666
Type: Short Term Mean ReversionPositing Sizing
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyPosition Size = Normal Position Size
* DVSE Exposure %
Suggested Usage…
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 34
DV Bounded Percent Exposure (DVSE)
This is the DV2 percent exposure model that varies between 150% and -150% based on a simple algorithm. The DVSE increases exposure on boththe long and short side at extremes, and normalizes its exposure positioning to keep size proportionate.
Description “Determine exposure using the DVB”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
November December 2010 February March April
SPY - Daily 14/04/2010 Close 121.19 121.19
SPY - DV Bounded Pct Exposure(0,2,100,22) = 1.29 1.1
0.2
1.2866
Type: Short Term Mean ReversionPositing Sizing
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyPosition Size = Normal Position Size
* DVSE Exposure %
Suggested Usage…
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 35
Daily Historical Volatility (DHV)
This is the standard historical volatility calculation with a user defined measurement period. The default setting is 30 days. The calculation is thestandard deviation of the natural logarithm of price changes over the period selected scaled to 1 year as defined by 252 trading days using thesquare root rule. It has been multiplied by 100 to make it comparable to the VIX. When the VIX is trading above this number it is bullish for themarket and vice versa based on our historical research.
Description “User Adjustable Historical Volatility”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
2007 2008 2009 2010
SPY - Daily 14/04/2010 Close 121.19
121.19
SPY - Daily Historical Volatility = 8.59
8.58655
Type: Environmental Filter
PlatformsAmibroker, Tradestation, Excel
Suggested Usage…
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 36
DV Percentile Rank Volatility (DVPV)
This is the percentile rank of DVHV with a 30 day default setting and a 252 day look back for the normalization. The DVPV is an excellent tool forsystem filtering and testing as well as position sizing and portfolio allocation. Primarily it should be considered as a key measure to watch whendeciding between mean-reversion and trend-strategies. It is also a key component of “zones” analysis (see DVZN).
Description “Normalised Historical Volatility”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
N D 2009 M A M J J A S O N D 2010 M A
SPY - Daily 14/04/2010 Close 121.19 121.19
SPY - DV Percent Rank Volatility(20, 252) = 5.98
5.9761
Type: Mean Reversion / Trend Filter
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyMean Reversion environment when > 0.50,
Trend environment when < 0.50
Suggested Usage…
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 37
DV Composite Volatility (DVCV)
This is a composite volatility measure that includes ratio volatility , longer term historical volatility, and a measure of daily variation. It can be used asmean-reversion filter on its own or combined with DVPV. A rising DVCV over the past week or 5 days and a reading above the lowest quartile or .25is more favorable for short-term mean-reversion on an absolute and risk-adjusted basis. Day-traders may also want to pay attention to the DVCV.
Description “A Composite Volatility Measure”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
J S O N D 2009 M A M J J A S O N D 2010
SPY - Daily 14/04/2010 Close 121.19
113.33
SPY - DV CompositeVolatility(5, 252) = 0.62
0.0398406
0.5
Type: Mean Reversion / Trend Filter
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyMean Reversion environment when > 0.50,
Trend environment when < 0.50
Suggested Usage…
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 38
DV Breakout, Composite Volatility Plus, CompositeVolatility Minus (DVBR/DVCP/DVCM)
All of these indicators are related- the DVCP and DVCM are the components of the DVBR which is a breakout indicator. Both the DVCP and DVCMmeasure short-term range expansions, with the DVCP (composite plus) making a positive range expansion from lower volatility and the DVCM(composite minus) making a downside or negative range expansion from lower volatility. The DVBR is a breakout indicator that is by default the 8-day exponential moving average of the difference between DVCP and DVCM. The DVBR was highly profitable in the pre-mean reversion days onthe S&P500 and recently made a resurgence during the rally. It is the anti-thesis to DV2 and many others, and tends to perform well on trendy stocksthat have high LTR ratings such as in the Livermore index. It can also be used to screen/filter DV2 trades or any other mean-reversion trades orscreen for trend entries along with DVRAC.
Description “The Anti-Thesis to the DV2”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
May Jun Jul Aug Sep Oct Nov Dec 2010 Feb Mar Apr
SPY - Daily 14/04/2010 Close 121.19 121.19
SPY - DVCV(P+M)(10, 252) = 0.06
0.00000 0.0629482
Type: Intermediate Mean Reversion
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyLong: >= 0.0, Short: < 0.0
Suggested Usage…
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 39
DV R-Squared Autocorrelation (DVRAC)
This is the premier trend filter used within the 6 different regime “Zones” that reflected different combinations of trend and volatility. The DVRACutilizes a slope-based R-squared correlation of prices that captures the Highs, Lows and Closes. Smoothing is applied to the indicator whichminimizes false signals but also has the disadvantage of producing lag. DVRAC levels above .2 show a statistically significant positive trend whichhelps to provide a minimum criteria for placing buys to avoid false entries. Levels between -.2 and .2are indicative of temporary uncertainty in thetrend condition, and this area is often called the “No-Trend” zone. Levels of the DVRAC below -.2 show a statistically significant intermediate downtrend. This must be analyzed within the context of the long-term trend to consider going short.
Description “The Premier Trend Filter”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
Aug Oct Nov Dec 2010 Feb Mar Apr
SPY - Daily 14/04/2010 Close 121.19 121.19
SPY - DV R-Squared AutoCorrelation = 0.81
0.00000
0.807997
Type: Intermediate Trend Filter
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyLong: >= 0.20, Short: < -0.20
Suggested Usage…
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 40
DV Differential Autocorrelation (DVDA)
The differential autocorrelation indicator is a filter that detects shifts in the difference in autocorrelation between closing prices and high versus lowprices. This is significant as a trend/mean-reversion filter since a strong trend will tend to have persistently higher closes but variation in highs andlows. Levels of DVDA well below .25 characterize short-term random drift in the market and indicator signals are less valuable in this area. Ingeneral, a falling DVDA over 1-5 days is a mean-reversion environmental signal. A rising DVDA signals favorable conditions for the prevailing trend.
Description “A Trend / Mean-Reversion Filter”
Type: Environmental Filter
PlatformsExcel
Suggested Usage…
SPY - Daily April 2010
Feb 2010 Mar 2010 Apr 2010
SPY - DV Differential Autocorrelation80
20
50
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 41
DV Composite Fractal Efficiency (DVFE)
This is a composite mean-reversion and trend indicator that measures fractal efficiency at two different time frames. The DVFE assumes that mean-reversion resides in the short-term and trends exist in the long term similar to the Aggregate M indicator. The signals are not highly correlated to theAgg M even though the default periods are nearly the same. This is because the DVFE is best traded at extremes of >.75 for longs and <.25 forshorts. The binary DVFE is not nearly as impressive as the Agg M, which naturally introduces the possibility of taking extreme DVFE signals andusing binary Agg M to take lower level signals.
Description “Measure Fractal Efficiency At Two Time Frames”
Type: Intermediate/Long Term Blend
PlatformsExcel
Baseline StrategyLong: >= 0.75, Short: < 0.25
Suggested Usage…
SPY - Daily April 2010
Feb 2010 Mar 2010 Apr 2010
SPY - DV Composite Fractal Efficiency
0.25
0.75
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 42
DV Smoothed Trend (DVST)
The DV Smoothed Trend is a momentum measure that is smoothed twice using REMA or the rolling exponential moving average. The use ofmomentum/velocity assures that lag is minimized, and the use of double smoothing reduces the noise component. The DVST can be used as eithera relative strength indicator, or a trend indicator.
Description “A REMA Smoothed Momentum Measure”
Created with AmiBroker - adv anced charting and technical analy sis sof tware. http://www.amibroker.com
Aug Oct Nov Dec 2010 Feb Mar Apr
SPY - Daily 14/04/2010 Close 121.19 121.19
SPY - DV Trend = 5.67
4
-4
5.66667
Type: Environmental Filter
PlatformsAmibroker, Tradestation, Excel
Baseline StrategyLong: >= 0.0, Short: < 0.0
Suggested Usage…
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 43
DV Self-Adaptive Slow, DV Self-Adaptive Fast( DVAS / DVAF )
Both DVAS and DVAF are Level 1 class self-adapters that resample the prevailing distribution of the underlying to match with indicator signals todetermine whether the best direction to trade an indicator is mean-reversion “MR” or trend “TR.” They can be applied with an indicator chosen by theuser, but are best suited to shorter-term or intermediate term indicators. The self-adapter also determines the best levels to buy and sell using agiven indicator by quickly adapting to the new distribution of returns for the underlying. The DVAS is less sensitive and tends to change more slowlywhile the DVAF rapidly adjusts to current conditions and potentially noise. There is a trade-off to using both and the best way is to use one inconjunction with the other.
Description “A Level 1 Self-Adaptive Overlay For Existing Indicators”
Type: Adaptive Buy/Sell Levels
PlatformsExcel
Suggested Usage…
Level 1Adaptive
DV Self-Adaptive Slow, DV Self-Adaptive Fast( DVAS / DVAF )
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 44
Both DVAS and DVAF are Level 1 class self-adapters that resample the prevailing distribution of the underlying to match with indicator signals todetermine whether the best direction to trade an indicator is mean-reversion “MR” or trend “TR.” They can be applied with an indicator chosen by theuser, but are best suited to shorter-term or intermediate term indicators. The self-adapter also determines the best levels to buy and sell using agiven indicator by quickly adapting to the new distribution of returns for the underlying. The DVAS is less sensitive and tends to change more slowlywhile the DVAF rapidly adjusts to current conditions and potentially noise. There is a trade-off to using both and the best way is to use one inconjunction with the other.
Description “A Level 1 Self-Adaptive Overlay For Existing Indicators”
Type: Adaptive Buy/Sell Levels
PlatformsExcel
Suggested Usage…
Level 1Adaptive
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 45
CSS Analytics Adaptor One (CSSA1)
This is the first institutional class entrant of the DV Indicators - it is a Level 1 Adaptive short-term mean-reversion indicator that looks at multiple timeframes and different measures of volatility and fracticality. It dynamically self-adjusts to account for these factors to avoid making costly errors inbuy/sell decisions. CSSA is more robust than the standard DV Indicators and works on a wider range of markets and stocks - especially entering atmore extreme levels. It is a small preview of the future which will include Level 3 and Level 4 class that will have multiple layers of adaptation andself-adjustment. CSSA is the frame of a new class of indicators that will represent compact artificial intelligence machines.
Description “The First Institutional Class Adaptive DV Indicator”
Type: Adaptive Buy/Sell Levels
PlatformsExcel
Baseline StrategyLong: >= 0.50, Short: < 0.50
Suggested Usage…
Level 1Adaptive
SPY - Daily April 2010
Feb 2010 Mar 2010 Apr 2010
SPY - CSS Analytics Adaptor One
0.5
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 46
Example Applications
System A
System B
DV SPY Swing System
DV Combo System
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 47
System A: DV SPY Swing System
Zone 1
Rising SMA200and
DVDS10 < 20
DVDS10 > 80
Zone 2
Falling SMA200and DVDS10 < 20
and DVO <= 20
DVO > 50
Zone 1
none
none
Zone 2
Falling SMA200and
DVDS10 < 20
DVDS10 > 80
The DV SPY Swing System combines [......... Rules Provided with subscription ................]
Description
Exit
Exit
Entry
Entry
Long
Short
[......... Rules Providedwith subscription
................]
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 48
DV SPY Swing System (Continued)
// ========================================================================================
// DV Indicators by David Varadi http://cssanalytics.wordpress.com/
// Copyright 2009-2010 David Varadi/ CSS Analytics, All Rights Reserved
// For Personal Use by Registered Users Only; NOT for Redistribution; No Implied Warranties
// ========================================================================================
SetFormulaName("System A - DV SPY Swing System");
SetBarsRequired(10000,10000);
SetOption("CommissionMode", 3); SetOption("CommissionAmount", 0.00); SetOption("InitialEquity", 100000);
SetOption("MaxOpenPositions", 1); SetOption("PriceBoundChecking", 1); SetOption("AllowPositionShrinking",True); SetTradeDelays( 0, 0, 0, 0);
PositionScore = 1/C; PositionSize = -100; BuyPrice = SellPrice = ShortPrice = CoverPrice = Close;
UpTrend = MA(C,200) > Ref(MA(C,200),-1); DownTrend = MA(C,200) <= Ref(MA(C,200),-1);
DVDS_10Period = DVDS(H,L,C,10); DVO_indicator = DVO(H,L,C);
// Long Signals
Entry1 = UpTrend AND (DVDS_10Period < 0.20);
Entry2 = DownTrend AND (DVDS_10Period < 0.10) AND (DVO_indicator <= 0.20);
Buy = Entry1 OR Entry2;
Exit1 = UpTrend AND (DVDS_10Period > 0.80);
Exit2 = DownTrend AND (DVO_indicator > 0.50);
Sell = Exit1 OR Exit2;
// Short Signals
Short = DownTrend AND (DVO_indicator > 0.50);
Cover = DVO_indicator < 0.50;
Amibroker Code
NOTE: Results differ marginally between Amibroker and Excel because of different trade management techniques
[......... Code Provided with subscription ................]
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 49
System B: DV Combo System
> 0, add 1
Combo Score > 0
Combo Score <= 0
Combo Score <= 0
Combo Score > 0
The DV Combo system combines short-term mean reversion, using the DVSC2, with a longer term composite trend and mean-reversion indicator,namely the AggZ. The benefit of this approach is that the system will stay long until both time-frames dictate that the position should be flipped – thisreduces the number of trades thereby avoiding chop and the associated trading costs. This system is intended for the S&P500 spider, the “SPY”.For those not familiar with the AggZ, the calculation is dead simple:
AggZ= (-1x( 10-day z-score)+(200-day z-score))/2,where z-score = (close-sma (closing prices over last n periods))/(standard deviation( closing prices over last n periods))
Description
DVSC2
Exit
Entry
AggZ
Combo Score Calc
< 0, minus 1
< 50, add 1
> 50, minus 1
Long Short
System Rules
ComboScore
[......... Rules Provided withsubscription ................]
[......... Rules Provided with subscription ................]
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 50
DV Combo System (Continued)
// ========================================================================================
// DV Indicators by David Varadi http://cssanalytics.wordpress.com/
// Copyright 2009-2010 David Varadi/ CSS Analytics, All Rights Reserved
// For Personal Use by Registered Users Only; NOT for Redistribution; No Implied Warranties
// ========================================================================================
SetFormulaName("System B - DV Combo System"); SetBarsRequired(10000,10000);
SetOption("CommissionMode", 3); SetOption("CommissionAmount", 0.00); SetOption("InitialEquity", 100000);
SetOption("MaxOpenPositions", 1); SetOption("PriceBoundChecking", 1); SetOption("UsePrevBarEquityForPosSizing", True);
SetOption("AllowPositionShrinking",True); SetTradeDelays( 0, 0, 0, 0);
PositionScore = 1/C; PositionSize = -100; BuyPrice = SellPrice = ShortPrice = CoverPrice = Close;
function zscore(price,Length)
{ av = MA(price,Length);
st = StDev(price,Length);
zs = (price - av) / st;
return zs; }
AggZ = (-zscore(C,10) + zscore(C,200) )/2;
myDVSC = DVSC(H,L,C, 2, 252);
ComboScore = IIf(AggZ>0,1,-1) + IIf(myDVSC<0.50,1,-1);
// Long System
Buy = ComboScore > 0; Sell = ComboScore <= 0;
// Short System
Short = ComboScore < 0; Cover = ComboScore >= 0;
Amibroker Code
NOTE: Results differ marginally between Amibroker and Excel because of different trade management techniques
[......... Code Provided with subscription ................]
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 51
Appendices
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 52
Appendix 1: Amibroker Code
// ========================================================================================
// DV Indicators by David Varadi http://cssanalytics.wordpress.com/
// Copyright 2009-2010 David Varadi/ CSS Analytics, All Rights Reserved
// For Personal Use by Registered Users Only; NOT for Redistribution; No Implied Warranties
// ========================================================================================
SetFormulaName("Example 1 - DV2 v RSI2"); SetBarsRequired(10000,10000);
SetOption("CommissionMode", 3); SetOption("CommissionAmount", 0.00); SetOption("InitialEquity", 100000);
SetOption("MaxOpenPositions", 1); SetOption("PriceBoundChecking", 1); SetOption("AllowPositionShrinking",True); SetTradeDelays( 0, 0, 0, 0);
PositionScore = 1/C; PositionSize = -100; BuyPrice = SellPrice = ShortPrice = CoverPrice = Close;
Value1 = Param("SystemToRun",1,1,2,1);
if(Value1 == 1)
{ // RSI2 SYSTEM
Buy = RSI(2) <= 50;
Sell = RSI(2) > 50;
Short = RSI(2) > 50;
Cover = RSI(2) <= 50; }
else
{ // DVB SYSTEM
myDVB = DVB(H,L,C,2,252);
Buy = myDVB <= 0.50;
Sell = myDVB > 0.50;
Short = myDVB > 0.50;
Cover = myDVB <= 0.50; }
Example 1: DV2 v RSI2
[......... Code Provided with subscription ................]
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 53
Appendix 1: Ami Code
// ========================================================================================
// DV Indicators by David Varadi http://cssanalytics.wordpress.com/ Copyright 2009-2010 David Varadi/ CSS Analytics, All Rights Reserved
// For Personal Use by Registered Users Only; NOT for Redistribution; No Implied Warranties
// ========================================================================================
SetFormulaName("Example 2 – DVU,DVB,DVO,DVSC"); SetBarsRequired(10000,10000);
SetOption("CommissionMode", 3); SetOption("CommissionAmount", 0.00); SetOption("InitialEquity", 100000);
SetOption("MaxOpenPositions", 1); SetOption("PriceBoundChecking", 1); SetOption("AllowPositionShrinking",True); SetTradeDelays( 0, 0, 0, 0);
PositionScore = 1/C; PositionSize = -100; BuyPrice = SellPrice = ShortPrice = CoverPrice = Close;
Value1 = Optimize("SystemToRun",1,1,4,1);
if(Value1 == 1)
{ // DVU SYSTEM
myDVU = DVU(H,L,C,2); Buy = myDVU <= 0; Sell = myDVU > 0; Short = myDVU > 0; Cover = myDVU <= 0;
}
else if (Value1 == 2)
{ // DVB SYSTEM
myDVB = DVB(H,L,C,2,252); Buy = myDVB <= 0.50; Sell = myDVB > 0.50; Short = myDVB > 0.50; Cover = myDVB <= 0.50;
}
else if (Value1 == 3)
{ // DVO SYSTEM
myDVO = DVO(H,L,C); Buy = myDVO <= 0.50; Sell = myDVO > 0.50; Short = myDVO > 0.50; Cover = myDVO <= 0.50;
}
else if (Value1 == 4)
{ // DVSC SYSTEM
myDVSC = DVSC(H,L,C, 2, 252); Buy = myDVSC <= 0.50; Sell = myDVSC > 0.50; Short = myDVSC > 0.50; Cover = myDVSC <= 0.50;
}
Example 2: DVU,DVB,DVO & DVSC
[......... Code Provided with subscription ................]
27 April 2010 DV Indicators | Copyright CSS Analytics Inc 2010 All Rights Reserved 54
Appendix 2: Amibroker Installation
The Amibroker Plug-in package is easily installed.
1) Firstly close Amibroker, then simply double click on the provided installation file “DVPlugins.msi” and follow the installation prompts2) When the installation is complete, start up Amibroker, where you will be presented with the dialogue box below. This will only appear once,
and should not be cause for concern.
3) Within Amibroker, the AFL files for all the DV Indicators can be found under the Charts pane > Custom Folder > DV Indicators Folder
Description