trying to build a recovery signal for losing position. when an unrealized loss in an open position (1 contract long) reach -50 since it was entered then sell 2 contracts (reverse position).
both entry signal and recovery/take profit signal runs at the same time.
i wrote the code below but it doesn't work as I expected.
it doesn't sell 2 contracts when the loss reaches -50 and it closes potion in a bigger loss (from -80 to -140...).
who can help with this?
the full code of recovery signal -
Code: Select all
if openpositionprofit < -50 then
sell ("recovery 1") 2 contracts this bar at close;
setprofittarget(100);