Home » Amibroker, Nifty Technicals, coppock

Coppock, Nifty and the AFL code

5 December 2009 352 views No Comment

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

Related Readings and Observations

  • 52 Week High and Low Stock Scanner – AFL Code
    Here is a simple afl code which scans for 52 week High and Low from the list of available EOD stocks database and list them in Amibroker Software...
  • Start Scanning Stocks using Amibroker Exploration
    Now all you need to do is you have to find the list of stocks that had recently made 5/20 EMA crossover from the bunch of NSE Stock pack and also you have to scan the stocks with price value greater than Rs50. And also print the values of 5EMA and 2...
  • GANN Level Plotter for Nifty
    GANN Level Plotter INDICATOR PLOTS FOR ANY STOCK AND WORKS FINE FOR LIQUID CONTRACTS AND STOCKS. THE LEVELS ARE NOT FOR TRADING, BUT FOR REFERENCE SO THAT ENTRY AND EXIT WILL BE SMOOTH....
  • Profit Table – Amibroker AFL Code
    Here is an another interesting afl code which plots the Profit table for any sort of Instruments in Amibroker. Month-on-Month , Year-on-Year, Average monthly returns in terms of percentage can be plotted using this afl code. Sample AFL code for Nift...
  • 70/1030 EMA AFL code for Amibroker
    Here is a simple logic how to plot 70min/ 1030min EMA in your amiboker software. 70/1030 EMA crossover is a popular strategy witht the yahoo 5min charts. And if your tried with amibroker with the same 70min and 1030 min you would probably end with th...

Written by: Rajandran R

diggdelicious-buttonstumbleuponTechnoratiFacebookNewsvineRedditYahoo
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

No Comment »

  • Ankush said:

    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.

  • Rajandran Rajarathinam said:

    @AnkushDone

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.

Optionally add an image (JPEG only)