Trend Continuation Factor by M.H. Pee

Description

In "Trend Continuation Factor" in this issue, M.H. Pee includes the code for a spreadsheet implementation of the TCF indicator and trading strategy. Here, we present the TradeStation EasyLanguage code for the TCF trading strategy. The strategy can easily be converted into a TradeStation indicator by replacing the buy/sell statements with plot statements as follows:

Type : Strategy, Name : Trend Cont Factor
inputs:
Length( 35 ) ;
variables:
Change( 0 ),
PlusChange( 0 ),
MinusChange( 0 ),
PlusCF( 0 ),
MinusCF( 0 ),
PlusTCF( 0 ),
MinusTCF( 0 ) ;
Change = Close - Close[1] ;
PlusChange = iff( Change > 0, Change, 0 ) ;
MinusChange = iff( Change < 0, -Change, 0 ) ;
PlusCF = iff( PlusChange = 0, 0, PlusChange + PlusCF[1] ) ;
MinusCF = iff( MinusChange = 0, 0, MinusChange + MinusCF[1] ) ;
PlusTCF = Summation( PlusChange - MinusCF, Length ) ;
MinusTCF = Summation( MinusChange - PlusCF, Length ) ;
if PlusTCF > 0 then
Buy next bar at market
else if MinusTCF > 0 then
Sell next bar at market ;

Download

Author/Source

http://www.traders.com
No votes yet