backtesting is slow

Created at 29 Jun 2016, 02:01
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
lec0456's avatar

lec0456

Joined 14.11.2012

backtesting is slow
29 Jun 2016, 02:01


I am backtesting a cbot and it is extremely slow.  What can I do to figure out why and improve performance?


@lec0456
Replies

moneybiz
29 Jun 2016, 11:59

RE:

lec0456 said:

I am backtesting a cbot and it is extremely slow.  What can I do to figure out why and improve performance?

I think it is normal if your bot works with tick data. It means on every tick received all bot logic is reprocessed. Sometimes there are 5-6 ticks in a second and you bot must be able to process all the 6 ticks in 1 second. If you can't then you're losing the market information.
Better do some benchmarking to see where the code performs poorly. See here.

If you are for example enumerating positions many times to calculate different data try to calculate them inside a single loop. Try to optimize the code.
I also use tick data for botting and yes it's really slow, that's why i test 1 week - 10 days max. It gives me a general idea how the forward performance will be.
There is nothing much to tell than optimize.


@moneybiz