I have to variables, wich can be plotted indivdually. But, when I try to divide them, I get nothing? Can't se why.. i'm using doubles as variables, and I've even tried to use NormalizeDouble to minimize the number of decimals if floating points is the problem. But nothing seems to work?!
Here is the code:
What I want to do, is to sum up the difference between to MA's for a number of days, then divide this with the difference of the first bar and last bar.
Anyone sees any mistakes I make?
Here is the code:
Inserted Code
while(pos>=0) { double sum=0, strength=0; for(int i=0;i<Length; i++) { sum+=NormalizeDouble(MathAbs(iMA(NULL,0,Length,i,MODE_LWMA,Close,pos) - iMA(NULL,0,Length,i,MODE_LWMA,Close,pos+1)),2); } strength = NormalizeDouble(MathAbs(iMA(NULL,0,Length,NULL,MODE_LWMA,Close,pos) - iMA(NULL,0,Length,Length,MODE_LWMA,Close,pos)),2); ExtMapBuffer1[pos] = sum; pos--; }
What I want to do, is to sum up the difference between to MA's for a number of days, then divide this with the difference of the first bar and last bar.
Anyone sees any mistakes I make?