TradersEdgeSystems.com

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

March 2012 Stocks and Commodities Traders Tips


Introducing SwamiCharts :

AIQ Version:

Original article by John Ehlers and Ric Way
AIQ Code by Richard Denning

The AIQ code for John Ehlers and Ric Way’s article , “Introduction Swami Charts”, is provided at the web site noted below. Please note that I did not attempt to duplicate the Swami Charts as displayed in the article mainly because I am not a discretionary trader but rather focus completely on mechanical systems. I wanted to take the concept of multiple parameter sets for an indicator and see how this concept could be used in a system.

I decided to try a long term trend following system trading the NASDAQ 100 list of stocks using moving averages of various lengths. I created an indicator that uses 5 simple moving average lengths (10, 20, 50, 100, 200). If the close is above the moving average then it gets a value of +1, otherwise it gets a value of -1. I then just sum the five values from the different lengths to create the SMA_SWAMI indicator. I then created a system with the indicator by entering longs when the indicator is greater than or equal to 4 and exit when it drops to less than -4. I didn’t test the short side of the system, only the buy side. The code to test the short side is provided but was not tested.

In Figure 1, I show the equity curve and test statistics for the SMA_SWAMI system trading the NASDAQ 100 list of stock from 1/3/2000 to 1/13/2012. The system averaged 13% compounded annual return with a maximum drawdown of 45% during the 2007 to 2009 bear market. This system is for illustrative purposes only and is not meant to be a finished system for live trading.

Captions:
Figure 1 – System equity curve compared to the SPX together with the test statistics for the SMA_SWAMI system trading the NASDAQ 100 list of stock from 1/3/2000 to 1/13/2012. 

EDS Code for Swami
SWAMI.EDS
(right click and choose Save As)


 

Traders Studio Version :

Original article by John Ehlers and Ric Way
Traders Studio Code by Richard Denning

The TradersStudio code for John Ehlers and Ric Way’s article , “Introduction Swami Charts”, is provided below. The following code files are provided in the download below:

  • Function: “RSI_SWAMI_3” computes the indicator values for RSI Swami Indicator.
  • Indicator Plot: “RSI_SWAMI_3_IND” for displaying the RSI Swami Indicator.
  • System: “RSI_SWAMI_3” system of my design that uses the ideas from the Swami Charts

Please note that I did not attempt to duplicate the Swami Charts as displayed in the article mainly because I am not a discretionary trader but rather focus completely on mechanical systems. I wanted to take the concept of multiple parameter sets for an indicator and see how this concept could be used in a system. My first attempt was to combine seven different lengths of the RSI indicator and then use all lengths to general trade signals. Using the SP contract, I decided to trade one contract each time one of the seven RSI subsystems fired a signal. Thus without applying compounding, the system could be long or short anywhere from 0 to 7 contracts at any point in time. I determined the entry and exit levels for each of the following RSI lengths 2,3,5,8,13,21,34 (a Fibonacci series) by running optimizations for each length separately. The indicator plot simply shows the net signal from the system. For example, if all 7 subsystems are long, then the indicator will read a 7. If three are long and one is short and the rest are flat then the indicator will read a 2.

I ran a quick test in the Tradeplan module using compounding/sizing method called TS_PercentMargin (provided with the software) with parameters of 4 percent of margin and 100 contracts maximum. In Figure 1, I show the resulting log equity curve trading the SP futures contract and in Figure 2, I show the resulting underwater equity curve in percents. In Table 1, I show the yearly returns from 2000 through 2011. The average annual compounded return for the test is 20.8% with a maximum drawdown of 50.3% in 2008. The system did quickly recover from this deep drawdown. This system is for illustrative purposes only and is not meant to be a finished system for live trading.

Captions:
Figure 1: The log equity curve for the RSI_Swami_3 system trading the SP futures contract for the period 1/1/2000 to 12/31/2011.

Figure 2: The underwater equity curve for the RSI_Swami_3 system trading the SP futures contract for the period 1/1/2000 to 12/31/2011.

Table 1: The yearly returns for the RSI_Swami_3 system trading the SP futures contract for the period 1/1/2000 to 12/31/2011.

Traders Studio Code for Swami:
RSI_SWAMI_3.zip
(right click and choose Save As)

 

 

 

 

 

 

 

 

 

 

 

 

 

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