I think i know what the problem is.
Surely is the typo, which is the minus sign, and I have corrected it right at the beginning.
The problem could be the fact that I don't have this code
Because I take the OnCalculate function and put it into my code and it gave me the error of not found in custom indicator
I am coding the following, the code returns no error but doesn't seem to do the calculation.
I tried to debug it by adding the following alert, it doesn't run. However, if I change the WVAD = Top or Bottom, it runs.
The code just doesn't do the division. Why?