Does the back-tester only calculate from whole numbers?
Forums › ProRealTime English forum › ProBuilder support › Does the back-tester only calculate from whole numbers?
- This topic has 5 replies, 3 voices, and was last updated 5 years ago by
robertogozzi.
-
-
11/23/2019 at 10:42 PM #113489
Hi All,
I am getting some what I would call anomalies within the backtesting strategy creator, and I was wondering if anyone could help?
The strategy I’m looking at is just a simple crossover system using a custom indicator that I have made. So if X > Y then long, Y > X then short. Always in.
However, when I run the backtest, very occasionally, the indicator crosses it’s MA (very slightly) and the on the next bar crosses immediately back – but the back-tester does not register this as a cross?
So my question is: Does the backtesting program work to a certain number of decimal places to the right or just whole numbers? For example; the indicator is calculating to 5 decimal places, but the crosses only seem to register within the program when the cross magnitude is greater than 1.
Can anyone please help clear this up for me?
Many Thanks as always.
Ross
11/26/2019 at 10:39 PM #11367211/26/2019 at 11:41 PM #113678This simple indicator will test whether tiny value crosses are recognised:
12345678910111213if barindex = 0 thena = -0.0000000001endifif barindex = 1 thena = 0.0000000001endifif a crosses over 0 thenflag = 1endifreturn flag…..and they are as flag returns a value of 1. But when I code something similar as a dummy strategy at ten decimal places the cross is not recognised and flag = 0. Below ten decimal places flag = 1 and the cross is recognised.
123456789101112131415if barindex = 0 thena = -0.0000000001endifif barindex = 1 thena = 0.0000000001endifif a crosses over 0 thenflag = 1endifbuy at -close limitgraph flag11/26/2019 at 11:42 PM #113679It depends on what you used as a term to identify a CROSSOVER, if you write:
1IF close CROSSES OVER MyMA THENis because you want CLOSE to cross over. If HIGH does, but CLOSE doesn’t, then it’s not a crossover (the reverse for LOW), which, instead, would be true if you had written:
1IF high CROSSES OVER MyMA THENAs for decimals, I never happened to check that, but I think it uses ALL decimal places you see on your chart.
11/26/2019 at 11:45 PM #113680As for decimals, I never happened to check that, but I think it uses ALL decimal places you see on your chart.
I assumed the same until I ran the test in my post just before yours. It seems that the ProOrder engine does not recognise the same cross overs that the ProBuilder engine does.
11/27/2019 at 12:08 AM #113682Data showed on the chart seems to consider only 5 decimals.
-
AuthorPosts
Find exclusive trading pro-tools on 