Error: vctReturns is not a Class, Struct or Union

 

Please update me why I am getting these error :

'vctReturns' is not a class, struct or union    CMomentum.mqh   48      21
'Std' - undeclared identifier   CMomentum.mqh   48      33
'Std' - some operator expected  CMomentum.mqh   48      33
'(' - semicolon expected        CMomentum.mqh   48      36
')' - expression expected       CMomentum.mqh   48      37
5 errors, 0 warnings            6       1

the code where I got this error is as below:

double CMomentum::methodSDR(string pSymbol,ENUM_TIMEFRAMES pTimeFrame,int pIdx,int pSDPeriod=21) {

        vector  vctReturns = vector::Zeros(pSDPeriod+1);
        int start = (pIdx == 0) ? 1 : pIdx;                                                         // Index[0] will not be calculated
        int stop  = pSDPeriod + start;
        int count = 0;
        for(int i = start; i < stop && !IsStopped(); i++) {
        	vctReturns[count] = ((iOpen(pSymbol,pTimeFrame,i) - iClose(pSymbol,pTimeFrame,1+i)) / iClose(pSymbol,pTimeFrame,1+i)) * 100;
                count++;
        }
        double sdReturn = vctReturns::Std();
        return(sdReturn*100);

} // END of method methodSDR()

Thanks in advance and happy weekend.

 
        double sdReturn = vctReturns.Std();
 
Alain Verleyen #:

Hi Alain

Thanks for the pointer to the error :)