Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Need high performance computer for back testing on historical data
I am into trading for a while and now I want to automate my trades. I have developed some strategies and want to back test them on historical data. I am facing a problem because of low processing power on my computer. I am written codes in PERL programming language and when I run my strategies on Core i7 4510U with 4 threads, it takes 36 hours to finish running one strategy. I need to run 44 such strategies. So I am really looking for a high performance computer, preferably online.
I dont want to buy a work station and I am only looking for services that offer high computing power online. The platform may be windows/linux based. Can someone suggest me such a service where high processing power can be hired cheaply? Key word "Cheap".
Can you help answer these questions from other members on NexusFi?
I was facing similar situation.
while I do have a powerful machine.
Things i have done to win time are :
1. Simulator
I wrote a simulator to speed things up +/- 20.000 x times.
this works in a scenario, where the data and the indicators are stable but you want to try various
combinations of filters. In this solution i wrote all the data (bar + indicators) to a file and read them in the simulator.
2. virtual machine
i have been doing back-testing with 4 VM's on my server and run 4 periods in parallel
that is another way to win time.
3. automation
If i read you are using perl (which is not a compiled language)
that could be optimized if some scripts run 50.000 times, that might not be efficient
versus another technical choice..
would need more general info
to give further advice
I think using Virtual service is the best way to go forward for me (I have no idea of the simulation you are talking of. I aint a big time programmer frankly). I have actually looked for VPN in Godaddy etc., but I am not sure how useful they will be or if they will allow installing perl and some associated modules. So I am looking for an advice regarding this. Please do suggest me some such services that offer high computing power.
I am using perl since thats the language I find easy to write codes in, no other reason. Please suggest another language. I shall try to code in that from next time, but for now, I prefer sticking to perl. By the way, I am only using perl to have an estimate of my profits using different strategies. I am using Ninja trader to write my code that does real trading.
Well, I haven't really written anything that needs 36 hours to run for one backtest. For me, one backtest with up to 5 years of data usually only takes minutes. But a parameter sweeper (which tries all variations) may take up to 12 hours. I used single thread PHP script. I can manually divide the parameter space into 3 subsets and run them on three different instances simultaneously to save time. I also backtested tick data before. It is slower but not that slow. For me, tick level strategy either work or it doesn't. I felt it didn't help to backtest tick data for a long period. For optimization, it helps to put all your data to memory and try to save and reuse the intermediate data that has already been computed. For example, if you need the moving average for one strategy, the moving average itself can be calculated once and saved to be used later by your other strategies. In my opinion, I7 is already a powerful machine and optimizing/profiling your code will help you the most.
Perl is not fast. Use a compiled language like C, C++, C#, or Java (JVM) for speed. This will help you more than using expensive VMs or cloud computing services. Your i7 should be fast enough but I'm not certain since you didn't disclose what kind of strategy it is and what kind of data set you are testing across.
As others mentioned, look to use caching of things that are being calculated over and over again, like a SMA(200), so you don't keep re-calculating the same things with each iteration.
I use Ninjatrader, which allows me to code strategies in C#, and I can backtest several years of data across thousands of stocks in a few minutes using daily bar data.
I've decided to go with dedicated Xeon 1230v3 server. It is many times faster than 4510u and cheaper too but falls behind when compared to amazon ec2. but it is good enough for me...