EnterLong, ExitLong and Set Stop Loss sequentially?

Hi everyone,

I feel like this is an easy answer for some but I cannot figure it out while running a simulation.

I have a condition in the OnBarUpdate of the strategy. If true, I want to set myself up this way :

//I want to enter at this price
EnterLongLimit(1, entryOrderPrice, “LongPosition”);
//sell if it hits the above price after i am in :
ExitLongLimit(0, true, Position.Quantity, targetPrice, “ExitLong”, “LongPosition”);
//Set stop loss here
SetStopLoss(“LongPosition”, CalculationMode.Price, stopLossPrice, false);

I assume you cannot place these commands immediately one after another. Could someone explain how to achieve this?

Thank you all,
D