Esempio n. 1
0
        /// <summary>
        /// Execute the command
        /// </summary>
        /// <param name="parameter">the parameter</param>
        public override void Execute(object parameter)
        {
            _viewModel.ClearResults();

            try
            {
                var result = _calculator.Calculate(BlackScholesCalculatorPricingData.NewPricingData(
                                                       _viewModel.StockPrice,
                                                       _viewModel.StrikePrice,
                                                       _viewModel.StandardDeviation / 100M,
                                                       _viewModel.RiskInterest / 100M,
                                                       _viewModel.Time
                                                       ));

                _viewModel.D1         = result.D1.ToRound(_viewModel.Precision);
                _viewModel.D2         = result.D2.ToRound(_viewModel.Precision);
                _viewModel.CallOption = result.CallOption.ToRound(_viewModel.Precision);
                _viewModel.PutOption  = result.PutOption.ToRound(_viewModel.Precision);
            }
            catch (Exception ex)
            {
                AlertBox.ShowError(ex);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Execute the command
 /// </summary>
 /// <param name="parameter">the parameter</param>
 public override void Execute(object parameter)
 {
     _viewModel.ClearParameters();
     _viewModel.ClearResults();
 }