May 2005
TRADERS' TIPS

Here is this month's selection of Traders' Tips, contributed by various developers of technical analysis software to help readers more easily implement some of the strategies presented in this and other issues.

You can copy these formulas and programs for easy use in your spreadsheet or analysis software. Simply "select" the desired text by highlighting as you would in any word processing program, then use your standard key command for copy or choose "copy" from the browser menu. The copied text can then be "pasted" into any open spreadsheet or other software by selecting an insertion point and executing a paste command. By toggling back and forth between an application window and the open Web page, data can be transferred with ease.

This month's tips include formulas and programs for:

TRADESTATION: UNIVERSAL CYCLE INDEX
WEALTH-LAB: UNIVERSAL CYCLE INDEX
AMIBROKER: UNIVERSAL CYCLE INDEX
eSIGNAL: UNIVERSAL CYCLE INDEX
NEUROSHELL TRADER: UNIVERSAL CYCLE INDEX
NEOTICKER: UNIVERSAL CYCLE INDEX
AIQ: UNIVERSAL CYCLE INDEX
ASPEN GRAPHICS: UNIVERSAL CYCLE INDEX
or return to May 2005 Contents


METASTOCK: UNIVERSAL CYCLE INDEX

Editor's note: The MetaStock code for Stuart Belknap's universal cycle index was provided in his article in this issue.

GO BACK


TRADESTATION: UNIVERSAL CYCLE INDEX

Stuart Belknap's article "Cycles In Time And Money" describes an algorithm for plotting a centered cycle oscillator. This indicator, the universal cycle index (UCI), is intended to be "in phase" with the market and to operate in real time. In his attempt to demonstrate how centering a moving average keeps it in phase with the market, Belknap provides a centered simple moving average indicator that will always be in phase. However, this second indicator cannot be used for real-time analysis. Belknap attempts to demonstrate the time-independence of his algorithm by implementing it using three different time periods.

The EasyLanguage code for Belknap's UCI can be downloaded from the TradeStation Support Center at TradeStation.com. Look for the file "SB CyclesInTime.eld" in the "TradeStation and EasyLanguage Support" discussion forum. The UCI indicator is named "SB Cycle Index." Input parameters can be used to implement the minor, secondary, and intermediate cycle charts described in the article. The centered baseline indicator is called "SB Centered Index" and is similarly parameterized. A strategy based on trading rules outlined in the article is also included. A sample chart is shown in Figure 1.


FIGURE 1: TRADESTATION, SPY DAILY, UNIVERSAL CYCLE INDEX. Here, the UCI is implemented in TradeStation (middle pane) as the SB Cycle Index and the SB Centered Index (centered baseline index).
Function:  Sigom
variables:
 MAValue( 0 ),
 yom( 0 ),
 avyom( 0 ),
 varyom( 0 ),
 som( 0 ) ;
MAValue = Average( Close, 25 ) ;
if MAValue > 0 then
 yom = 100 * ( Close[12] - MAValue ) / MAValue ;
avyom = Summation( yom, 50 ) / 50 ;
varyom = Summation( Square( yom ), 50 ) / 50 -
 Square( avyom ) ;
som = SquareRoot( varyom[12] ) ;
sigom = Average( som, 25 ) ;
Indicator:  SB Cycle Index
inputs:
 Length( 25 ),
 TopChannel( 50 ),
 BottomChannel( -50 ) ;
variables:
 MidLen( 0 ),
 ShortLen( 0 ),
 ShortXMA( 0 ),
 MidXMA( 0 ),
 SigomValue( 0 ),
 yme( 0 ),
 ymes( 0 ),
 ymesn( 0 ) ;
MidLen = IntPortion( 0.5 * Length ) ;
ShortLen = IntPortion( 0.5 * MidLen ) ;
ShortXMA = XAverage( Close, ShortLen ) ;
MidXMA = XAverage( Close, MidLen ) ;
SigomValue = sigom ;
if MidXMA <> 0 then
 yme = 100 * ( ShortXMA - MidXMA ) / MidXMA ;
ymes = LinearRegValue( yme, 6, 0 ) ;
if SigomValue <> 0 then
 ymesn = 100 * ymes / SigomValue ;
if CurrentBar > 4 * Length then
 begin
 Plot1( ymesn, "ymesn" );
 Plot2( TopChannel, "TopChan" ) ;
 Plot3( BottomChannel, "BottomChan" ) ;
 Plot4( 0, "Zero Line" ) ;
 end ;
Indicator:  SB Centered Index
inputs:
 Length( 25 ) ;
variables:
 MidLen( 0 ),
 ShortLen( 0 ),
 MAValue( 0 ),
 ym( 0 ),
 SigomValue( 0 ),
 ymn( 0 ) ;
MidLen = IntPortion( 0.5 * Length ) ;
ShortLen = IntPortion( 0.5 * MidLen ) ;
MAValue = Average( Close, Length ) ;
SigomValue = sigom ;
if MAValue <> 0 then
 ym = 100 * ( Average( Close[ShortLen], MidLen ) -
  MAValue ) / MAValue ;
if SigomValue <> 0 then
 ymn = 100 * ym / SigomValue ;
Plot1[MidLen]( ymn, "ymn" ) ;
Indicator:  SB Centered Channel
inputs:
 Length( 25 ),
  SigomFactor( 2 ) ;
variables:
 MidLen( 0 ),
 acm( 0 ),
 SigomValue( 0 ),
 FactxValue( 0 ),
 Top( 0 ),
 Bottom( 0 ) ;
MidLen = IntPortion( 0.5 * Length ) ;
acm = Average( Close, 25 ) ;
SigomValue = sigom ;
FactxValue = SigomFactor * SigomValue * 0.01 ;
Top = ( 1 + FactxValue ) * acm ;
Bottom = ( 1 - FactxValue ) * acm ;
Plot1[MidLen]( Top, "Top" ) ;
Plot2[MidLen]( Bottom, "Bottom" ) ;
Indicator:  SB Real-Time Channel
inputs:
 Length( 25 ),
  SigomFactor( 2 ) ;
variables:
 arm( 0 ),
 SigomValue( 0 ),
 FactxValue( 0 ),
 Top( 0 ),
 Bottom( 0 ) ;
arm = Average( Close, Length ) ;
SigomValue = sigom ;
FactxValue = SigomFactor * SigomValue * 0.01 ;
Top = ( 1 + FactxValue ) * arm ;
Bottom = ( 1 - FactxValue ) * arm ;
Plot1( Top, "Top" ) ;
Plot2( Bottom, "Bottom" ) ;
Indicator:  SB Volatility
variables:
 SigomValue( 0 ) ;
