PDA

View Full Version : Coppock Indicator by Edwin Coppock


NinjaTrader_Ray
01-12-2008, 11:08 AM
Here is the Coppock Indicator developed by Edwin Coppock.

To import -

- Download attached file
- Within NinjaTrader select the menu File > Utilities > Import NinjaScript
- Select the downloaded file

koganam
10-13-2008, 07:38 PM
I have taken the liberty of modifying this so that it will plot correctly on weekly or daily charts. Originally this indicator was designed, and was a correct indicator, for monthly analysis only.

See how you like it.

Comments are welcome.

anachronist
10-23-2008, 06:02 PM
Good work. Minor nitpicks though:

1. The number of trading days in a year is more like 250. Ignoring holidays is like ignoring weekends, in my opinion. Instruments like stocks are "active" over the weekends too, because news still happens. Also, not everyone trades stocks.

2. It seems that this indicator is ignoring your input parameters. ROCPeriod1, ROCPeriod2, and WMAPeriod are determined by the bar period type, so why have input parameters at all?

Looking at your code taught me some things. I wasn't sure before how to determine bar period. Thanks.
-Alex

koganam
10-23-2008, 10:51 PM
Good work. Minor nitpicks though:

1. The number of trading days in a year is more like 250. Ignoring holidays is like ignoring weekends, in my opinion. Instruments like stocks are "active" over the weekends too, because news still happens. Also, not everyone trades stocks.


Quite right. That is the point. 5 trading days per week is ignoring weekends. Hence I ignore other holidays too. I am aware that convention seems to use 250 days for a year, but a year is 52 weeks, not 50. The reasoning is explained in the file comments.


2. It seems that this indicator is ignoring your input parameters. ROCPeriod1, ROCPeriod2, and WMAPeriod are determined by the bar period type, so why have input parameters at all?


You are quite right. I had intended to put in an override, but then changed my mind when I decided that the Coppock Indicator actually never was designed for changable parameters. I left the input fields because when you run the indicator, the fields get filled in with the values used. Kind of like a feedback mechanism. I know that is actually using the fields in the reverse of the way that they were designed. Sort of an unintended consequence that I discovered.


Looking at your code taught me some things. I wasn't sure before how to determine bar period. Thanks.
-Alex

Glad that I could help.

anachronist
10-24-2008, 12:20 PM
Quite right. That is the point. 5 trading days per week is ignoring weekends. Hence I ignore other holidays too. I am aware that convention seems to use 250 days for a year, but a year is 52 weeks, not 50. The reasoning is explained in the file comments.
Um, no. Using 260 days includes holidays while excluding weekends. Yes, there are 260 weekdays in a year. About 9 of those weekdays are holidays distributed throughout the year. That leaves 251 trading days. As I said, however, it's a minor nitpick that won't make noticeable difference in your results.

-Alex

koganam
10-24-2008, 05:12 PM
Once again, you are actually right. Now why did I get confused about it? Oh well, I guess anyone reading can just adjust the code as necessary. It is a rather minor edit, so maybe I will just post a new version soon.

Thanks for pointing it out. I am always happy to be shown to be wrong, as long as I learn something from it.

koganam
11-08-2008, 04:31 PM
This one has adjustable parameters. In order to use the adjustable parameters, you must set the "user override" to true.

Otherwise it behaves just like the original Coppock Indicator, that had fixed parameters, albeit this one will plot on a daily or weekly chart.