AMIBROKER, SECTOR ROTATION MODEL (SRM) INDICATOR
- Details
- Parent Category: Departments
- Category: Traders' Tips
- Written by Tomasz Janeczko

In “Applying The Sector Rotation Model” in this issue, author Giorgos Siligardos presents his sector rotation model (SRM) indicator.
A ready-to-use AmiBroker formula for implementing the SRM is presented below. To use it, enter the formula in the AFL Editor, then press Insert Indicator. To modify the lookback period, right-click on the chart and select “parameters” from the menu.
// SRM Indicator
Lbp = Param("Lookback period", 75, 10, 200 );
Bull01 = 0.01 * ROC( Foreign("XLY", "C" ), Lbp );
Bull02 = 0.01 * ROC( Foreign("XLF", "C" ), Lbp );
Bear01 = 0.01 * ROC( Foreign("XLE", "C" ), Lbp );
Bear02 = 0.01 * ROC( Foreign("XLU", "C" ), Lbp );
Bear03 = 0.01 * ROC( Foreign("XLP", "C" ), Lbp );
Bull = ( Bull01 + Bull02 )/2;
Bear = ( Bear01 + Bear02 + Bear03 ) /3;
Plot( 100 * ( Bull - Bear ), "SRM"+_PARAM_VALUES(), colorRed, styleHistogram );
A sample chart is shown in Figure 11.

FIGURE 11: AMIBROKER, SECTOR ROTATION MODEL (SRM) INDICATOR. Here is a daily price chart of the S&P 500 (upper pane) and the SRM indicator (bottom pane).


Join us on Facebook
Follow us on Twitter