Precision on MACD and indicators in general
Author: thetraderman
Creation Date: 7/19/2011 8:35 AM
profile picture

thetraderman

#1
I noticed that when I use the MACD values it rounds to 2 digits even though I modified the indicator precison to 4 decimal places in the preference tab. In other words it shows 4 decimal places when I put the mouse at a specified point on the MACD line but it appears that when I use the value itself in my calculation it uses 2 digits. Am I doing something wrong or that is just the way it works? I was hoping I can can use more than 2 digits since MACD moves slowly and the extra digits makes a difference.

Thanks.
profile picture

thetraderman

#2
I actually printed out the results and it seems to go way out in precision so it appears there must be something else going on. Sorry for the confusion.
profile picture

Cone

#3
The digits are for display only. If you're using a double type, you get full precision. A most common error, however, is to perform an integer division and assign to a double - the result is an integer assigned to a double type. Example: PrintDebug(25/10);
profile picture

Eugene

#4
QUOTE:
A most common error,

A note was even added to the Wiki FAQ: I'm trying to divide two numbers and the result is zero.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).