This function is the same as irr but can calculate negative value. This function may take a very long time. You can use larger cutoff and larger step to get a less precision irr first. Then based on the result, change from and to, to narrow down the interval, and use a smaller step to get a more precision irr.
Usage
irr2(cf, cutoff = 0.1, from = -1, to = 10, step = 1e-06)
Arguments
cf
cash flow,the first cash flow is the initial outlay