Forum Replies Created

Page 14 of 14
  • megan_mcp

    Administrator
    September 11, 2023 at 12:00 am in reply to: error: "test.testTab" (FP.Functions.test/classifyTrades.quke:3)

    Hi  !

    To help me better assist you, can you send me your code for classifyTrades?

    You can do this using the spoiler tag or you can dm me!

    Thanks,

    Megan

  • megan_mcp

    Administrator
    August 17, 2023 at 12:00 am in reply to: Fundamental Capstone Exercise 4 and 5

    Hi !

    If you take a look at the attached image of the question at hand, you’ll see the variable itself must be named ‘minute’.

    As well as this, we are after the latest date so the most recent date. You can do this by using ‘date = last date’. Feel free to have a look at this on our website ! first, last Reference kdb+ and q documentation – Kdb+ and q documentation (kx.com)

    Thanks,

    Megan

     

  • megan_mcp

    Administrator
    August 3, 2023 at 12:00 am in reply to: Challenge 4 – World Cup

    This is exactly the output I wanted thanks ! Plus that article you tagged is very useful.

    q) data:flip`player`country`minute!("SSS";";")0:`:goals.txt 
    q) exec (string[player],'" from ",/:string[country],'" scored a goal in the ",/:string[minute],:"th minute") from data 
    "Gazinsky from Russia scored a goal in the 12th minute" 
    "Cheryshev from Russia scored a goal in the 43th minute" 
    "Cheryshev from Russia scored a goal in the 91th minute" 
    "Dzyuba from Russia scored a goal in the 71th minute" 
    "Golovin from Russia scored a goal in the 94th minute" 
    "Gimenez from Uruguay scored a goal in the 89th minute" 
    "Cheryshev from Russia scored a goal in the 59th minute" 
    "Dzyuba from Russia scored a goal in the 62th minute" 
    "OG from Russia scored a goal in the 47th minute" 
    "Salah from Egypt scored a goal in the 73th minute" 
    "Suarez from Uruguay scored a goal in the 23th minute" 
    "Suarez from Uruguay scored a goal in the 10th minute"...

    However when I try putting 0N! each in front of the statement I get a parse error?

    q) data:flip`player`country`minute!("SSS";";")0:`:goals.txt 
    q) 0N! each exec (string[player],'" from ",/:string[country],'" scored a goal in the ",/:string[minute],:"th minute") from data 
    parse error

     

  • megan_mcp

    Administrator
    July 12, 2023 at 12:00 am in reply to: Constrained Curve Fitting in KDB

    Hi ,

    This looks similar to Polynomial fitting – lsq least-squares matrix equation solution |Reference | kdb+ and q documentation – Kdb+ and q documentation (kx.com)

    Or another option is to use embedPy (or the PyKX version PyKX under Q) to import a Python library and use it directly. Running PyKX under q – PyKX

    Let me know if this helps!

  • megan_mcp

    Administrator
    July 11, 2023 at 12:00 am in reply to: Issue with Window Join

    Hi , just to add to ‘s reply;

    • It’s because wj uses the last-most quote out side of the window as well as quotes in the window (that last-most quote is called the “prevailing” quote in the notes).  If this is not the desired result and you strictly want stuff in the window only, you use wj1

    If I use your example to explain:

    t:([]sym:3#`JPM;time:09:30:01 09:30:04 09:30:08;price:120 123 121) 
    q:([]sym:10#`JPM;time:asc 09:30:00,09:30:00,09:30:01,09:30:02,09:30:03,09:30:04,09:30:05,09:30:05,09:30:07,09:30:07;ask:(102,91,93,102,91,96,102,103,97,95);bid:(107,100,93,108,93,108,106,99,101,102);rn:1+til 10) 
    windows: -2 1+: t[`time] 
    wj[windows;`sym`time;t;(q;(max;`ask);(min;`bid);((::);`rn))]
    • That last-most quote only is taken when there is no quote right at the exact window start time (you can see this in the second row of the result, we had a quote exactly at window start time 09:30:02, so the last-most quote outside the window isn’t included in that case, for the third row it was because no quote exactly at 09:30:06)
  • megan_mcp

    Administrator
    June 9, 2023 at 12:00 am in reply to: from kxi import sp

    Apologies for the confusion in the documentation this is being rectified. The API for kxi.sp works within the kdb Insights Microservices and kdb Insights Enterprise as part of pipeline deployments in both cases and within the kdb Insights Enterprise Scratchpad for iterative development. Once the documentation is updated and available well update you here with further details on its usage.

  • megan_mcp

    Administrator
    February 3, 2023 at 12:00 am in reply to: Challenge 3 The Runner-Up

    does this take the second distinct number in the list? If so, thanks! I really like that approach

Page 14 of 14