KX Community

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

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

  • 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

    ”’