Sharing investing and trading ideas. Helping traders get started.
Advertisement

Sunday, April 29, 2012

Adaptive Price Zone APZ - Backtest Results and Implementation Issues

Adaptive Price Zone APZ - Backtest Results and Implementation Issues 

Discusses basic issues and results when attempting to back-test the APZ indicator

Data: S&P500 Emini Futures
Futures Contract Rollover: Arbitrarily set on second Friday of every Mar, Jun, Sep and Dec
Period: 28 Dec 2008 - 31 Mar 2012 (Hourly Chart)
VBA Code: Method B of Code
Excel Version: 2010

Click here for background information, formula, calculation steps and the entire VBA code.

There are multiple variations on how to apply an indicator. I seek your understanding that the work done below are experiments and are for information purposes only.

Summary of Results 
Conventional application of the APZ (i.e. long at the lower boundary and short at the upper boundary in anticipation of price reversal) is found to be not profitable. However, the reverse is somewhat profitable (long when price exceeds upper boundary of APZ and vice versa), suggesting that this technical indicator and the applied trading rules have potential for real-life implementation with further tweaking to the application method (e.g. chart indicator based on hourly data, but trades are generated as and when the trading rules are met subsequently). 

Procedure in Brief
Pasted the code into Excel with changes made as per comments in code to direct application to ranges with input data (High, Low, Close columns). Screen Shot 1 shows the output (the last seven columns). The first value of some columns are error values as their formulas include reference to cells on the first row which are actually text headings, not numbers. However, calculations in subsequent rows are unaffected. 

Screen Shot 1

Detailed Findings and Results
Inputs - Band factor is set at 2, EMA period is set at 5

Summary of Trading Rules -

1) If Close at this hour is higher than the APZ upper limit at the end of the last hour, enter long at the end of this hour
1) If Close at this hour is lower than the APZ lower limit at the end of the last hour, enter long at the end of this hour


223.25 index points of profit (before transaction costs) were generated out of this strategy on 344 trades. Average return per trade is 0.65 points on a standard deviation of 21.34 points. Therefore, this strategy does not look statistically profitable. The success rate of this strategy is 39%, i.e. only 135 trades were profitable. The profit trajectory of this indicator and strategy is shown in Chart 1. 

Chart 1: Cumulative Profit of APZ and Applied Trading Rules

Conclusion
Contemporary price behavior for the S&P500 suggests that the APZ is more suited for use as a "trend" type indicator, rather than a "price reversion" indicator as I have always thought. The key risk is that we cannot be certain that the behaviour of the APZ indicator versus the S&P500 will remain constant in the future. Under certain regimes, the APZ may behave as a price reversion indicator which would require the inversion of the above trading rules.

Further research can be in the application of this model in finer time granularity.

Any suggestions or comments are welcome.


Like what you have just read? Digg it or Tip'd it.
The objective of Finance4Traders is to help traders get started by bringing them unbiased research and ideas. Since late 2005, I have been developing trading strategies on a personal basis. Not all of these models are suitable for me, but other investors or traders might find them useful. After all, people have different investment/trading goals and habits. Thus, Finance4Traders becomes a convenient platform to disseminate my work...(Read more about Finance4Traders)

Saturday, April 28, 2012

Accumulation/Distribution Line ADL - Backtest Results and Implementation Issues

Accumulation/Distribution Line (ADL) - Backtest Results and Implementation Issues
Discusses basic issues and results when attempting to back-test the ADL line indicator

Data: S&P500 Emini Futures
Futures Contract Rollover: Arbitrarily set on second Friday of every Mar, Jun, Sep and Dec
Period: 28 Dec 2008 - 31 Mar 2012 (Hourly Chart)
VBA Code: Method B of Code
Excel Version: 2010

Click here for background information, formula, calculation steps and the entire VBA code.

There are multiple variations on how to apply an indicator. I seek your understanding that the work done below are experiments and are for information purposes only.

Summary of Results 
A naive strategy produced profitable results without accounting for transactions costs. Further research is necessary to create expected returns that remain positive after trading costs.

Procedure in Brief
Pasted the code into Excel with changes made as per comments in code to direct application to ranges with input data (High, Low, Close columns). Screen Shot 1 shows the output (the last three columns)

Screen Shot 1

Detailed Findings and Results
1) Conventional implementations of the ADL line suggests that divergence between ADL and prices are meaningful. However, it is difficult to judge divergence based on indicator and price levels alone. 

In my sample period, the ADL line, like price data, is non-stationary. Simply put, the ADL does not fluctuate around a constant mean. Otherwise, I simply did not use enough data to demonstrate the stationarity of the ADL line. Therefore, the ADL line in its raw form may not be easy to interpret. 

Chart 1: ADL line versus S&P 500

2) I tried rescaling the data using the formula -

Adjusted Close = (Close - Low of entire period) / (High of entire period - Low of entire period)
Adjusted ADL = (ADL - ADL Low of entire period) / (ADL High of entire period - ADL Low of entire period)
Chart 2 shows how the rescaled data looks like

Chart 2

Again, there is no meaningful interpretation at first glance. Furthermore, in real life implementation, there is no way of knowing the low and high of the entire period, including past, current and future moments in time.

3) Finally, I resorted to measuring the change in

I used the following simple trading rule

A) Calculate the percentage change in price at the end of each hour
B) Calculate the percentage change in ADL at the end of each hour
C) Calculate Percentage Change in ADL - Percentage Change in Price
D) If Percentage Change in ADL is higher than Percentage Change in Price, Long (in the next hour)
E) If Percentage Change in ADL is lower than Percentage Change in Price, Short (in the next hour)
F) If Percentage Change in ADL is equal to Percentage Change in Price, Maintain Position (in the next hour)

Conclusion
Unadjusted for slippage and transaction costs, my simple trading rule above generated 9,838 trades over a three year plus period and 601 index points per contract of profit. Chart 3 shows the cumulative profit of this strategy (without transaction costs).

Chart 3: Cumulative Gross Profit

However, the sure number of trades suggest that transaction costs will be high. As such, practical implementation will be a challenge. The breakeven level requires each trade to have a transaction cost of at most 0.061 index points (601 divided by 9838).

Further research can be in the modification of trading rules, such as enter into a long or short position only if the positive or negative divergences are sufficiently large.

Any suggestion or comments are welcome.



Like what you have just read? Digg it or Tip'd it.
The objective of Finance4Traders is to help traders get started by bringing them unbiased research and ideas. Since late 2005, I have been developing trading strategies on a personal basis. Not all of these models are suitable for me, but other investors or traders might find them useful. After all, people have different investment/trading goals and habits. Thus, Finance4Traders becomes a convenient platform to disseminate my work...(Read more about Finance4Traders)