Fri05242013

Last update12:00:00 AM

BackHomeS&C MagazineDepartmentsTraders' Tips TRADESTATION, SECTOR ROTATION MODEL (SRM)

TRADESTATION, SECTOR ROTATION MODEL (SRM)

logo

In the article “Applying The Sector Rotation Model” in this issue, author Giorgos Siligardos describes the use of several sector ETFs to calculate a sector rotation indicator based on several sectors. Siligardos suggests the indicator can be used to aid in analyzing stock index charts by providing a macro view of the economic cycle. The article provides examples of how the indicator can be used in this analysis.

Provided here is some indicator code for the sector rotation indicator (_SRMInd). This code utilizes multiple data streams in the chart. See the code for the data stream setup.

_SRMind ( Indicator )
{ TASC - August 2012 }
{ Applying the Sector Rotation Model }
{ Giorgos E. Siligardos, PhD }
{ 
Chart setup of data streams:
Data1 = Stock Index
Data2 = XLY
Data3 = XLF
Data4 = XLE
Data5 = XLU
Data6 = XLP
}
inputs:
ROCLength( 75 ), { Rate of Change Length }
AboveZeroColor( Green ),
BelowZeroColor( Red ) ; 
variables:
Bull01( 0, Data2 ), { XLY }
Bull02( 0, Data3 ), { XLF }
Bear01( 0, Data4 ), { XLE }
Bear02( 0, Data5 ), { XLU }
Bear03( 0, Data6 ), { XLP }
Bear( 0 ),
Bull( 0 ),
Osc( 0 ) ;
once
begin
if  BarType <> 2 or 
BarType of Data2 <> 2 or
BarType of Data3 <> 2 or
BarType of Data4 <> 2 or 
BarType of Data5 <> 2 or
BarType of Data6 <> 2
then
RaiseRunTimeError( "This indicator is " +
"designed for Daily bars in all data " +
"streams." ) ;
if Symbol of Data2 <> "XLY" then
RaiseRunTimeError( "Data2 Symbol " +
"should be XLY." ) ;
if Symbol of Data3 <> "XLF" then
RaiseRunTimeError( "Data3 Symbol " +
"should be XLF." ) ;
if Symbol of Data4 <> "XLE"  then
RaiseRunTimeError( "Data4 Symbol " +
"should be XLE." ) ;
if Symbol of Data5 <> "XLU" then
RaiseRunTimeError( "Data5 Symbol " +
"should be XLU." ) ;				
if Symbol of Data6 <> "XLP" then
RaiseRunTimeError( "Data6 Symbol " +
"should be XLP." ) ;
end ;
{ Calculate Rate of Change }
Bull01 = RateofChange( Close of Data2, ROCLength )
of Data2 ;
Bull02 = RateofChange( Close of Data3, ROCLength )
of Data3 ;
Bear01 = RateofChange( Close of Data4, ROCLength )
of Data4 ;
Bear02 = RateofChange( Close of Data5, ROCLength )
of Data5 ;
Bear03 = RateofChange( Close of Data6, ROCLength )
of Data6 ;
{ Calculate Averages }
Bear = ( Bear01 + Bear02 + Bear03 ) / 3 ;
Bull = ( Bull01 + Bull02 ) * 0.5 ;
{ Calculate Oscillator }
Osc = 100 * ( Bull - Bear ) ;
Plot1( Osc, "SRM Osc" ) ;
Plot2( 0, "Zero" ) ;
if Osc >= 0 then
SetPlotColor( 1, AboveZeroColor )
else
SetPlotColor( 2, BelowZeroColor ) ;

To download the EasyLanguage code for the indicator, first navigate to the EasyLanguage FAQs and Reference Posts Topic in the EasyLanguage support forum (https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=47452), scroll down and click on the link labeled “Traders’ Tips, TASC.” Then select the appropriate link for the month and year. The ELD filename is “_SRMIND.ELD.”

A sample chart is shown in Figure 1.

Image 1

FIGURE 1: TRADESTATION, SECTOR ROTATION MODEL INDICATOR (SRMIND). A daily bar chart of $INX (S&P 500) with a 200-day simple moving average (magenta plot) is shown. The indicator is plotted in the subgraph beneath price with a rate of change length of 75 days. The ETF data streams are also inserted per the setup described in the code and are hidden.

This article is for informational purposes. No type of trading or investment recommendation, advice, or strategy is being made, given, or in any manner provided by TradeStation Securities or its affiliates.

—Chris Imhof
TradeStation Securities, Inc.
A subsidiary of TradeStation Group, Inc.
www.TradeStation.com


To read the entire issue click here and subscribe today!

PTSK — The Professional Traders' Starter Kit
Home| Working Money Magazine | S&C Magazine | Traders.com Advantage | Online Store | Traders’ Resource
Add a Product to Traders’ Resource | Message Boards | Subscribe/Renew | Free Trial Issue | Article Code | Search

DEPARTMENTS: Advertising | Editorial | Circulation | Employment | Contact Us | BY PHONE: (206) 938-0570

Join us on Facebook     Follow us on Twitter     Follow Us on StockTwits

Bookmark and ShareCopyright © 1996-2013 Technical Analysis, Inc. All rights reserved. Read our disclaimer & privacy statement.

SUBSCRIBE TO OUR FREE
EMAIL NEWSLETTER!