[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Help with Trend Continuation Factor from S&C Bonus Issue



PureBytes Links

Trading Reference Links

The code below runs, but does not correctly calculate the sum of the up days up movemet or down days down movement (close to close) for the last 35 days.  The code generates the same magnitude equal and opposite signals.  The indicator should generate signals that are either both negative (no trend) or one positive according to the author.

Can anyone help me figure out what I've overlooked.  The article is in the recent bonus edition of S&C.

Thank you,

Mike

 

 // "TCF" Trend Continuation Factor

 

// Calculate TCF Up

for( i = 0; i < 35; i++);

{

TUp = IIf ( i=0, 0, IIf(Ref(C,-i)>Ref(C,-(i+1)), Ref(C,-i)-Ref(C,-(i+1)), 0));

}

// Calculate TCF Down

for( i = 0; i < 35; i++);

{

TDn = IIf ( i=0, 0, IIf(Ref(C,-i)<Ref(C,-(i+1)), (Ref(C,-(i+1))-Ref(C,-i)),0));

}

 

TCF=TUp-TDn;

TCFD=TDn-TUp;

Plot(TCF,"TCF",colorBrightGreen, styleHistogram);

Plot(TCFD,"TCFD",colorRed, styleHistogram);



Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links