KX Community

Find answers, ask questions, and connect with our KX Community around the world.

Home Forums KX Academy Functional Statement Exercises in KDB+/Q Developer Level 3

  • Functional Statement Exercises in KDB+/Q Developer Level 3

    Posted by trinity on March 19, 2024 at 12:45 am

    The solution for the question asking to create the first function for Xmavg_price is incorrect.

    • This discussion was modified 1 month, 1 week ago by  trinity.
    • This discussion was modified 1 month, 1 week ago by  trinity.
    megan_mcp replied 1 month, 1 week ago 2 Members · 2 Replies
  • 2 Replies
  • trinity

    Member
    March 19, 2024 at 11:36 pm

    It takes the variable x, however never uses it and instead just uses 5.

    For clarity this is the solution provided

    ”’

    Xmavg_price: {[X]

    whereClause: () ; //enlisting JPM to keep as a symbol and not interpreted as a variable

    byClause:enlist [sym]!enlistsym;

    returnClause:enlist[price_5]!enlist (mavg;5;price);

    ?[trade;whereClause;byClause;returnClause]

    }

    Xmavg_price 5

    ”’

  • megan_mcp

    Administrator
    March 20, 2024 at 12:54 pm

    Hi @trinity

    Thank you for letting us know, as always we will make sure to update this immediately so that it is accurate for future users.

    Many thanks,

    Megan

Log in to reply.