KX Community

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

Home Forums kdb+ Backtester in q

  • Backtester in q

    Posted by rgiu70 on October 10, 2024 at 7:07 am

    Good morning everyone,

    I am trying to implement a backtesting engine in q, starting with a simple logic as described below:

    1. Generate a table with signals (a fast-moving average crossing above the slow-moving average indicates a long signal, and vice versa for a short signal).

    2. Position management -> Measure, at the moment the signal is generated, if the stop loss or take profit is reached first, assigning a positive or negative value depending on the result, assigning an order ID for each signal.

    3. Generate an equity line based on the results.

    I am trying different approaches, but I still haven’t found an efficient solution for part 2, which is position management.

    Is there any article dedicated to this topic? Any advice on this? Unfortunately, I haven’t found anything online that addresses these issues.

    Thank you.

    megan_mcp replied 2 months, 1 week ago 2 Members · 1 Reply
  • 1 Reply
  • megan_mcp

    Administrator
    October 11, 2024 at 4:42 pm

    Hi @rgiu70

    I have reached out to our team to see if there are any helpful articles/documents they would recommend.

    In the meantime, I suggest you reach out to other users on our Slack community. Here you are able to get a more real-time response.

    Many thanks,

    Megan

Log in to reply.