TradersEdgeSystems.com

Consulting | Custom Trading Systems
Built-In Indicators | Custom Indicators

September 2009 Stocks and Commodities Traders Tips


The Pivot Detector Oscillator, Simplified

Original article by Giorgos E. Siligardos
AIQ Code by Richard Denning
Traders Studio Code by Richard Denning

AIQ Version:

The AIQ code for the Pivot Detector Oscillator Indicator (PID) from the article, “The Pivot Detector Oscillator, Simplified” by Giorgos E. Siligardos, is shown below. The coded version that I have supplied also includes two systems that can be used to test the indicator. The first system only uses the indicator and is always in the market. The second system only takes trades in the direction of the trend of the SPX as well as the stock being traded. The trend is determined by the same moving average that is used in the indicator to adjust the buy and sell levels. In other words, when the close is above the moving average, the trend is up and when below, the trend is down. In the second system I also added a maximum holding period of 80 bars.

To test the indicator, I used the Russell 1000 list of stocks over the period 12/31/1996 to 7/10/2009. In Figure 1, I show the equity curve and metrics of the long side of using the indicator for entering and exiting trades. Based on the very large draw down of over 70% that occurred in 2008, it is clear that the indicator should not be used without additional filters and stops. In Figure 2, I show test results after adding trend directional filters for both the SPX to act as a market timing filter and also trend filters for the stock being traded. Both the returns and the draw downs improved dramatically with these additions as now the average return has increased to 25% from 9.7% and the draw down has decreased from 70% to less than 38%.

Captions:

Figure 1: Equity curve (blue line) for PID system without market timing trading the Russell 1000 stocks, long only, for the period 12/31/1996 to 7/10/2009, compared to the S&P 500 (SPX) index (red line).

Figure 2: Equity curve (blue line) for the PID system with market timing, trading the Russell 1000 stocks, long only, for the period 12/31/1996 to 7/10/2009, compared to the S&P 500 (SPX) index (red line).

EDS Code for the Pivot Detector Oscillator:
(RIGHT-CLICK AND CHOOSE "SAVE FILE AS" OR "SAVE LINK AS")
Pivot Osc.EDS



Traders Studio Version :

The TradersStudio code for the Pivot Detector Oscillator Indicator (PID) and the related functions from the article, “The Pivot Detector Oscillator, Simplified” by Giorgos E. Siligardos, is shown below. The coded version that I have supplied also includes two systems that can be used to test the indicator. The first system only uses the indicator and is always in the market. The second system only takes trades in the direction of the trend of the market being traded. The trend is determined by the same moving average that is used in the indicator to adjust the buy and sell levels. In other words, when the close is above the moving average, the trend is up and when below, the trend is down. In the second system I also added a maximum holding period of 95 bars.

To test the indicator, I created a portfolio of 38 of the more actively traded, full sized, futures contracts. I used Pinnacle back-adjusted data (day session only) for the following symbols: AD, BO, BP, C, CC, CD, CL, CT, DJ, DX, ED, FA, FC, FX, GC, HG, HO, HU, JO, JY, KC, KW, LC, LH, NG, NK, PB, RB, S, SB, SF, SI, SM, SP, TA, TD, UA, W. I ran the portfolio from July 1998 to July 2009 with the author’s parameters using system that is always in the market. I also ran the trend filtered system on the same portfolio and the same time period. Of the 38 markets, 66% were profitable on both of the systems. In Figure 1, I show the equity and underwater curves for this portfolio for both systems. Although the always in system is robust, the drawdown is excessive. The trend filtered system is somewhat better on both the total return and drawdown. Looking at the individual markets, the SP contract has one of the best reward to risk ratios. In Figure 2, I show the equity curve for the SP contract on the trend filtered system together with the yearly return breakdown trading one contract. The total profit is $262,125 with a maximum drawdown of $63,340 and a 2.95 profit factor.

I also tested the PID indicator against the original RSI oscillator. System 1 (always in) using the RSI alone showed a net loss of $574,750 with a maximum drawdown of $908,397. Clearly the PID indicator performed significantly better than the RSI indicator on the always in system. For the trend filtered system, the RSI indicator showed a net profit of $138,040 with a maximum drawdown of $167,460 and a profit factor of 1.33. This compares to a net profit of $402,223 with a maximum drawdown of $372,378 and of profit factor of 1.19 for the PID trend filtered system. Again the PID indicator appears to be an improvement over the classic RSI indicator.

Captions:

Figure 1: Portfolio equity & underwater curves for system 1 & system 2.

Figure 2: Equity curve & yearly breakdown for SP contract on system 2.

Traders Studio code for The Pivot Detector Oscillator:
PID_RSI System.zip

 

 

 

 

 

 

 

 

 

 

 

 

 

Disclaimer | Privacy Policy | Contact Us | Spam Blocker | ©2009 Traders Edge Systems