1.
FAQ: I'm trying to divide two numbers and the result is zero.2. Next, another issue is incomplete initialization:
CODE:
Please log in to see this code.
Could be:
CODE:
Please log in to see this code.
3. Big performance hit is coming from this line:
CODE:
Please log in to see this code.
Since VarP never changes, this should be defined as a DataSeries before the loop.
4. Finally, VarP is 0 so your script does nothing.
The complete script that doesn't work because of NumBars:
CODE:
Please log in to see this code.