Trouble with For Loops inside Custom Function
Sarkis:
Hi
Can somebody please help me with this consistent issue i have with executing a For loop inside a function. The same code in start() works ok but when its in a custom function i always get zero values for the variables.
The functions intention is to determine when the Bollinger bands contract by checking the current StdDev MA against the Highest Std Dev MA of 12 periods ago.
Your array has a size of zero elements . . .
double Val[];. . . that is how you have declared it. Either give it a size or use ArrayResize()
Sarkis:
Thanks Heaps Raptor! Works well now.
You are welcome, thank you for editing your post :-)
Hi
Can somebody please help me with this consistent issue i have with executing a For loop inside a function. The same code in start() works ok but when its in a custom function i always get zero values for the variables.
The functions intention is to determine when the Bollinger bands contract by checking the current StdDev MA against the Highest Std Dev MA of 12 periods ago.