Computer performance for backtesting
Forums › ProRealTime English forum › ProRealTime platform support › Computer performance for backtesting
- This topic has 10 replies, 4 voices, and was last updated 7 years ago by Leo.
-
-
12/13/2016 at 10:32 AM #18432
Hi guys
What computer do you guys suggest to get if you want to do back testing? At the time being I use a Mac laptop, but it takes for ever to run large back tests.
I am really not a computer wiz so any suggesting is appreciated!!
/Yngve
12/13/2016 at 10:55 AM #18433Unless I am mistaken, backtesting is done on PRT servers, so even with a very powerful computer, a large backtest remains a large backtest that takes a long time…
Optimising your backtests codes might be a first step so that they run faster on PRT servers. Common tips are: reduce the amount of loops (for to next, while do wend…), avoid as much as possible the CALL function and instead type the piece of code of the called code inside the backtest code itself, if a calculation is done several times, store it in a variable ( a= b*c) because the code will be faster looking for value of a each time it’s needed than calculating b*c… group the conditions for “if then else endif” statements whenever possible rather than writing tons of if statement with just one condition each…
That’s just from the top of my head but it feels like there’s a couple of other tips making codes run faster in PRT. Maybe a “search” within PRC would make other topics about it come up with more tips.
A more powerful computer would mostly improve how many windows and indicators and probuilder codes you can run simultaneously, but I’m really not that sure it would help as much as you’d like for large backtest. Maybe Nicolas could bring another point of view here.
12/13/2016 at 11:45 AM #18440My backtests are loads slower over the last several days. I thought it was due to ‘poor code’ Nooby mentions above, but maybe PRT have been throttling back on their servers?
Maybe we need an ‘teach-in article’ re good coding practice in relation to slow Backtests?
So to avoid the CALL function do we dump the Indicator code at the bottom of the AutoBot (?) then what?? Do we still use the CALL function? Any possibility of doing a ‘worked example’ Nooby please? Bot with CALL and same Bot without CALL.
Many Thanks
GraHal12/13/2016 at 12:13 PM #18443In the manual “Trading systems probacktest/proorder” https://www.prorealtime.com/en/pdf/probacktest.pdf?c1465474991c
pages 23 to 26 are a “must read” in full on the subject of code optimisation.
Page 23-24 for variable optimisation
Page 24 for reducing number of same CALL’s when one would be enough
Page 25 is at the same time a great example and a very simple example of how to get rid of a CALL to a code using itself another CALL, for in the end having no CALL at all and saving a lot of time. It’s probably the bext example “with call” and “without call” you could find.
Page 26 has examples of “if then endif” optimisation and when could a “for to next” loop be replaced by another way of coding costing less computational time
1 user thanked author for this post.
12/13/2016 at 2:10 PM #18455Thanks for all the replies, I have been running a back test all day now and it’s still not finishes. Started it around 8 am now its 2pm, is this normal?
I think I’m pretty close to max allowed parameters.
1 user thanked author for this post.
12/13/2016 at 2:13 PM #1845612/14/2016 at 12:01 AM #18493Ha … I was reading too much into it … I often don’t get jokes for the same reason! 🙂
When calling ‘Personal Indicators’ using CALL … I thought something special is involved compared to PRT Indicators.
I just converted the ‘PRC_VolatilityQualityZeroline’ off here … was 4 Calls, now 1, easy 🙂
Many Thanks Noob
GraHal12/14/2016 at 11:37 AM #18513It occured to me in bed (getting worried now, thinking about coding in bed!) I’d swung the other way and over simplified by replacing 4 CALLS with 1. Overall the BOT was probably still calling 4 times??
In slower time I perused Noobs post / Ref to the Manual and then read Page 25 … I then realised that to avoid any CALLs at all I need to insert the Indicator code inside the backtest code itself.
It turned out to be not ‘quite so easy’ (few minutes) due to the position to name the Indicator Code as ‘MyVol’ in the Bot Code (due to loads of variables). In this example (PRC VolatilityQZero) I had to insert ‘MyVol = sumVqi’ at the end of the Indicator Code (not at the start … as shown on Page 25).
Hope above makes sense (just say if not) and is useful to others reading this.
As I’ve always found … I learned more by making mistakes than by getting it right first time.
GraHal
06/18/2017 at 8:55 PM #3857106/19/2017 at 11:23 AM #3858810/25/2017 at 11:40 AM #50466 -
AuthorPosts
Find exclusive trading pro-tools on