The MovingAverage2
function is not Rcpp::export
ed so you cannot call it from the R side. Even though, Rcpp will not know what to do with a pointer double*
, you should directly pass it down as a NumericVector
:
// [[Rcpp::export]]
int MovingAverage2(long t, int nslow, int nfast, int d, NumericVector Prices) {
...
slow_avrg=Average(Prices, t-nslow+1-i, t-i);
}