/// <summary>
        /// Deducts the matched positions from the specified <paramref name="positions"/> taking into account the multiplier
        /// </summary>
        public OptionPositionCollection RemoveFrom(OptionPositionCollection positions)
        {
            var optionPositions = Legs.Select(leg => leg.CreateOptionPosition(Multiplier));

            if (Definition.UnderlyingLots != 0)
            {
                optionPositions = optionPositions.Concat(new[]
                {
                    new OptionPosition(Legs[0].Position.Symbol.Underlying, Definition.UnderlyingLots * Multiplier)
                });
            }
            return(positions.RemoveRange(optionPositions));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Deducts the matched positions from the specified <paramref name="positions"/>
 /// </summary>
 public OptionPositionCollection RemoveFrom(OptionPositionCollection positions)
 {
     return(positions.RemoveRange(Legs.Select(leg => leg.Position)));
 }