Backtest wrong results in hourly
Forums › ProRealTime English forum › ProOrder support › Backtest wrong results in hourly
- This topic has 23 replies, 4 voices, and was last updated 5 years ago by GL48.
-
-
10/01/2019 at 1:43 PM #10898410/02/2019 at 6:57 AM #10903210/02/2019 at 8:37 AM #109038
Of course, here are the precisions
I have a problem with my system tradings which in backtesting gives very different results, these are programs that are also in pro order autotrading, and the operations are not the same anymore. To verify, I copied the version of paper trading to test it in backtesting and the results are different from those that this version has given in pro order for 8 months.
By observing the backtest of the models with the graph function on the conditions, I realized that the conditions on the indicators are activated in a wrong way.
On the other hand, the transactions recorded in pro order , are in perfect correspondence with the situation requested on these indicators.
In the backtests, I encounter this problem of conditions that are activated or not activated incorrectly, on all models, with data 1 hour.I created indicators showing the signal conditions of a trading system. I have run different timeframes on this trading system, I found that there is not always correspondence between the conditions of signals internal trading system and external indicators, for timeframes in hours full 1h, 2h, 3h …, 60min, 120 min, 180 min …
But, there is always perfect match for all other timeframes; tick, sec, (min off full time 15, 30, 90min … ), daily.
That’s my problem, where can these errors come from, only for the backtests corresponding to the hours?
Many thanks for your help
10/02/2019 at 9:14 AM #109046Hi GL48
What maybe you are confused about is that this website is the not the provider of the PRT Platform … don’t worry a few get confused in a similar way.
All you need to do is raise a Technical Report (press Ctrl+M) then refer to your post above (link as below) as you have provided all the details in the post above.
Hope that makes sense, if not just say.
https://www.prorealcode.com/topic/backtest-wrong-results-in-hourly/#post-109038
1 user thanked author for this post.
10/02/2019 at 9:23 AM #10904710/02/2019 at 9:35 AM #10905210/02/2019 at 9:48 AM #10905410/02/2019 at 12:19 PM #109078Here are the screenshoots,
For simplicity, I created a simple trading system and the external indicator corresponding to the same signal condition.
I compare with the internal signal condition in backtest by the graph function.There are several errors in hourly, and no errors in 30 minutes.
As a control, I replaced in this trading system, the signal condition by its equivalent external indicator, and that does not change anything.10/02/2019 at 12:31 PM #109082Are you referring to differences … one example as shown at the red arrowheads on attached?
I feel we are the point where we need to see the code of the External Indicator (as you call it).
Please post code using the blue Insert PRT button on the toolbar above each new message.
If anybody can see / understand the Issue better than me then by all means step in and help out!? 🙂
10/02/2019 at 12:42 PM #109085Did you try to graph the average on the price in the backtest, to see if they match with the indicator’s ones?
12graphonprice indicator101graphonprice indicator111If they don’t match, try to add this at the beginning of the code, to see if that makes a difference or not:
1defparam preloadbars=01 user thanked author for this post.
10/02/2019 at 2:08 PM #109094Hi Graham,
Yes these are the differences, which should not exist because the external indicator is the exact replication of the internal indicators in the trading system. In the trading system, there is a crossover of moving averages, and in the external indicator, the same crossover of moving averages.
Trading system12345678910111213DEFPARAM CumulateOrders = False // Cumulating positions deactivated// Conditions to enter long positionsindicator101=average[25,1]indicator111=average[50,0]c101=indicator101 >= indicator111IF c101 THENbuy 10000 CASH AT MARKETENDIFgraph(c101)// Conditions to exit long positionsIF not c101 THENsell AT MARKETENDIFexternal condition indicator12345678910indicator101=average[25,1]indicator111=average[50,0]signal=indicator101 >= indicator111if signal=1 thenvalue=1elsevalue=0endifreturn value as "value"1 user thanked author for this post.
10/02/2019 at 3:14 PM #109108Hi Nicolas,
Thank you for your help,
graphonprice indicator101 and graphonprice indicator111 shows that the values of moving averages calculated in 1H backtest are not equal to their values on the graph, (MA on graph and external indicator are similar).
Hence the 1 H backtest signals that did not match.On the other hand, the values of the moving averages calculated in the 30-minute backtest are equal to their values on the graph, (MA on graph and external indicator are similar).
Hence, backtest signals that match.I added the daily to be sure, with the same result, it is correct.
I tried to include at the beginning of the trading system, defparam preloadbars = 0, it had no effect.
The result is very surprising for the 1 H backtest,
10/02/2019 at 4:52 PM #109117Indicator and System are aligned exactly.
Try yours again using Buy 1 Contract instead of 10000 Cash. I know it doesn’t sound logical but you have to try anything / something and I had to anyway as attached is on my SB Account.
What Market are you using … I’ll go and check your attachments and try on same market as you.
10/02/2019 at 4:56 PM #10911910/02/2019 at 5:06 PM #109121 -
AuthorPosts
Find exclusive trading pro-tools on