Up.Set(Close[0]+ATR(1)[0]);
I use it on a 2 minute chart and it priduces outputs that are even with the tick, ie, 1025.00, 1025.25, 1025.50, etc.
I have another indicator which does not produce an output which is even with the tick, ie, 1025.888, 1025.092, etc. For this indicator, I enclosed the formula in Math.Round, which fixed the problem. To be consistent, I also used the Math.Round() in the above indicator incase it ever produced an uneven number that might be ignored by my strategy when placing stops. The indicator now looks like this;
Up.Set(Math.Round(Close[0]+ATR(MyInput0)[0]));
This changed the output, as if it was rounding twice. I realize I can just remove the Math.Round(), but I am trying to understand what is happening, as I'm creating a strategy to use this indicator for setting stops and don't want it to be ignored by the strategy if uneven numbers ever exist. Can anyone please explain this or offer some advice?
Thank you.
Safetrading

Comment