if CurrentBar > 12 then
 begin
 SigomValue = sigom ;
 Plot1[12]( SigomValue, "SBVol" ) ;
 end ;
Indicator:  SB Stochastic Osc
inputs:
 LongLen( 12 ),
 ShortLen( 6 ) ;
variables:
 FastKValue( 0 ),
 XMAFastK( 0 ),
 STOsc( 0 ) ;
FastKValue = FastK( LongLen ) ;
XMAFastK = XAverage( FastKValue, ShortLen ) ;
STOsc = Average( XMAFastK, ShortLen ) ;
Plot1( STOsc, "STOsc" ) ;
Strategy:  SB Strategy
inputs:
 Length( 25 ),
 TopChannel( 50 ),
 BottomChannel( -50 ) ;
variables:
 MidLen( 0 ),
 ShortLen( 0 ),
 ShortXMA( 0 ),
 MidXMA( 0 ),
 SigomValue( 0 ),
 yme( 0 ),
 ymes( 0 ),
 ymesn( 0 ) ;
MidLen = IntPortion( 0.5 * Length ) ;
ShortLen = IntPortion( 0.5 * MidLen ) ;
ShortXMA = XAverage( Close, ShortLen ) ;
MidXMA = XAverage( Close, MidLen ) ;
SigomValue = sigom ;
if MidXMA <> 0 then
 yme = 100 * ( ShortXMA - MidXMA ) / MidXMA ;
ymes = LinearRegValue( yme, 6, 0 ) ;
if SigomValue <> 0 then
 ymesn = 100 * ymes / SigomValue ;
{ CB > 2 check used to avoid spurious cross confirmation
at CB = 2.  At CB = 1, MySlowK and MySlowD will be the
same. }
if CurrentBar > 2 and ymesn crosses under TopChannel
 then
 Sell Short ( "UCI SE" ) next bar at market ;
if CurrentBar > 2 and ymesn crosses over BottomChannel
 then
 Buy ( "UCI LE" ) next bar market ;
--Mark Mills
TradeStation Securities, Inc.
A subsidiary of TradeStation Group, Inc.
www.TradeStationWorld.com
GO BACK

WEALTH-LAB: UNIVERSAL CYCLE INDEX

Here is the WealthScript translation of the MetaStock code for the universal cycle index given by Stuart Belknap in "Cycles In Time And Money" in this issue.

Being unfamiliar with the "arrow-posting" terminology in the author's trading system rules, I tested reversals using touch stops and then again with market orders, which reversed a trade's position after the closing price exceeded the stop level. The ChartScript reflects the latter stop method, since it proved to be more profitable for VeriSign (VRSN) over the test period, but the code appears to have generated a few whipsaws not observed for the same test in the article (Figure 2). Perhaps this is due to different trading rules, data, or a combination of both.


FIGURE 2: WEALTH-LAB, UNIVERSAL CYCLE INDEX. Despite the short-trade triggers, the always-in trading system performed well on VeriSign [VRSN] during the test period shown. The stop levels are represented by the small brown circles.


This Wealth-Lab code as well as the ChartScript trading system is available to all Wealth-Lab Pro and Developer users via the Community|Download ChartScripts action. Search the public ChartScript titles for the word "universal," and then enter a symbol of your choice.

