[R-SIG-Finance] Does anybody know how to connect to KDB from within R?

Michael comtech.usa at gmail.com
Fri Sep 25 02:35:53 CEST 2009


It doesn't seem to work on my computer:

http://127.0.0.1:5000/

I am using that trial version on my personal laptop: the one that
auto-exits every 2 hours...

What might be the problem?

On Thu, Sep 24, 2009 at 4:03 PM, Daniel Cegielka
<daniel.cegielka at gmail.com> wrote:
> Michael pisze:
>> Very cool.
>>
>> I did the source thing. I am using Windows XP.
>>
>> Are there any sample database/code/project that I could try if this
>> R-KDB connection works or not?
>>
>> I would love to explore a bit to see how I could achieve synergy by
>> combining the power of R and KDB/Q together.
>>
>> Any pointers?
>>
>> Thanks a lot!
>>
>
> https://code.kx.com/trac/browser/kx/kdb%2B
>
>
> trade:([]time:`time$();sym:`symbol$();price:`float$();size:`int$())
>
> `trade insert(09:30:00.000;`a;10.75;100)
> `trade insert(09:31:00.000;`a;10.76;100)
> `trade insert(09:32:00.000;`a;10.77;100)
> `trade insert(09:33:00.000;`a;10.77;100)
>
> q)select from trade
> time         sym price size
> ---------------------------
> 09:30:00.000 a   10.75 100
> 09:31:00.000 a   10.76 100
> 09:32:00.000 a   10.77 100
> 09:33:00.000 a   10.77 100
>
> q)select from trade where price>10.75
> time         sym price size
> ---------------------------
> 09:31:00.000 a   10.76 100
> 09:32:00.000 a   10.77 100
> 09:33:00.000 a   10.77 100
>
> q)select sum size by sym from trade
> sym| size
> ---| ----
> a  | 400
>
>
> or in web browser
>
> http://127.0.0.1:5000/
> http://127.0.0.1:5000/trade
> http://127.0.0.1:5000/?select from trade where price > 10.75
>
> best,
> daniel
>
>
>
>
>
>
>



More information about the R-SIG-Finance mailing list