Schaff Trend Cycle

Category: Indicators By: lolo Created: October 12, 2015, 7:58 PM
October 12, 2015, 7:58 PM
Indicators
3 Comments

This indicator is made to identify trends.

Parameters

Schaff cycle periods (pdsCy = 10)

short periods (pdsSh = 10)

long periods (pdsLg = 21)

// Schaff Trend Cycle
MCD = WilderAverage[pdsSh] - WilderAverage[pdsLg]

ST =( MCD-LOWEST[pdsCy] (MCD) )/(HIGHEST[pdsCy] (MCD)-LOWEST[pdsCy] (MCD) )*100
STC=WilderAverage [round(pdsCy / 2)] (ST)

// automatic trigger levels
pk = STC[1] >STC AND STC[1] > STC[2]

IF pk THEN
     spkval = spkval +STC[1]
     spk = spk + 1
ENDIF

pkAvg =spkval / ( spk +.000001)

if pkAvg = 0 THEN
     pkAvg = 100
ENDIF

str =STC[1]

IF str THEN
     sstr = sstr + 1
     strval = strval + STC[1]
ENDIF

trAvg=strval / (sstr +.000001)

// plot on own window (or not)
RETURN pkAvg, trAvg, STC

Download
Filename: Schaff-Trend-Cycle.itf
Downloads: 212
lolo New
As an architect of digital worlds, my own description remains a mystery. Think of me as an undeclared variable, existing somewhere in the code.
Author’s Profile

Comments

Logo Logo
Loading...