Wealth-Lab script code:
{$I 'VolumeColor'}
{$I 'Universal Cycle Index (UCI)'}
{ Note: UCI contains a reference to the DVSSeries }
const DVS_PER = 50;   // Volatility Period
const CYC_PER = 25;   // Uni. Cycle Period
var Bar, p, UCIPane, DVSPane, StartBar: integer;
var Stp: float;
var hDVS: integer = DVSSeries( #Close, DVS_PER );
var hUCI: integer = UCISeries( #Close, CYC_PER, DVS_PER );
{ Plotting }
UCIPane := CreatePane( 100, true, true );
PlotSeriesLabel( hUCI, UCIPane, #Red, #Thick, 'UCI' );
DrawHorzLine( 50, UCIPane, 0, #Dotted );
DrawHorzLine( -50, UCIPane, 0, #Dotted );
DVSPane := CreatePane( 50, true, true );
PlotSeriesLabel( hDVS, DVSPane, #Blue, #Thick, 'Sigma' );
EnableTradeNotes( false, true, true );
{ Trading System }
StartBar := Round( Max( 2 * DVS_PER, 1.5 * CYC_PER ) );
if StartBar >= BarCount then
  ShowMessage( 'Use Data Loading control to include more bars' );
for Bar := StartBar to BarCount - 1 do
begin
  if LastPositionActive then
  begin
    p := LastPosition;
    if PositionLong( p ) then
    begin
      Stp := PositionEntryPrice( p ) * ( 1 - @hDVS[Bar]/100 );
      if ( PriceClose( Bar ) < Stp )
      or CrossUnderValue( Bar, hUCI, 50 ) then
      begin
        SellAtMarket( Bar + 1, p, '1, Reverse' );
        ShortAtMarket( Bar + 1, 'S, Reverse' );
      end;
    end
    else
    begin
      Stp := PositionEntryPrice( p ) * ( 1 + @hDVS[Bar]/100 );
      if ( PriceClose( Bar ) > Stp )
      or CrossOverValue( Bar, hUCI, -50 ) then
      begin
        CoverAtMarket( Bar + 1, p, '2, Reverse' );
        BuyAtMarket( Bar + 1, 'L, Reverse' );
      end;
    end;
    DrawCircle( 4, 0, Bar, Stp, 630, #Thin );
  end
  else if CrossOverValue( Bar, hUCI, -50 ) then
    BuyAtMarket( Bar + 1, 'L' )
  else if CrossUnderValue( Bar, hUCI, 50 ) then
    ShortAtMarket( Bar + 1, 'S' );
end;
--Robert Sucher
www.wealth-lab.com


GO BACK


AMIBROKER: UNIVERSAL CYCLE INDEX

In "Cycles In Time And Money," Stuart Belknap presents his own variation of a classic MACD indicator that he calls the universal cycle index (UCI).

Implementing this indicator in AmiBroker Formula Language (AFL) is straightforward. Ready-to-use code is presented in Listing 1. Instead of writing separate formulas for minor, secondary, and intermediate cycles, we have written one parameterized formula that implements all variations and allows the user to choose the period and kind (centered versus noncentered) of the indicator directly from AmiBroker's graphical user interface. A sample chart is in Figure 3.


FIGURE 3: AMIBROKER, UNIVERSAL CYCLE INDEX. This screenshot shows a daily price chart of VeriSign (upper pane) with a minor cycle index (25 bars) chart plotted in the lower pane.
LISTING 1
function SigomPcnt()
{
    yom = 100 * ( C - Ref( MA( C, 25 ), 12 ) )/Ref( MA( C, 25 ), 12 );
    avyom = MA( yom, 50 );
    varyom = MA( yom ^ 2, 50 ) - avyom ^ 2;
    som = Ref( sqrt( varyom ), -12 );
    return MA( som, 25 );
}
function UCI( period )
{
    period2 = floor( period / 2 ); // divide original period by 2
    period4 = floor( period / 4 ); // half
    sigom = SigomPcnt();
    yme = 100 * ( EMA( C, period4 ) - EMA( C, period2 ))/EMA( C, period2 );
    ymes = TSF( yme, 6 );
    return 100 * ymes / sigom;
}
function CenteredUCI( period )
{
    period2 = floor( period / 2 ); // divide original period by 2
    period4 = floor( period / 4 ); // half
    sigom = SigomPcnt();
    ym = 100 * ( Ref( MA( C, period2 ), period4 ) -
         Ref( MA( C, period ), period2 ) ) /
         Ref( MA( C, period ), period2 );
    return 100 * ym / sigom;
}
period = Param("period", 25, 25, 100, 2 );
IsCentered = ParamToggle("Centered?", "No|Yes");
grid = IIf( period >= 100, 150, IIf( period >= 50, 100, 50 ) );
SetChartOptions( 0, 0, 0 );
if( IsCentered )
{
   Plot( x = CenteredUCI( period ), "Centered UCI(" + period + ")",
         ParamColor("Color", colorRed) );
}
else
{
   Plot( x = UCI( period ), "UCI(" + period + ")",
         ParamColor("Color", colorRed) );
}
PlotGrid( grid );
PlotGrid( 0 );
PlotGrid( -grid );


--Tomasz Janeczko, AmiBroker.com
www.amibroker.com


GO BACK


eSIGNAL: UNIVERSAL CYCLE INDEX

For this month's article by Stuart Belknap, "Cycles In Time And Money," we've provided all of the indicators included in his sidebar except the stochastic, RSI, and exponential averages. Those studies are built into the software and can be applied from the Basic Studies menu. Some of the UCI studies also require two additional EFS files, TSF.efs and UCI_volatility.efs. All files need to be saved in the same folder in order to work properly.

Sample charts are shown in Figures 4 and 5. To discuss these studies or download complete copies of the formulas, please visit the EFS Library Discussion Board forum under the Bulletin Boards link at www.esignalcentral.com.

FIGURE 4: eSIGNAL, UNIVERSAL CYCLE INDEX. Here is a demonstration of the UCI in eSignal.

FIGURE 5: eSIGNAL, UNIVERSAL CYCLE INDEX. Here is a demonstration of UCI minor cycle index, the UCI secondary cycle index, and the UCI intermediate cycle index.


/***************************************

Provided By : eSignal (c) Copyright 2005
Description: Time Series Forecast
Version 1.0 3/9/2005
Notes:
May 2005 Issue - "Cycles In Time And Money"
by Stuart Belknap, PhD
This formula is intended to be called via efs()
from external EFS2 formulas. Parameters are expected
from external EFS2 formulas, not Edit Studies.

Formula Parameters: Defaults:
Array NA
nPeriods 5

***************************************/

function preMain() {
setPriceStudy(true);
setStudyTitle("Time Series Forecast ");
setCursorLabelName("TSF", 0);
setDefaultBarFgColor(Color.magenta, 0);
setShowTitleParameters(false);
}

var aY = null;

function main(Array, nPeriods) {
var nState = getBarState();
var i = 0;
var A, B;

if (nPeriods == null) nPeriods = 5;
//debugPrintln(Array);
if (Array == null || !(typeof(Array) == "object")) Array = getValue("Close", 0, -(nPeriods+1));
aY = Array;
// y = Ax + B;
// A = SUM( (x-xAVG)*(y-yAVG) ) / SUM( (x-xAVG)^2 )
// A = slope
// B = yAVG - (A*xAVG);

if (aY[nPeriods-1] != null) {
var vLRvalues = LinReg(nPeriods, aY);
A = vLRvalues[0];
B = vLRvalues[1];
}

return B + (A * (nPeriods - 1 - nPeriods));
}

/***** Support Functions *****/

function LinReg(nLRlen, aArray) {
var xSum = 0;
var ySum = 0;
i = 0;
for (i = 0; i < nLRlen; ++i) {
xSum += i;
ySum += aArray[i];
}
var xAvg = xSum/nLRlen;
var yAvg = ySum/nLRlen;
var aSum1 = 0;
var aSum2 = 0;
i = 0;
for (i = 0; i < nLRlen; ++i) {
aSum1 += (i-xAvg) * (aArray[i]-yAvg);
aSum2 += (i-xAvg)*(i-xAvg);
}
var A = (aSum1 / aSum2); // Slope
var B = yAvg - (A*xAvg); // Y - Intercept

return new Array(A, B);
}

/***************************************
Provided By : eSignal (c) Copyright 2005
Description: Centered Channel Lines
Version 1.0 3/11/2005
Notes:
May 2005 Issue - "Cycles In Time And Money"
by Stuart Belknap, PhD

This study uses EFS2 functionality available in eSignal version 7.9 or later.
Due to the nature of the centered moving averages, this formula may not be
used for real time analysis as the author mentions in the article.
Formula Parameters: Defaults:
***************************************/
function preMain() {
setPriceStudy(true);
setStudyTitle("UCI Centered Channel Lines ");
setShowTitleParameters(false);
setCursorLabelName("cUpr Channel", 0);
setCursorLabelName("cBase Channel", 1);
setCursorLabelName("cLwr Channel", 2);
setDefaultBarFgColor(Color.red, 0);
setDefaultBarFgColor(Color.red, 1);
setDefaultBarFgColor(Color.red, 2);
setDefaultBarThickness(2, 0);
setDefaultBarThickness(2, 1);
setDefaultBarThickness(2, 2);
}

var bVersion = null;

function main() {
if (bVersion == null) bVersion = verify();
if (bVersion == false) return;

var xArm = offsetSeries(sma(25), -12);
var xUpr = efsInternal("calc_Upr");
var xLwr = efsInternal("calc_Lwr");

return new Array(xUpr, xArm, xLwr);
}

/**** Internal Series Functions *****/

function calc_Upr() {
return (1+2*efs("UCI_volatility.efs", 0)/100)*offsetSeries(sma(25), -12);
}

function calc_Lwr() {
return (1-2*efs("UCI_volatility.efs", 0)/100)*offsetSeries(sma(25), -12);
}

/***** Support Functions *****/

function verify() {
var b = false;
if (getBuildNumber() < 700) {
drawTextRelative(5, 25, "This study requires version 7.9 or later.",
Color.black, Color.red, Text.BOLD|Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM,
null, 14, "error");
drawTextRelative(5, 10, "Click HERE to upgrade.@URL=https://www.esignal.com/download/default.asp",
Color.black, Color.red, Text.BOLD|Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM,
null, 14, "upgrade");
return;
} else {
b = true;
}

return b;
}

/***************************************
Provided By : eSignal (c) Copyright 2005
Description: Centered Intermediate Cycle Index

Version 1.0 3/10/2005

Notes:
May 2005 Issue - "Cycles In Time And Money"
by Stuart Belknap, PhD

This study uses EFS2 functionality available in eSignal version 7.9 or later.
Due to the nature of the centered moving averages, this formula may not be
used for real time analysis as the author mentions in the article.

Formula Parameters: Defaults:

***************************************/

function preMain() {
setStudyTitle("UCI Centered Intermediate Cycle Index ");
setShowTitleParameters(false);
setCursorLabelName("cICI", 0);
setDefaultBarFgColor(Color.darkgreen, 0);
setDefaultBarThickness(1, 0);
addBand(150, PS_DASH, 1, Color.darkgreen, "150+");
addBand(0, PS_DASH, 1, Color.darkgreen, "0");
addBand(-150, PS_DASH, 1, Color.darkgreen, "150-");
}

var bVersion = null;
var nYi = null;

function main() {
if (getCurrentBarIndex() == 0) return;
if (bVersion == null) bVersion = verify();
if (bVersion == false) return;

var xSigom = efs("UCI_volatility.efs", 0);
var xYi = efsInternal("calc_xYi");
if (xSigom.getValue(0) == null || xYi.getValue(0) == null) return;

nYi = xYi.getValue(0);
if (nYi == null) return;

var nYin = 100 * nYi/xSigom.getValue(0);

return nYin;
}

/**** Internal Series Functions *****/

function calc_xYi() {
var sma1 = sma(50, 25); // returns single values
var sma2 = sma(100, 50);
if (sma1 == null || sma2 == null) return;
return 100 * ((sma1 - sma2) / sma2);
}

/***** Support Functions *****/

function verify() {
var b = false;
if (getBuildNumber() < 700) {
drawTextRelative(5, 25, "This study requires version 7.9 or later.",
Color.black, Color.red, Text.BOLD|Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM,
null, 14, "error");
drawTextRelative(5, 10, "Click HERE to upgrade.@URL=https://www.esignal.com/download/default.asp",
Color.black, Color.red, Text.BOLD|Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM,
null, 14, "upgrade");
return;
} else {
b = true;
}

return b;
}

/***************************************
Provided By : eSignal (c) Copyright 2005
Description: Centered Minor Cycle Index

Version 1.0 3/10/2005

Notes:
May 2005 Issue - "Cycles In Time And Money"
by Stuart Belknap, PhD

This study uses EFS2 functionality available in eSignal version 7.9 or later.
Due to the nature of the centered moving averages, thisformula may not be
used for real time analysis as the author mentions in the article.

Formula Parameters: Defaults:

***************************************/

function preMain() {
setStudyTitle("UCI Centered Minor Cycle Index ");
setShowTitleParameters(false);
setCursorLabelName("cMCI", 0);
setDefaultBarFgColor(Color.maroon, 0);
setDefaultBarThickness(1, 0);
addBand(50, PS_DASH, 1, Color.maroon, "50+");
addBand(0, PS_DASH, 1, Color.maroon, "0");
addBand(-50, PS_DASH, 1, Color.maroon, "50-");
}

var bVersion = null;
var nYm = null;

function main() {
if (getCurrentBarIndex() == 0) return;
if (bVersion == null) bVersion = verify();
if (bVersion == false) return;

var xSigom = efs("UCI_volatility.efs", 0);
var xYm = efsInternal("calc_xYm");
if (xSigom.getValue(0) == null || xYm.getValue(0) == null) return;

nYm = xYm.getValue(0);
if (nYm == null) return;

var nYmn = 100 * nYm/xSigom.getValue(0);

return nYmn;
}

/**** Internal Series Functions *****/

function calc_xYm() {
var sma1 = sma(12, 6); // returns single values
var sma2 = sma(25, 12);
if (sma1 == null || sma2 == null) return;
return 100 * ((sma1 - sma2) / sma2);
}

/***** Support Functions *****/

function verify() {
var b = false;
if (getBuildNumber() < 700) {
drawTextRelative(5, 25, "This study requires version 7.9 or later.",
Color.black, Color.red, Text.BOLD|Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM,
null, 14, "error");
drawTextRelative(5, 10, "Click HERE to upgrade.@URL=https://www.esignal.com/download/default.asp",
Color.black, Color.red, Text.BOLD|Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM,
null, 14, "upgrade");
return;
} else {
b = true;
}

return b;
}

/***************************************
Provided By : eSignal (c) Copyright 2005
Description: Centered Secondary Cycle Index

Version 1.0 3/10/2005

Notes:
May 2005 Issue - "Cycles In Time And Money"
by Stuart Belknap, PhD

This study uses EFS2 functionality available in eSignal version 7.9 or later.
Due to the nature of the centered moving averages, this formula may not be
used for real time analysis as the author mentions in the article.

Formula Parameters: Defaults:

***************************************/

function preMain() {
setStudyTitle("UCI Centered Secondary Cycle Index ");
setShowTitleParameters(false);
setCursorLabelName("cSCI", 0);
setDefaultBarFgColor(Color.navy, 0);
setDefaultBarThickness(1, 0);
addBand(100, PS_DASH, 1, Color.navy, "100+");
addBand(0, PS_DASH, 1, Color.navy, "0");
addBand(-100, PS_DASH, 1, Color.navy, "100-");
}

var bVersion = null;
var nYs = null;

function main() {
if (getCurrentBarIndex() == 0) return;
if (bVersion == null) bVersion = verify();
if (bVersion == false) return;

var xSigom = efs("UCI_volatility.efs", 0);
var xYs = efsInternal("calc_xYs");
if (xSigom.getValue(0) == null || xYs.getValue(0) == null) return;

nYs = xYs.getValue(0);
if (nYs == null) return;

var nYsn = 100 * nYs/xSigom.getValue(0);

return nYsn;
}

/**** Internal Series Functions *****/

function calc_xYs() {
var sma1 = sma(25, 12); // returns single values
var sma2 = sma(50, 25);
if (sma1 == null || sma2 == null) return;
return 100 * ((sma1 - sma2) / sma2);
}

/***** Support Functions *****/

function verify() {
var b = false;
if (getBuildNumber() < 700) {
drawTextRelative(5, 25, "This study requires version 7.9 or later.",
Color.black, Color.red, Text.BOLD|Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM,
null, 14, "error");
drawTextRelative(5, 10, "Click HERE to upgrade.@URL=https://www.esignal.com/download/default.asp",
Color.black, Color.red, Text.BOLD|Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM,
null, 14, "upgrade");
return;
} else {
b = true;
}

return b;
}

/***************************************
Provided By : eSignal (c) Copyright 2005
Description: Real-Time Channel Lines

Version 1.0 3/11/2005

Notes:
May 2005 Issue - "Cycles In Time And Money"
by Stuart Belknap, PhD

This study uses EFS2 functionality available in eSignal version 7.9 or later.

Formula Parameters: Defaults:

***************************************/

function preMain() {
setPriceStudy(true);
setStudyTitle("UCI Channel Lines ");
setShowTitleParameters(false);
setCursorLabelName("Upr Channel", 0);
setCursorLabelName("Base Channel", 1);
setCursorLabelName("Lwr Channel", 2);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarFgColor(Color.blue, 1);
setDefaultBarFgColor(Color.blue, 2);
setDefaultBarThickness(2, 0);
setDefaultBarThickness(2, 1);
setDefaultBarThickness(2, 2);
}

var bVersion = null;

function main() {
if (bVersion == null) bVersion = verify();
if (bVersion == false) return;

var xArm = sma(25);
var xUpr = efsInternal("calc_Upr");
var xLwr = efsInternal("calc_Lwr");

return new Array(xUpr, xArm, xLwr);
}

/**** Internal Series Functions *****/

function calc_Upr() {
return (1+2*efs("UCI_volatility.efs", 0)/100)*sma(25);
}

function calc_Lwr() {
return (1-2*efs("UCI_volatility.efs", 0)/100)*sma(25);
}

/***** Support Functions *****/

function verify() {
var b = false;
if (getBuildNumber() < 700) {
drawTextRelative(5, 25, "This study requires version 7.9 or later.",
Color.black, Color.red, Text.BOLD|Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM,
null, 14, "error");
drawTextRelative(5, 10, "Click HERE to upgrade.@URL=https://www.esignal.com/download/default.asp",
Color.black, Color.red, Text.BOLD|Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM,
null, 14, "upgrade");
return;
} else {
b = true;
}

return b;
}

/***************************************
Provided By : eSignal (c) Copyright 2005
Description: Intermediate Cycle Index

Version 1.0 3/10/2005

Notes:
May 2005 Issue - "Cycles In Time And Money"
by Stuart Belknap, PhD

This study uses EFS2 functionality available in eSignal version 7.9 or later.

Formula Parameters: Defaults:

***************************************/

function preMain() {
setStudyTitle("UCI Intermediate Cycle Index ");
setShowTitleParameters(false);
setCursorLabelName("ICI", 0);
setDefaultBarFgColor(Color.green, 0);
setDefaultBarThickness(2, 0);
addBand(150, PS_DASH, 1, Color.darkgreen, "150+");
addBand(0, PS_DASH, 1, Color.darkgreen, "0");
addBand(-150, PS_DASH, 1, Color.darkgreen, "150-");
}

var bVersion = null;
var nYie = null;
var aYie = new Array(6);

function main() {
if (bVersion == null) bVersion = verify();
if (bVersion == false) return;

var nState = getBarState();

if (nState == BARSTATE_NEWBAR && nYie != null) {
aYie.pop();
aYie.unshift(nYie);
}

var xSigom = efs("UCI_volatility.efs", 0);
var xYie = efsInternal("calc_xYie");
if (xSigom.getValue(0) == null || xYie.getValue(0) == null) return;

nYie = xYie.getValue(0);
if (nYie == null) return;
aYie[0] = nYie;

var nYies = null;
if (aYie[5] != null) {
nYies = callFunction("TSF.efs", "main", aYie, 6);
} else {
return;
}

if (nYies == null) return;

var nYiesn = 100 * nYies/xSigom.getValue(0);

return nYiesn;
}

/**** Internal Series Functions *****/

function calc_xYie() {
return 100 * ((ema(25) - ema(50)) / ema(50));
}

/***** Support Functions *****/

function verify() {
var b = false;
if (getBuildNumber() < 700) {
drawTextRelative(5, 25, "This study requires version 7.9 or later.",
Color.black, Color.red, Text.BOLD|Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM,
null, 14, "error");
drawTextRelative(5, 10, "Click HERE to upgrade.@URL=https://www.esignal.com/download/default.asp",
Color.black, Color.red, Text.BOLD|Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM,
null, 14, "upgrade");
return;
} else {
b = true;
}

return b;
}

/***************************************
Provided By : eSignal (c) Copyright 2005
Description: Minor Cycle Index

Version 1.0 3/9/2005

Notes:
May 2005 Issue - "Cycles In Time And Money"
by Stuart Belknap, PhD

This study uses EFS2 functionality available in eSignal version 7.9 or later.

Formula Parameters: Defaults:

***************************************/

function preMain() {
setStudyTitle("UCI Minor Cycle Index ");
setShowTitleParameters(false);
setCursorLabelName("MCI", 0);
setDefaultBarFgColor(Color.red, 0);
setDefaultBarThickness(2, 0);
addBand(50, PS_DASH, 1, Color.maroon, "50+");
addBand(0, PS_DASH, 1, Color.maroon, "0");
addBand(-50, PS_DASH, 1, Color.maroon, "50-");
}

var bVersion = null;
var nYme = null;
var aYme = new Array(6);

function main() {
if (bVersion == null) bVersion = verify();
if (bVersion == false) return;

var nState = getBarState();

if (nState == BARSTATE_NEWBAR && nYme != null) {
aYme.pop();
aYme.unshift(nYme);
}

var xSigom = efs("UCI_volatility.efs", 0);
var xYme = efsInternal("calc_xYme");
if (xSigom.getValue(0) == null || xYme.getValue(0) == null) return;

nYme = xYme.getValue(0);
if (nYme == null) return;
aYme[0] = nYme;

var nYmes = null;
if (aYme[5] != null) {
nYmes = callFunction("TSF.efs", "main", aYme, 6);
} else {
return;
}

if (nYmes == null) return;

var nYmesn = 100 * nYmes/xSigom.getValue(0);

return nYmesn;
}

/**** Internal Series Functions *****/

function calc_xYme() {
return 100 * ((ema(6) - ema(12)) / ema(12));
}

/***** Support Functions *****/

function verify() {
var b = false;
if (getBuildNumber() < 700) {
drawTextRelative(5, 25, "This study requires version 7.9 or later.",
Color.black, Color.red, Text.BOLD|Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM,
null, 14, "error");
drawTextRelative(5, 10, "Click HERE to upgrade.@URL=https://www.esignal.com/download/default.asp",
Color.black, Color.red, Text.BOLD|Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM,
null, 14, "upgrade");
return;
} else {
b = true;
}

return b;
}

/***************************************
Provided By : eSignal (c) Copyright 2005
Description: Secondary Cycle Index

Version 1.0 3/10/2005

Notes:
May 2005 Issue - "Cycles In Time And Money"
by Stuart Belknap, PhD

This study uses EFS2 functionality available in eSignal version 7.9 or later.

Formula Parameters: Defaults:

***************************************/

function preMain() {
setStudyTitle("UCI Secondary Cycle Index ");
setShowTitleParameters(false);
setCursorLabelName("SCI", 0);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarThickness(2, 0);
addBand(100, PS_DASH, 1, Color.navy, "100+");
addBand(0, PS_DASH, 1, Color.navy, "0");
addBand(-100, PS_DASH, 1, Color.navy, "100-");
}

var bVersion = null;
var nYse = null;
var aYse = new Array(6);

function main() {
if (bVersion == null) bVersion = verify();
if (bVersion == false) return;

var nState = getBarState();

if (nState == BARSTATE_NEWBAR && nYse != null) {
aYse.pop();
aYse.unshift(nYse);
}

var xSigom = efs("UCI_volatility.efs", 0);
var xYse = efsInternal("calc_xYse");
if (xSigom.getValue(0) == null || xYse.getValue(0) == null) return;

nYse = xYse.getValue(0);
if (nYse == null) return;
aYse[0] = nYse;

var nYses = null;
if (aYse[5] != null) {
nYses = callFunction("TSF.efs", "main", aYse, 6);
} else {
return;
}

if (nYses == null) return;

var nYsesn = 100 * nYses/xSigom.getValue(0);

return nYsesn;
}

/**** Internal Series Functions *****/

function calc_xYse() {
return 100 * ((ema(12) - ema(25)) / ema(25));
}

/***** Support Functions *****/

function verify() {
var b = false;
if (getBuildNumber() < 700) {
drawTextRelative(5, 25, "This study requires version 7.9 or later.",
Color.black, Color.red, Text.BOLD|Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM,
null, 14, "error");
drawTextRelative(5, 10, "Click HERE to upgrade.@URL=https://www.esignal.com/download/default.asp",
Color.black, Color.red, Text.BOLD|Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM,
null, 14, "upgrade");
return;
} else {
b = true;
}

return b;
}

/***************************************
Provided By : eSignal (c) Copyright 2005
Description: Universal Cycle Index Volatility (Sigom %)

Version 1.0 3/8/2005

Notes:
May 2005 Issue - "Cycles In Time And Money"
by Stuart Belknap, PhD

This study uses EFS2 functionality available in eSignal version 7.9 or later.

Formula Parameters: Defaults:

***************************************/

function preMain() {
setStudyTitle("UCI Volatility (Sigom \%) ");
setShowTitleParameters(false);
setCursorLabelName("sigom \%", 0);
setDefaultBarFgColor(Color.green, 0);
setDefaultBarThickness(2, 0);
}

var bVersion = null;

function main() {
if (bVersion == null) bVersion = verify();
if (bVersion == false) return;

var xSigom = sma(25, efsInternal("calc_xSom"));

return offsetSeries(xSigom, 12);
}

/**** Internal Series Functions *****/

function calc_xSom() {
var xYom2 = sma(50, efsInternal("calc_xYom2"));
var xAvyom = sma(50, efsInternal("calc_xYom"));
if (xYom2.getValue(0) == null || xAvyom.getValue(0) == null) return;
var nVaryon = xYom2.getValue(0) - Math.pow(xAvyom.getValue(0), 2);
var nSom = Math.sqrt(nVaryon);
return nSom;
}

function calc_xYom() {
var xsma12 = offsetSeries(sma(25, close()),-12); // returns an offset Series
return (100*(close()-xsma12)/xsma12);
}

function calc_xYom2() {
var nYom2 = efsInternal("calc_xYom");
return Math.pow(nYom2.getValue(0), 2);
}

/***** Support Functions *****/

function verify() {
var b = false;
if (getBuildNumber() < 700) {
drawTextRelative(5, 25, "This study requires version 7.9 or later.",
Color.black, Color.red, Text.BOLD|Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM,
null, 14, "error");
drawTextRelative(5, 10, "Click HERE to upgrade.@URL=https://www.esignal.com/download/default.asp",
Color.black, Color.red, Text.BOLD|Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM,
null, 14, "upgrade");
return;
} else {
b = true;
}

return b;
}

--Jason Keck
eSignal, a division of Interactive Data Corp.
800 815-8256, www.esignalcentral.com


GO BACK


NEUROSHELL TRADER: UNIVERSAL CYCLE INDEX

Stuart Belknap's universal cycle index (UCI) can be easily implemented in NeuroShell Trader by combining a few of NeuroShell Trader's 800-plus indicators. To implement the UCI indicators, select "New Indicator ..." from the Insert menu and use the Indicator Wizard to create the following indicators:

Volatility (Sigom %)
  YOM:    Multiply( 100, Subtract( Divide( Close, Lag(MovAvg(Close,12),25) ), 1))
  AVYOM:  Divide ( Add2 ( YOM, 50 ), 50 )
  VARYOM: Subtract( Divide( Add2( Multiply2(YOM,YOM), 50 ), 50 ), Multiply2(AVYOM,AVYOM))
  SOM:    Lag( Sqrt( VARYOM ), 12 )
  SIGOM:  MovAvg( SOM, 25 )
Cycle Index***
  YE: Multiply2( 100, Subtract( Divide( MovAvg(Close,x), MovAvg(Close,y) ), 1 ) )
  YES: LinTimeRegPredVal( YE, x, 1 )
  YESN: Multiply( 100, Divide( YES, SIGOM ) )
Centered Cycle Index***
  YC: Multiply2(100,Subtract(Divide(Lead(MovAvg(Close,y),x),Lead(MovAvg(Close,z),y)),1))
  YCN: Multiply( 100, Divide( YC, SIGOM ) )
***For Minor Cycle Index use parameters x=6, y=12, z=25;
 for Secondary Cycle Index use parameters x=12, y=25, z=50; and
 for Intermediate Cycle Index use parameters x=25, y=50, z=100.
Real-Time Channel Lines
  ARM: MovAvg(Close,25)
  UPPERLINE: Multiply2 ( Add2( 1, Multiply2( 2, Divide(SIGOM,100) ) ), ARM )
  LOWERLINE: Multiply2 ( Subtract( 1, Multiply2( 2, Divide(SIGOM,100) ) ), ARM )
Centered Channel Lines
  CARM: Lead( MovAvg(Close,25), 12 )
  CUPPERLINE: Multiply2 ( Add2( 1, Multiply2( 2, Divide(SIGOM,100) ) ), ARM )
  CLOWERLINE: Multiply2 ( Subtract( 1, Multiply2( 2, Divide(SIGOM,100) ) ), ARM )


To create a UCI trading system, select "New Trading Strategy ..." from the Insert menu and enter the following entry and
exit conditions in the appropriate locations of the Trading Strategy Wizard:

  Generate a buy long MARKET order if ALL of the following are true:
 CrossAbove ( YESN, LOWERLINE )
  Generate a sell long MARKET order if 1 of the following are true:
 CrossBelow ( YESN, UPPERLINE )
 A<B( Close, Subtract( EntryPrice(Trading Strategy), SIGOM ) )
  Generate a sell short MARKET order if ALL of the following are true:
 CrossBelow ( YESN, UPPERLINE )
  Generate a cover short MARKET order if 1 of the following are true:
 CrossAbove ( YESN, LOWERLINE )
 A>B( Close, Add2( EntryPrice(Trading Strategy), SIGOM ) )
FIGURE 6: NEUROSHELL, UNIVERSAL CYCLE INDEX. Here is a sample NeuroShell chart showing Stuart Belknap's universal cycle index.


If you have NeuroShell Trader Professional, you can also choose whether or not the system parameters should be optimized. After backtesting the trading strategy, use the "Detailed Analysis ..." button to view the backtest and trade-by-trade statistics for the UCI system.

--Marge Sherald, Ward Systems Group, Inc.
301 662-7950, sales@wardsystems.com
www.neuroshell.com


GO BACK


NEOTICKER: UNIVERSAL CYCLE INDEX

All cycle indicators presented in "Cycles In Time And Money" by Stuart Belknap can be implemented in NeoTicker using formula language. The Backtest EZ power indicator can quickly build the baseline systems discussed in the article that are required to generate signals.

In an effort to provide the most realistic system-backtesting environment, NeoTicker indicators do not allow forward-looking references, because in real life, events in the future will never be known until they happen.

There are a number of forward-looking references within the original MetaStock code. In order to implement these indicators in NeoTicker, any forward-looking code is translated into the style of referencing the current period.

There are six cycle indicators and two channel lines. They are all based on volatility (Sigom %), so the first step is to code this indicator. In Listing 1, two simple moving averages are required to forward-reference 12 periods. In NeoTicker, instead of using forward-looking moving averages, the current component "Close" in the original code is changed to a 12-period lookback. This change makes these two components within the formula match bar distances between them with the original logic. Final calculation results are equivalent to those based on the MetaStock code.

The remaining indicators -- the minor cycle index (period 25 bars) (Listing 2); centered minor cycle index (Listing 3); secondary cycle index (period 50 bars) (Listing 4); centered secondary cycle index (Listing 5); intermediate cycle index (period 100 bars) (Listing 6); centered intermediate cycle index (Listing 7); real-time channel lines (Listing 8); and centered channel lines (Listing 9) -- are modified with a same-period shifting algorithm whenever there is a forward-looking reference.

NeoTicker's power indicator Backtest EZ is the easiest way to build different baseline systems using different cycle period indicators.

The sample chart in Figure 7 shows a baseline system with both long and short sides. To recreate this system, first add the long signals generation formula (Listing 10) to the Long Entry field and the short signals generation formula (Listing 11) to the Short Entry field. The long signals formula returns a "1" when the minor cycle index crosses above the -50 or 50 line, and these signals will prompt long-side trades to be taken in Backtest EZ.


FIGURE 7: NEOTICKER, UNIVERSAL CYCLE INDEX. Here is a sample chart showing the minor cycle index.
Listing 1
$bcounter := $bcounter+1;
yom := 100*(c(12)-average(c, 25))/average(c, 25);
avyom := summation(yom, 50)/50;
varyom := summation(yom*yom, 50)/50-avyom*avyom;
som := sqrt(varyom(12));
plot1 := average (som, 25);
success1 := if ($bcounter > 25, 1, 0);
Listing 2
yme   := 100*(qc_xaverage(c, 6)-qc_xaverage(c, 12))/
         qc_xaverage(c, 12);
ymes  := tsf(yme, 6, 0);
plot1 := 100*ymes/sigom(data1);
plot2 := 50;
plot3 := -50;
Listing 3
ym := (average (6, c, 12)-average (c, 25))/average (c, 25);
plot1 := 100*ym/sigom (12, data1);
Listing 4
yse := 100*(qc_xaverage (c, 12)-qc_xaverage (c, 25))/
qc_xaverage (c, 25);
yses := tsf(yse, 6, 0);
plot1 := 100*yses/sigom(data1);
plot2 := 100;
plot3 := -100;
Listing 5
ys := 100*(average (13, c, 25)-average (c, 50))/
      average(c, 50);
plot1 := 100*ys/sigom (25, data1);
Listing 6
yie := 100*(qc_xaverage(c, 25)- qc_xaverage (c, 50))/
       qc_xaverage (c, 50);
yies := tsf (yie, 6, 0);
plot1 := 100*yies/sigom(data1);
plot2 := 150;
plot3 := -150;
Listing 7
yi := 100*(average (25, c, 50)- average ( c, 100))/
      average (c, 100);
plot1 := 100*yi/sigom (50, data1);
Listing 8
plot1 := average (c, 25);
plot2 := (1+2.0*sigom(data1)/100)*plot1;
plot3 := (1-2.0*sigom(data1)/100)*plot1;
Listing 9
plot1 := average (c, 25);
plot2 := (1+2*sigom(12, data1)/100)*plot1;
plot3 := (1-2*sigom(12, data1)/100)*plot1;
Listing 10
xaboveconst (minorcycleidx (data1), 50) > 0 or
xaboveconst (minorcycleidx (data1), -50) > 0
Listing 11
xbelowconst (minorcycleidx (data1), 50) > 0 or
xbelowconst (minorcycleidx (data1), -50) > 0


A downloadable version of the NeoTicker group file containing a sample baseline system and source code files for the indicator will be available from the NeoTicker Yahoo! User Group website.

--Kenneth Yuen, TickQuest Inc.
www.tickquest.com
GO BACK

AIQ: UNIVERSAL CYCLE INDEX

This AIQ code implements the universal cycle index described in "Cycles In Time And Money" by Stuart Belknap. Figure 8 shows the indicator applied to a trending period, and Figure 9 shows it applied to a consolidating market.


FIGURE 8: AIQ SYSTEMS, UNIVERSAL CYCLE INDEX. Here's an example of the UCI applied to VeriSign on the period from March to July 2003, which was a trending market until June.


FIGURE 9: AIQ SYSTEMS, UNIVERSAL CYCLE INDEX. Here's an example of the UCI applied to VeriSign on the period from June to October 2003, which was a consolidating market.

!UNIVERSAL CYCLE INDEX
!Author: Stuart Belknap, Cycles in Time and Money
!Coded by: Richard Denning 3/14/05
C is [close].
EMA6 is expavg(C,6).
EMA12 is expavg(C,12).
EMA25 is expavg(C,25).
EMA50 is expavg(C,50).
MA12 is simpleavg(C,12).
MA25 is simpleavg(C,25).
MA50 is simpleavg(C,50).
MA100 is simpleavg(C,100).
!VOLATILITY (SIGOM)
yom  is 100*(valresult(C,12) - MA25) / MA25.
avyom is sum(yom,50) / 50.
varyom is sum(yom * yom,50) / 50 - avyom * avyom.
som  is valresult(sqrt(varyom),12).
sigom is simpleavg(som,25).
!MINOR CYCLE INDEX (25 BARS)
yme is 100 * (EMA6 - EMA12) / EMA12.
ymes is yme + 6 * slope2(yme,6).    !TSF(yme,6).
ymesn is 100 * ymes / sigom.
!Plot "ymesn" as three line indicator with lines at -50 & 50.
!CENTERED MINOR CYCLE INDEX
ym is 100 * (valresult(MA12,6) - valresult(MA25,12))
  / valresult(MA25,12).
ymn is 100 * ym / sigom.
!SECONDARY CYCLE INDEX (50 BARS)
yse is 100 * (EMA12 - EMA25) / EMA25.
yses is yse + 6 * slope2(yse,6).   !TSF(yse,6).
ysesn is 100 * yses / sigom.
!Plot "ysesn" as three line indicator with lines at -100 & 100.
!CENTERED SECONDARY CYCLE INDEX
ys is 100 * (valresult(MA25,12-12) - valresult(MA50,25-12))
  / valresult(MA50,25-12).
ysn is 100 * ys / sigom.
!INTERMEDIALTE CYCLE INDEX (100 BARS)
yie is 100 * (EMA25 - EMA50) / EMA50.
yies is yie + 6 * slope2(yie,6). !TSF(yie,6).
yiesn is 100 * yies / sigom.
!Plot "yiesn" as three line indicator with lines at -150 & 150.
!CENTERED INTERMEDIATE CYCLE INDEX
yi is 100 * (valresult(MA50,25-25) - valresult(MA100,50-25))
  / valresult(MA100,50-25).
yin is 100 * yi / sigom.
!REAL TIME CHANNEL LINES
upRT is (1 + 2 * sigom / 100) * MA25.
dnRT is (1 - 2 * sigom / 100) * MA25.
!CENTERED CHANNEL LINES
upCCL is (1 + 2 * sigom / 100) * valresult(MA25,12).
dnCCL is (1 - 2 * sigom / 100) * valresult(MA25,12).
--Richard Denning
www.aiq.com


GO BACK


ASPEN GRAPHICS: UNIVERSAL CYCLE INDEX

In Stuart Belknap's article, "Cycles In Time And Money," utilizing scalable cycle indicators derived from oscillators is explored using a variety of methods. All of the formula examples illustrated in the article are easily translated into the Aspen 4.0 Formula Writer.

We have translated all of Belknap's formula variables and one of his indicators. For further information and assistance regarding the other studies outlined in Belknap's article, please contact Aspen Research Group Technical Support at 970 945-2921.

The following variables are translated from Belknap's article into the Aspen 4.0 Formula Writer.

Yom_=100*($1-savg($1,25)[-12])/savg($1,25)[-12]
AvYom_=sum(Yom_($1),50)/50
VarYom_=sum(Yom_($1)*Yom_($1),50)/50-AvYom_($1)*AvYom_($1)
Som_=Sqrt(VarYom_)[-12]
Sigom_=savg(Som_($1),25)
The following formula applies a six-period smoothing to the %K line of the fast stochastic:
UCI_K(series,K_Period=12,UCI_Period=6)=savg(fstoch
($1,K_Period),UCI_Period)


This formula applies a six-period smoothing to the %D line of the fast stochastic:

UCI_D(series,K_Period=12,D_Smooth=3,UCI_Period=6)=savg
(sstoch($1,K_Period,D_Smooth),UCI_Period)


Apply both of these studies in the same split window on a chart to give you the smoothing on both the %K and the %D lines.

These stochastic oscillators use a six-period simple moving average applied to a 12-period fast stochastic to achieve a normalized and scalable indicator. We have included a period parameter and a smoothing parameter that can be manually modified after the study has been applied to the chart. A sample chart is shown in Figure 10.

FIGURE 10: ASPEN GRAPHICS, UNIVERSAL CYCLE INDEX. Here's a sample Aspen Graphics chart displaying the UCI.
--Aspen Research Group
support@aspenres.com
www.aspenres.com
GO BACK

All rights reserved. © Copyright 2005, Technical Analysis, Inc.


Return to May 2005 Contents