Skip to content

Commit

Permalink
Clafied payoff-name
Browse files Browse the repository at this point in the history
  • Loading branch information
hudde committed Jan 6, 2024
1 parent d0922b1 commit 2ba930d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/Malliavin_European_Greeks.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ Malliavin_European_Greeks <-
payoff <- function(x) {
return(pmax(0, exercise_price-x))
}
} else if (payoff == "digital_call") {
} else if (payoff %in% c("digital_call", "cash_or_nothing_call")) {
payoff <- function(x) {ifelse(x >= exercise_price, 1, 0)
}
} else if (payoff == "digital_put") {
} else if (payoff %in% c("digital_put", "cash_or_nothing_put")) {
payoff <- function(x) {ifelse(x <= exercise_price, 1, 0)
}
}
Expand Down

0 comments on commit 2ba930d

Please sign in to comment.