TradersEdgeSystems.com

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

September 2008 Stocks and Commodities Traders Tips


The Midas Touch

Original article by Andrew Coles
AIQ Code by Richard Denning
Traders Studio Code by Richard Denning

AIQ Version:

The AIQ code for Andrew Coles article, “The Midas Touch” is shown below. The author’s version of the indicator, which is a variation of a volume weighted moving average, is oriented toward discretionary trading because it requires visual examination of a chart to determine the significant low and high dates that are then input manually into the indicator before it can be used. I coded the author’s version of the indicator, however because I prefer to work with mechanical methods that can be back, I converted the indicator to an adaptive one (RD VWAP) that automatically finds the most recent high and low pivot dates and then plots the VWAP automatically from these dates. My version of the indicator will plot automatically on any chart and the only input required is the strength (bars on each side of the pivot). To test the indicator, I devised a simple trading system based on a trend following technique of buying when the close crosses above the VWAP adaptive indicator. I ran simulations using the NASDAQ 100 list of stocks. To run tests on a portfolio level, I used the following trade selection rules and capitalization rules: the trades were selected using 32-day AIQ relative strength taking the top three strongest signals per day, 10% of capital per position, with a maximum of ten open positions. Positions were exited on a reversing signal.

I was curious as to whether the new indicator would outperform a simple moving average crossover (SMACO) system. I used a moving average length equal to 2 * the strength parameter of the VWAP +1. I ran comparative tests over the period 10/15/2002 to 7/11/2008 using the same list of stocks and the same exit conditions with the difference being in the indicator driving the entries and exits. On the long only test-comparison, shown in Figure 1, the RD VWAP adaptive system (blue line) showed almost identical results to the SMACO system (red line) on all the various metrics. The short side only test-comparison (not shown), was also nearly identical to the standard moving average crossover system. For both systems, shorting the NASDAQ 100 stocks during the test period (which is mostly a bullish period) lost at the rate of 27% per year. Both of the systems need market timing and or trend filters to make the short side work. A trend filter might reduce the drawdown from the long side as well.

EDS Code for the Midas Touch:
Midas VWAP.EDS



Traders Studio Version :

The TradersStudio code for Andrew Coles article, “The Midas Touch” is shown below. The code for the author’s version of the indicator, which is a variation of a volume weighted moving average is listed under the heading “Midas Touch Indicator”. Because I prefer to work with mechanical methods that can be back tested, I converted the indicator to an adaptive one (RD VWAP) that automatically finds the most recent high and low pivot dates and then plots the VWAP automatically from these dates. My version of the indicator will plot automatically on any chart and the only input required is the strength (bars on each side of the pivot). I created a function to compute the RD VWAP, shown under the heading “RD VWAP Adaptive Moving Average”. This function is called to create the indicator plot, shown under the heading “RD VWAP Adaptive Indicator”. This indicator plots three VWAP moving averages. The fastest VWAP average starts from the most recent swing high or swing low. The second VWAP starts form the next most recent swing high or swing low pair. The third VWAP starts from the third most recent pair of swing high or swing low. The closer of the two in each pair set is used in each case. The RD VWAP indicator is shown in Figure 1 on a chart of crude oil.

To test the indicator, I devised a simple trading system based on a trend following technique of buying when the close crosses above the VWAP adaptive indicator. The code for this system is shown under the heading “RD VWAP Adaptive System”. For this test, I used the fastest of the three lines. I ran simulations using a diversified portfolio of reverse adjusted futures contracts consisting of cotton, Euro currency, copper, Japanese Yen, natural gas, sugar, and ten-year t-note. To run tests on a portfolio level, I used one of the trade plans provided with the software called the TS_PercentMarginPlan. (The code for this is not shown since it is provided with the software.) This plan bases position sizing on the margin requirements for each futures contract. I used a 10% parameter which means that I used only 10% of the available leverage on each contract. Positions were exited on a reversing signal.

I was curious as to whether the new indicator would outperform a simple moving average crossover (SMACO) system. (The code for the SMACO system is not shown but is posted at the web sites mentioned below.) I used a moving average length equal to 2 * the strength parameter of the VWAP +1. I ran comparative tests over the period 12/24/1992 to 7/11/2008 using the same portfolio of futures and the same exit conditions with the difference being in the indicator driving the entries and exits. The results of the tests are compared in Table 1 which shows that the RD VWAP adaptive system performing somewhat better than the SMACO system on all the various metrics. The long side on both systems preformed considerable better than the short side. The RD VWAP indicator appears to be worthy of further research. The stepping nature of the RD VWAP, might make it an excellent trailing stop.

Traders Studio code for The Midas Touch:
MIDAS Code Files.zip

 

 

 

 

 

 

 

 

 

 

 

 

 

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