Can someone please point out what I'm doing wrong calculating CCI?
This is CCI(15) I am trying.. 15 being 15 minutes..
The formula I have is:
Where...
currTP = (High + Low + Close) / 3
TPMA is the SMA for the past 15 minutes but instead of using the lastprice, add (High+Low+Close)/3
and MD is the mean deviation.. as shown below in output as "MD"
at the final MD (.0012) it is then divided by 15 (#of periods)..
lastprice:1.2282,MD:1.0E-4
lastprice:1.2282,MD:1.0E-4
lastprice:1.2281,MD:2.0E-4
lastprice:1.2282,MD:3.0000000000000003E-4
lastprice:1.2283,MD:4.0E-4
lastprice:1.2285,MD:6.000000000000001E-4
lastprice:1.2286,MD:7.000000000000001E-4
lastprice:1.2285,MD:8.000000000000001E-4
lastprice:1.2286,MD:9.000000000000002E-4
lastprice:1.2286,MD:9.000000000000002E-4
lastprice:1.2285,MD:0.0010000000000000002
lastprice:1.2284,MD:0.0011000000000000003
lastprice:1.2284,MD:0.0011000000000000003
lastprice:1.2283,MD:0.0012000000000000003
2005-09-21 18:47:00,TP:1.2281,TPMA=1.2284,MD=1.0E-4
2005-09-21 18:47:00,CCI:-199.99999999997797
What am I doing wrong?? :<
This is CCI(15) I am trying.. 15 being 15 minutes..
The formula I have is:
Code:
CCI = (currTP - TPMA) / (.015 * (MD)
Where...
currTP = (High + Low + Close) / 3
TPMA is the SMA for the past 15 minutes but instead of using the lastprice, add (High+Low+Close)/3
and MD is the mean deviation.. as shown below in output as "MD"
at the final MD (.0012) it is then divided by 15 (#of periods)..
lastprice:1.2282,MD:1.0E-4
lastprice:1.2282,MD:1.0E-4
lastprice:1.2281,MD:2.0E-4
lastprice:1.2282,MD:3.0000000000000003E-4
lastprice:1.2283,MD:4.0E-4
lastprice:1.2285,MD:6.000000000000001E-4
lastprice:1.2286,MD:7.000000000000001E-4
lastprice:1.2285,MD:8.000000000000001E-4
lastprice:1.2286,MD:9.000000000000002E-4
lastprice:1.2286,MD:9.000000000000002E-4
lastprice:1.2285,MD:0.0010000000000000002
lastprice:1.2284,MD:0.0011000000000000003
lastprice:1.2284,MD:0.0011000000000000003
lastprice:1.2283,MD:0.0012000000000000003
2005-09-21 18:47:00,TP:1.2281,TPMA=1.2284,MD=1.0E-4
2005-09-21 18:47:00,CCI:-199.99999999997797
What am I doing wrong?? :<