I have a script that runs two Algo (Algo A & B) that calculates daily optimal position for each Algo, then open or close trades accordingly.
For example on Monday, optimal position for Algo A = 3, Algo B = 0. If on Tuesday, optimal position is Algo A = 4, Algo B = 1, then the script will calculate net position is 2 long: (4 - 3) Algo A + (1 - 0) Algo B.
However if on Tuesday, optimal position is Algo A = 4, Algo B = -1, then the script will calculate net position is 0: (4 - 3) Algo A + (-1 - 0) Algo B. Thus, the script will not open or close any position.
But since no trades is being made, the script will consider the number of open trades for each Algo remains the same (Algo A = 3, Algo B = 0), even though it should be Algo A = 4, Algo B = -1.
How do you make Zorro to consider the number of open trades for each Algo without executing trades?