Why I need to compile all the time the indicator?
rodrigosm:
Hi, I was trying to normalize the ATR between the values 0 and 100. 0 - to the lowest value and 100 to the greatest.
I did the formula, but all the time, the indicator change to zero, and only the end start to move. I don' t have Idea why it’s happening. It only works when I compile it, but I need to do it all the time.
Can anyone help me.
Any help?
ATR_Normalizado[i] = (ATR[i]-ATR[ArrayMinimum(ATR)]) / (ATR[ArrayMaximum(ATR)] - ATR[ArrayMinimum(ATR)])* 100;This won't work because at the time of the call ATR[i-1] .. ATR[0] have not been calculated yet, so ArrayMin/Max don't return good values.
for(int i=limit;i>=0;i--) // Count down for one pass ATR[i]=iATR(NULL, 0, periodo_ATR, i); double min = ATR[ArrayMinimum(ATR)], max = ATR[ArrayMaximum(ATR)], rng = 100./(max-min); for(i=limit;i>=0;i--) // Count down for one pass ATR_Normalizado[i] = (ATR[i]-min) * rng;
Hi, I was trying to normalize the ATR between the values 0 and 100. 0 - to the lowest value and 100 to the greatest.
I did the formula, but all the time, the indicator change to zero, and only the end start to move. I don' t have Idea why it’s happening. It only works when I compile it, but I need to do it all the time.
Can anyone help me.