/// <summary> /// Execute the command /// </summary> /// <param name="parameter">the parameter</param> public override void Execute(object parameter) { _model.ClearResults(); try { var result = _calculator.Calculate(BlackScholesCalculatorPricingData.NewPricingData( _model.StockPrice, _model.StrikePrice, _model.StandardDeviation / 100M, _model.RiskInterest / 100M, _model.Time )); _model.D1 = result.D1.ToRound(_model.Precision); _model.D2 = result.D2.ToRound(_model.Precision); _model.CallOption = result.CallOption.ToRound(_model.Precision); _model.PutOption = result.PutOption.ToRound(_model.Precision); } catch (Exception ex) { AlertBox.ShowError(ex); } }
/// <summary> /// Execute the command /// </summary> /// <param name="parameter">the parameter</param> public override void Execute(object parameter) { _model.ClearParameters(); _model.ClearResults(); }