Esempio n. 1
0
 internal static OptionInfo BuiltInVersion(OptionKind kind)
 {
     return(new OptionInfo {
         Name = "version",
         OptionKind = kind,
         IsBuiltIn = true,
         HelpText = "Display version information."
     });
 }
Esempio n. 2
0
 internal static OptionInfo BuiltInHelp(OptionKind kind)
 {
     return(new OptionInfo {
         Name = "help",
         OptionKind = kind,
         IsBuiltIn = true,
         HelpText = kind == OptionKind.Verb
             ? "Display information on a specific command."
             : "Display this help screen.",
         _subOptions = kind == OptionKind.Verb
             ? new List <OptionInfo>(1)
         {
             new OptionInfo {
                 Name = "verb",
                 OptionKind = OptionKind.Single,
                 IsPositional = true,
                 Index = 1,
                 HelpText = "Command to display help for."
             }
         }
             : null
     });
 }
Esempio n. 3
0
 public INETOption(OptionKind kind, string value)
 {
     _kind  = kind;
     _value = CreateValue(value);
 }
 public DigitalOption(String issuer, string symbol, ISecurity underlying, DateTime expiryDate, double strikePrice, double historicalVolatility, String isin, Boolean isTradable, OptionType type, OptionKind optionKind, Double rebate)
 {
     this.issuer = issuer;
     this.symbol = symbol;
     this.underlying = underlying;
     this.expiryDate = expiryDate;
     this.strikePrice = strikePrice;
     this.historicalVolatility = historicalVolatility;
     this.isin = isin;
     this.isTradable = isTradable;
     this.type = type;
     this.optionKind = optionKind;
     this.rebate = Rebate;
 }
 public DigitalOption(string symbol, ISecurity underlying, DateTime expiryDate, double strikePrice, double historicalVolatility, OptionType type, OptionKind optionKind, Double rebate)
 {
     this.symbol = symbol;
     this.underlying = underlying;
     this.expiryDate = expiryDate;
     this.strikePrice = strikePrice;
     this.historicalVolatility = historicalVolatility;
     this.type = type;
     this.optionKind = optionKind;
     this.rebate = rebate;
 }
        private void optionKinds_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            String optionKindValue = ((ComboBoxItem)this.optionKinds.SelectedValue).Name;

            switch (optionKindValue)
            {
            case "asian":
                this.extra.Visibility = Visibility.Hidden;
                this.dpBarrierOptionType.Visibility = Visibility.Hidden;
                this.checker9 = true;
                this.tbStrikePrice.IsEnabled = true;
                this.put.IsEnabled           = true;
                this.call.IsEnabled          = true;
                this.kind = OptionKind.ASIAN;
                break;

            case "barrier":
                this.extra.Visibility = Visibility.Visible;
                this.dpBarrierOptionType.Visibility = Visibility.Visible;
                this.lrebate.Content         = "Barrier: ";
                this.tbStrikePrice.IsEnabled = true;
                this.put.IsEnabled           = true;
                this.call.IsEnabled          = true;
                this.kind = OptionKind.BARRIER;
                break;

            case "digital":
                this.extra.Visibility = Visibility.Visible;
                this.dpBarrierOptionType.Visibility = Visibility.Hidden;
                this.lrebate.Content         = "Rebate: ";
                this.tbStrikePrice.IsEnabled = true;
                this.put.IsEnabled           = true;
                this.call.IsEnabled          = true;
                this.kind = OptionKind.DIGITAL;
                break;

            case "european":
                if (this.extra != null)
                {
                    this.extra.Visibility = Visibility.Hidden;
                }
                if (this.dpBarrierOptionType != null)
                {
                    this.dpBarrierOptionType.Visibility = Visibility.Hidden;
                }
                if (this.tbStrikePrice != null && this.put != null && this.call != null)
                {
                    this.tbStrikePrice.IsEnabled = true;
                    this.put.IsEnabled           = true;
                    this.call.IsEnabled          = true;
                }
                this.checker9 = true;
                this.kind     = OptionKind.EUROPEAN;
                break;

            case "lookback":
                this.extra.Visibility = Visibility.Hidden;
                this.dpBarrierOptionType.Visibility = Visibility.Hidden;
                this.checker9 = true;
                this.tbStrikePrice.IsEnabled = true;
                this.put.IsEnabled           = true;
                this.call.IsEnabled          = true;
                this.kind = OptionKind.LOOKBACK;
                break;

            case "range":
                this.extra.Visibility = Visibility.Hidden;
                this.dpBarrierOptionType.Visibility = Visibility.Hidden;
                this.checker9 = true;
                this.kind     = OptionKind.RANGE;
                break;

            default:
                break;
            }
        }