Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Strike"/> class.
 /// </summary>
 /// <param name="style">The style.</param>
 /// <param name="strikePrice">The strike price.</param>
 public Strike(OptionType style, Double strikePrice)
 {
     InputValidator.EnumTypeNotSpecified("Option Type", style, true);
     InputValidator.NotZero("Strike Price", strikePrice, true);
     Style       = style;
     StrikePrice = strikePrice;
 }
Example #2
0
 /// <summary>
 /// Transactions the complete.
 /// </summary>
 /// <param name="transaction">The transaction.</param>
 internal static void TransactionComplete(TransactionDetail transaction)
 {
     InputValidator.NotZero("Spot Price", transaction.CurrentSpot, true);
     InputValidator.NotNull("Trade Date", transaction.TradeDate, true);
     InputValidator.NotNull("Expiry Date", transaction.ExpiryDate, true);
     InputValidator.EnumTypeNotSpecified("Pay Style", transaction.PayStyle, true);
     if (transaction.ExpiryDate <= transaction.TradeDate)
     {
         throw new InvalidValueException(
                   $"Expiry date {transaction.ExpiryDate} must fall after the Trade Darte {transaction.TradeDate}");
     }
 }