Rajandran R Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

Coppock, Nifty and the AFL code

52 sec read


 

Here is the Formulas to calculate the coppock indicator extracted from incredible charts

To calculate the Coppock Value:

1)Calculate 14 month Rate of Change (Price) for the index. Use monthly closing price.
2)Calculate 11 month Rate of Change (Price) for the index. Use monthly closing price.
3)Add the results of 1 and 2.
4)Calculate a 10 month weighted moving average of the result.

There are a number of variations in calculation. For a more timely signal, try substituting the daily equivalent in place of monthly figures: 294 day ROC, 231 day ROC and 210 day weighted moving averages. Based on these formula i had coded for the coppock
value using 294,231,210 ROC values which suits for the daily time frame. Here is the simple coppock AFL code

For Daily time frame, Coppock can be calculated as

1)Calculate 294 day Rate of Change (Price) for the index. Use Daily closing price.
2)Calculate 231 day Rate of Change (Price) for the index. Use Daily closing price.
3)Add the results of 1 and 2.
4)Calculate a 210 day weighted moving average of the result.

Coppock AFL Code

_SECTION_BEGIN(“Coppock”);

GraphXSpace=1;
Param(“WMA”,210,2,100,1,0);
r1=ROC(C,294);
r2=ROC(C,231);
r3=r1+r2;
CP=WMA(r3,210);

Color = IIf (CP >0, colorGreen, colorRed );
Plot(CP,””, Color ,styleHistogram | styleThick );
Plot(CP, StrFormat(“Coppock Value”, CP), colorGreen, styleLine);

_SECTION_END();

Nifty Coppock had turned to positive during the end of OCT 2009. Check the above historical Nifty chart for Coppock values

Here is an interesting reading about Coppock Indicator and its history from DNA India

Rajandran R Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

Algomojo Index Straddle/Strangle Execution Module with Intraday Stoploss

This tutorial focus on how to automate your index straddle/strangle strategy with intraday stop-loss levels with time-based entry and exits using Algomojo Platform and...
Rajandran R
7 min read

Learn How to Login into Algomojo Account using Amibroker

In the last tutorial, we learn how to automate the algomojo login process and in this video tutorial, we are going to learn with...
Rajandran R
1 min read

Amibroker Execution Module – Hedged Index Futures for Directional…

In the last tutorial, we learn the importance of Hedging Futures Position with OTM Options for Reduced Margin. This tutorial focus on how to...
Rajandran R
14 min read

2 Replies to “Coppock, Nifty and the AFL code”

  1. HI Thanks for the AFL for coppock. Appreciate the same and efforts by you. Also can you suggest how to correct the splits in Amibroker data. I have downloaded your amibroker data(35Mb) and than updated it from Live nifty data as you suggested. Now the companies like reliace have gone split go the charts are ditorted. Please suggest.

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More