Functional Statement Exercises in KDB+/Q Developer Level 3

https://learninghub.kx.com/forums/topic/functional-statement-exercises-in-kdb-q-developer-level-3

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

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

'''

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