-
Backtester in q
Good morning everyone,
I am trying to implement a backtesting engine in q, starting with a simple logic as described below:
-
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).
-
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.
-
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.
-
Log in to reply.