Reducing backtest time somehow

Posted By: nanotir

Reducing backtest time somehow - 11/22/15 11:54

Hi

Time is money and money is time. So I guess I am lossing money just by waiting for days to get the results of my backtest.
I have i7 8GM RAM so it should be fast but the amount of parameters and so on is increasing the backtest time. I have the same strategy splitted in different algos with different parameters so I cant reduce the amount of optimization parameters or algos.

I am looking for another solution. I could rent a vps with high speed but they are quite expensive.

So I am thinking about a network in the cloud for science computations and simulations. Some kind of network where you can link to and make the calculations over there really fast. I know that for the Bosson Highs experiments everyone could join to a network so that the resources of ones computer were used to make part of the calculations necessary.
I wonder if there is such a network that everyone can join.

If it is something that can be done individually, ( if this exits of course ) then there is no problem. But if it is not the case, and the software needs some kind of "key" or "access" to do that then maybe zorro could connect to that network and the backtests would last minutes instead of hours.

Posted By: MatPed

Re: Reducing backtest time somehow - 11/22/15 23:30

You can use all the core of yout i7 to speed uo the process, but only if you have purchased Zorro, I guess

Ciao
Posted By: nanotir

Re: Reducing backtest time somehow - 11/23/15 00:58

I know I can use all the CPUs of my computer. Thats not the point.
Maybe I forgot to remark it in the post.
Posted By: boatman

Re: Reducing backtest time somehow - 11/23/15 02:39

Waiting days to get the results of your backtests? What on earth are you backtesting? I'd hazard a guess and suggest that you could improve your backtest time by adjusting your optimization so that it is fit for purpose. For example, you probably don't need to be optimizing a multiple-market, multiple-parameter machine learning strategy over many years of tick data.

Can you share a little about your strategy (eg how often it trades, bar period, how many parameters, overview of trade logic) and your current optimization and backtest setup?
Posted By: nanotir

Re: Reducing backtest time somehow - 11/23/15 06:44

Maybe I have a bug. It is part of the building strategy process. Should I trail or not? which kind of trailing? Then I generate different algos so I can compare the strategy performance.
I also go through different market times to know which is the best time for each asset. Beside I have 32 assets. And since I dont know if they behave the same in up trend or down trend, either I split the strategy in short and long algos or I split the optimization parameters into those for short and long for each algo. And I variate the amount of parameters which get optimize to avoid overfitting.
I could do all above in a couple of days and chaging each day something as a part of developing the strategy or I can do it all at once.
So there is no mystery, I am using pivot point but there are a lot of posibilities to play around of it. I am not using TICK, neither too many years.
Maybe all above not make sense but somehow the increase of options/parameters is something that can happen over time so that in the future more complex analysis can bring better understanding of the behaviour of the assets.

I could not find such a cloud computing community in internet that you can join and use resources of different computers as they use yours. I dont know if it exits or if it can compromise security. Maybe there is such where each member pay a small fee and have access to a supercomputer or x-cpu in y-time per month, or maybe only universities and technology centers can access to it.

I have found some which offer an API. I dont know if it make sense to have that option in zorro so that if you begin training mode in your computer, the calculations are done in the cloud.
Posted By: boatman

Re: Reducing backtest time somehow - 11/24/15 11:25

Sounds very strange to me. You don't need a super computer to run a non-tick based backtest on 32 instruments even if you are optimizing dozens of parameters.

What is the typical distance between optimization steps? 10% of the range is a decent starting point. Are you optimzing tiny ranges?

Can you post some code? What you're describing sounds bizarre.
Posted By: nanotir

Re: Reducing backtest time somehow - 11/24/15 13:25

Hi

I will try by reducing the step but it is not that tight.
The step is 25 for the period of indicators and 0.1 for stop and entry which is like 10% in this case.

I use several algos as well.

In the manual it is mention that the train can take several hours in case of a complex portfolio so I thought that is it normal that it last 15 hours or so. I optimize 8 parameters per algo ( 4 for long and 4 for short positions ) and I have 13 algos, 32 assets and 5 WFO and NumYears = 2 with the RECALCULATE flag.
Since I have defined different ways to enter and exit the trades, that script has different versions which I need to train as well. So if one has 10 scripts and each needs 10 hours of train time. Then 100 hours. Thats why I thought about a computer network or something similar. The Z12 needs several hours of training as well.
There is nothing extraordinady in the script. Maybe that I use 22 series instead of using just var in many cases. I will reduce this number and see what happens and post it here. If it remain the same, then I may have a bug and post some code over here.

I also notice that the execution speed by using the timer function is 0.001ms if I use the script of the tutorial. If I introduce the algo function in bettween the timer and the myfunction calls then the time is around 0.32 ms per algo. Is that too long?



Posted By: nanotir

Re: Reducing backtest time somehow - 11/26/15 23:15

Hi

I did a backtest in workshop6_2 with 32 assets and 5 WFO and 2 years. I added as well some optimization parameters so that it looks as mine. The backtest needed 3 hours and it is just 2 algo functions. If the algos are more complex and there are around 10 in the strategy, then 10 hours for backtest is not as long.

The timer function needs the same time to be executed than in my script as well... around 0.3ms.

To speed up all the analysis I want to do, I am using the google vps. They give you 300$ that you can use in the CPU instance. One is charged each minute the instance is active. It looks quite friendly and easier to implement than amazon.
Posted By: MatPed

Re: Reducing backtest time somehow - 11/27/15 08:42

Hi,
how many cores do you have and which is your numcores settings during the test?
© 2024 lite-C Forums