-1

I tried to use different maType while calling addCCI to make the analysis more accurate. However, when I tried to use maType = "DEMA" or maType = "HMA", quantmod gave me error like:

addCCI(maType = "DEMA")
Error in runMAD(HLC, n, center = mavg, stat = "mean") : 
  NA/NaN/Inf in foreign function call (arg 2)

addCCI(maType = "HMA")
Error in runMAD(HLC, n, center = mavg, stat = "mean") : 
  NA/NaN/Inf in foreign function call (arg 2)

Also, for maType=ALMA and maType=ZLEMA, quantmod asked me for more input

  addCCI(maType = ALMA")
+ 
+ 

> addCCI(maType = ZLEMA")
+ )
+ ;
+ 
+ 

I got really confused. Can someone explain it to me please.

I feel that DEMA is more accurate than EMA, can you give me a solution so I can apply DEMA to addCCI?

Joshua Ulrich
  • 173,410
  • 32
  • 338
  • 418
Hao Wang
  • 11
  • 1

1 Answers1

0

The first issue looks like a bug in TTR::runMAD, and I'm not sure of a work-around. I've opened an issue.

The second issue is because you have unmatched quotes. addCCI(maType = ALMA") should be addCCI(maType = "ALMA").

Joshua Ulrich
  • 173,410
  • 32
  • 338
  • 418