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

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



PureBytes Links

Trading Reference Links


I'd like to code the TCF presented in this issue and need to sum the 
gains on positive days for the last 35 days, and the same for the 
negative days out of the last 35 days.

I tried the following code for the positive days, but system 
indicates I have created endless do loop......... can someone offer 
a suggestion.  Thank you so much.....  Mike

for( i = 0; i < 35; i++)
{ 
      TP = IIf ( i=0, 0, IIf(Ref(C,-i)>Ref(C,-(i+1)), Ref(C,-i)-Ref
(C,-(i+1)),0));

}

Plot (TP,"TP",colorWhite,styleHistogram);







------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/