I have a strategy- CalculateOnBarClose=false- trading 2 contracts.
The entry orders are separated in 2 orders of 1 contract each with an unique signal. So the Profittarget and Stoploss can be set for each contract separately.
The first contract is taken out by the profittarget for that contract.
I move then the stoploss for the 2e contract to brealeven+1.
The script is as follows:
//*****************Move Stop to Breakeven+1 after T1
if(Position.Quantity==1)
SetStopLoss("ZLRL2",CalculationMode.Price,Position.AvgPrice+TickSize,false);
if(Position.Quantity==-1)
SetStopLoss("ZLRS2",CalculationMode.Price,Position.AvgPrice-TickSize,false);
However it looks like that the original stoploss is still valid.
I assumed that Position.AvgPrice is the average entry price of the 2 contracts.
Could you pls tell me what I am doing wrong?
Comment