Coppock Curve Strategy (Amibroker And Tradestation Code)

The original article can be found here.

Amibroker code:

PROCfast = 11;//Param( "PROCfast", 11, 1, 99, 1 );
PROCslow = 14;//Param( "PROCslow", 14, 2, 100, 1 );
WMAp = 10;//Optimize( "WMAp", 10, 1, 30, 1 );

//Exclude = PROCslow <= PROCfast;

//Coppock Curve = Weighted moving average (10) of (11-month ROC + 14-month ROC)
CoppockCurve = WMA( ROC( C, PROCfast ) + ROC ( C, PROCslow ), WMAp );

BuyPrice = SellPrice = ShortPrice = CoverPrice = C;

Buy = Sell = Short = Cover = False;

Buy = Cross( CoppockCurve, 0 );
Sell = Cross( 0, CoppockCurve );

RoundLotSize = 1;

SetOption( "InitialEquity", 100000 );
SetOption( "ExtraColumnsLocation", 1 );
SetOption( "CommissionMode", 0 );
SetOption( "FuturesMode", False);
//SetOption( "CommissionAmount", 0 );
//SetPositionSize( 10000, spsValue );
SetPositionSize( 100, spsPercentOfEquity );

Plot( CoppockCurve, "CoppockCurve", colorRed );
Plot( 0, "ZeroLine", colorBlack );

TradeStation code:

{
Coppock Curve Strategy
https://www.quantifiedstrategies.com/lessons/coppock-curve-strategy-amibroker-code/
}

Inputs:
	FastLength(11),
	SlowLength(14),
	WmaLength(10);
	
Vars:
	CoppockCurve(0);

CoppockCurve = WAverage(RateOfChange(Close, FastLength) + RateOfChange(Close, SlowLength), WmaLength);

if CoppockCurve cross over 0 Then
	buy this bar at close;

if CoppockCurve cross under 0 then 
	Sell this bar at close;