Right Plan On Backtesting by Using KDB+

Dear All KDB+ Developers,

I am a newbie to the KDB+. The basic idea for me is to build up my own trading system. I believe that the KDB+ is great for being my database behind the interface I designed in c#, even the 32 bit version I am currently using.

I noticed that there is product called KDB+TOW which provides the replay function. The basic idea is that the KDB+TOW provides the daily tick to you as a data feed and you handle those data. It looks interesting. But i certainly will not have access to that function in a short time.

Now I would like to ask you guys as a newbie: what is the right way to backtest which maximizes the speed and efficiency of KDB+. I saw some article saying that people use R or MatLab to backtest and KDB+ purely stand aside as a data provider since MatLab and R certainly have shortfall on organizing high volume data and there is no column oriented database for these statistical software. So, that is Plan 1: KDB+ as speedy database, and MatLab as fancy statistical tools.

How about Plan 2, for my opinion: We do all backtest in the KDB+. For a very simple example. you have a trading plan that you have two indicator purely based on price. And for sure, you could write two (recursive) functions to calculate the indicator value. When these two values are higher than some threshold, then you buy. Then after all, you could calculate drawback, sharpe ratio for the report of trading plan backtesting. I strongly believe that this is very possible to be done purely in kdb+. But since I am a newbie, I would like to ask that whether here is any example for Plan 2? I noticed that there two great examples as (http://eachright.blogspot.ch/2007/05/back-testing-in-q.html) and from Mr. Kim (http://code.kx.com/wsvn/code/contrib/kuentang/talk/talk.pdf).

 I would like just know more. Or any idea about right way think about backtesting in KDB+.

Thanks again for your reading and potential reply.

Have a nice day!

Best Regards,

Wenhao SHE

On Tue, Jul 10, 2012 at 9:38 PM, she wenhao wrote:> How about Plan 2, for my opinion: We do all backtest in the KDB+.yes what you described is similar to a system we had in one of myprevious companies. Everything was done using q and kdb+ except lowlevel trade executionsI think you will find this very interesting. If you haven’t already,also try going through some examples at: http://www.gbkr.com/thanks,rohit

Dear Rohit Tripathi,

Thank you very much for your help. That is encouraging to hear some one from industry to say that company really heavily use the kdb+ as the analysis tools and of course, we do not need kdb+ to execute the trade with different API:D The website you provided is very interesting. I should confess that I have been on that site but never went deeper to find the sub-page http://www.gbkr.com/subjects/q/index.html. Seems lot of stuff for tonight, :D Thank you very much and Hope you have a nice night.

Best Regards,

Wenhao SHE