I need perhaps to have more than 6 active strategies on the remote server, I need to keep open a single operation by strategy, that is if I have 6 active strategies the most that can be open is 6 operations, one for each strategy, I managed to work in a one direction, ie I program the following:
If there is an open position between 6 strategies if the open position is V1 (BUY_V1) strategy, then assign value "0" to the variable: Max_Pos_Open
In the example it works properly with bullish operations, such as:
If I have active 6 Strategies on the server with open positions in the V2, V3, V4 strategies strategy V1 opens a bullish position and while this open no longer open more positions although in Max_Pos_Open = 6 variable, we will assigned "0" while BUY_V1 is open.
The problem is when I add the bearish side to do the same, and it does not work, I've tried hundreds of ways and I can not make it work in both directions.