private void barrierOptionType_SelectionChanged(object sender, SelectionChangedEventArgs e) { String barrierOptionTyp = ((ComboBoxItem)this.barrierOptionType.SelectedValue).Name; switch (barrierOptionTyp) { case "downout": this.barrierOptiont = BarrierOptionType.DOWNOUT; break; case "downin": this.barrierOptiont = BarrierOptionType.DOWNIN; break; case "upout": this.barrierOptiont = BarrierOptionType.UPOUT; break; case "upin": this.barrierOptiont = BarrierOptionType.UPIN; break; default: break; } }
public BarrierOption(string symbol, ISecurity underlying, DateTime expiryDate, double strikePrice, double historicalVolatility, OptionType type, OptionKind optionKind, Double barrier, BarrierOptionType barrierOptionType) { this.symbol = symbol; this.underlying = underlying; this.expiryDate = expiryDate; this.strikePrice = strikePrice; this.historicalVolatility = historicalVolatility; this.type = type; this.optionKind = optionKind; this.barrier = barrier; this.barrierOptionType = barrierOptionType; }