When this happens I want to set a new stop loss at the original entry price (breakeven stop loss) and then adjust the stop loss with the market moves.
I use the following code to enter the trade, where Variable0 is my stop price and variable1 is my porfit target
EnterLong(50, "1st");
EnterLong(50, "2nd");
SetStopLoss("1st", CalculationMode.Price, Variable0, true);
SetStopLoss("2nd", CalculationMode.Price, Variable0, true);
SetProfitTarget("1st", CalculationMode.Price, Variable1);
Now I need to know when the 1st profit target is reached and that 1st position is closed.
I thought I would use the following statement
if (Position.Quantity == 50)
but this is not working as it seems to be always false.
Is there a better way to find out if my 1st half position was closed (i.e my Profit Target order was triggered)?
Is there also a way to find out if my Stop Loss order triggered for each of the open positions?
Thanks
Comment