by Stinger66 » Fri Jan 15, 2021 7:18 am
Hello,
Strategy is not closing trades as per my request.
I am looking for immediate partial or full close of trades in loss for the opposite amount of the trade in profit that is closed.
The trades in loss that are closed should always be the oldest trades first.
If this can be achieved then I would like to see if this strategy could be converted to an indicator so that this indicator can be accessed from any strategy,.
What I am trying to achieve is, if there is more than one position open in the same direction, that the profitable positions are always closed but the losing positions in the same direction are always partially closed by the profit amount achieved.
Logic is only for the same direction of positions.
Example.
1. Position 1 is long 100 with a loss of -$1000
2. Position 2 is long 100 with a profit of $500
Position 2 is closed for a profit for $500
Position 1 is partially closed for 50 Units and loss of -$500 and 50 units remains open at at a loss of -$500.
Thanks in Advance,
Frank,