Where is iStdDevOnArray on mt5?
not sure if there's something like that somewhere in the standard library, but either way you might be looking for something like:
double ArrayStdDev(double &arr[]) { int elements=ArraySize(arr); double mean=0; for (int i=0;i<elements;i++){mean+=arr[i];} mean/=elements; double mdev2sum=0; for (int i=0;i<elements;i++){mdev2sum+=pow(arr[i]-mean,2);} return sqrt(mdev2sum/elements); }
(I just quickly wrote this down; not tested)
Instead of price, pass a handle as parameter.
int OnInit() { //--- indicator buffers mapping SetIndexBuffer(0,StdDevBuffer,INDICATOR_DATA); SetIndexBuffer(1,RSIBuffer,INDICATOR_CALCULATIONS); //--- if((handleRSI=iRSI(_Symbol,_Period,RSIPeriod,RSIPrice))==INVALID_HANDLE || (handleStdDev=iStdDev(_Symbol,_Period,StdDevPeriod,0,MODE_SMA,handleRSI))==INVALID_HANDLE) return(INIT_FAILED); //--- return(INIT_SUCCEEDED); }
Where did you hear that MT4 will be dying soon?
I don't believe that Metaquotes have made any announcement.
Where did you hear that MT4 will be dying soon?
I don't believe that Metaquotes have made any announcement.