While in bar replay mode, close(0) becomes a floating point value. This occurs only in my CME currency markets (6E, 6C, 6S).
While debugging my formula, I use debugPrint to see the value of close(0). If the chart is in real-time live market data, the value of close(0) is correct (no floating point) as in 6E of 1.4485. But if I enter Bar Replay Mode, almost every past closing value is now a floating pointing value: 1.44849999999999999.
This discrepancy affects the logic in my formula when I want to compare the closing value to a different value; if the close is equal to the open. In real-time live data, the formula works correctly - they are equal. But once in bar replay or if I refresh the data, that condition is no longer true because the close is now floating point.
Does anyone know why this happens? Is there an easy way to correct this?
Thanks
While debugging my formula, I use debugPrint to see the value of close(0). If the chart is in real-time live market data, the value of close(0) is correct (no floating point) as in 6E of 1.4485. But if I enter Bar Replay Mode, almost every past closing value is now a floating pointing value: 1.44849999999999999.
This discrepancy affects the logic in my formula when I want to compare the closing value to a different value; if the close is equal to the open. In real-time live data, the formula works correctly - they are equal. But once in bar replay or if I refresh the data, that condition is no longer true because the close is now floating point.
Does anyone know why this happens? Is there an easy way to correct this?
Thanks
Comment