I've found apparently two important issues, which make my backtesting's results simply non-reliable, and don't know how to address them correctly. Before problem description, I work with NT version 7.0.1000.27.
I work with EURUSD, which goes in half-ticks ( 0.00005 ), generally in range bars charts. Here the 2 issues:
1. The result of simply operations like for example this: 2*Close[0]-Median[0]-Open[0] gives a number which is not in the exact format of half-pips , fix 5 digits after decimal point,BUT a number until 16 digits after decimal point, which it shouldn't be with this simply math. It seems the typical floating point problem, SO, in order to address it, I tried to use Math.Round(x,n) BUT then I came across with the other issue
2. When I use Math.Round(x,16) ( until 16 digits after decimal point ) , then an error pops out when I run the backtesting:
Error on calling 'OnBarUpdate' method for strategy 'STSdiffOriginal/daa2d411202e4d5cbde915766cd814c9': You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 Which is non-sense, because this Method has nothing to do with this message, besides my barsrequired are by far longer than used in the Algo.
I've done several trials with and without Math.Round, with different digits, and the backesting results are just chaotic, not even close.
I'd like you to address this problem, cause I can't work it out by my own.
Looking forward for your help, thanks
Comment