double CiPivots::GetIndexPivots(int pBuffer,int pIndex) { string vMethod = "[" + mSymbol + "," + EnumToString(mPivotTimeFrame) + "] " + __FUNCTION__; double arrayData[1]; // LOCAL STATIC BUFFER TO RETURN SINGLE INDEX VALUE if(CopyBuffer(mHandlePivots,pBuffer,pIndex,1,arrayData) == -1) { ResetLastError(); PrintFormat("%s: Error[#%i] getting iPivots for _buffer[#%i] value at Index[%i]",vMethod,GetLastError(),pBuffer,pIndex); return(0.00); } return(NormalizeDouble(arrayData[0],mDigits)); } // END Of method GetIndexPivots()
You are resetting error code to zero before printing.
Use code styler or manually fix indentation and it will be easier to spot potential problems.
Drazen Penic #:
You are resetting error code to zero before printing.
Use code styler or manually fix indentation and it will be easier to spot potential problems.
Thanks a lot @Drazen Penic
It was really a silly mistake by me.
I have moved ResetLastError() above if(CopyBuffer) and get the error code now.
Ragards
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi
I have created an indicator class and when run it on a testing EA, following methods returns correct values:
However when I am using it in an another class it keeps returning error 0. I have checked there is no error of indicator handle (INVALID_HANDLE)
Any clues how can I find out what is going wrong!!!
Thanks in advance.