KX Community

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

Home Forums kdb+ First Project Attempt

  • unterrainer_ale

    Member
    September 29, 2024 at 11:19 am

    I would add some comments or descriptions for the parameter inputs to the functions for those who don’t have a finance background or are not familiar with the Kelly Criterion.

  • choppergrip

    Member
    September 30, 2024 at 10:03 am

    It looks good, but the code style can be improved a bit:
    – consistency with semicolons, you have it after closing the bracket, but not for all functions
    – for “-1” messages it probably makes sense to have some wrapper function
    – possible arguments validation inside of the
    optimizePortfolio function
    – maybe you want to have these functions in a specific namespace to avoid clashes during import in bigger project
    – unit tests and integration test

  • rocuinneagain

    Member
    September 30, 2024 at 10:52 am

    For example code use backslash to leave it as a multi line comment so those wishing to use this as a library can load the script without it running the example every time.

    https://code.kx.com/q/basics/syntax/#comments

    See example: https://github.com/KxSystems/kdb-tick/blob/master/tick.q#L50

Log in to reply.