CompuKalc Excel Add-In: General Information
[Main] [Next]

Here the routines are implemented as functions that return an output array. Output results are here returned in the output array and are do therefore not appear in the routine argument list.

The conversion between the C enumeration types and Visual Basic integers is as follows.

Argument name: method

Argument type: Calc_Type

C/Visual Basic enumeration:
European = 0, American = 1, Cntrl_American = 2, BBS_European = 3, BBS_American = 4,
BBS_Cntrl_American = 5, BBSR_European = 6, BBSR_American = 7



Argument name
: lattice_type

Argument type: Lattice_Type

C/Visual Basic enumeration: standard = 0, prob_half = 1



Argument name
: div_type

Argument type: Div_Type

C/Visual Basic enumeration: percentage = 0, cash = 1


Argument name
: vol

Argument type: Vol_Method

C/Visual Basic enumeration: Newton = 0, Bisection = 1


Example

For example the following C code:

lattice_type = standard
method = American
div_type = percentage
put = 1
opt_bin_div(&opt_value, n_divs, dividends, divs_t, greeks, S, X, sigma, opt_mat, r, put, nt_steps,
method, lattice_type, div_type, &ifail)


corresponds to the following Visual Basic code:

lattice_type = 0
method = 1
div_type = 0
putcall = 1
output_results = opt_bin_div(dividends, divs_t, S, X, sigma, opt_mat, r, putcall, nt_steps, method, _
lattice_type, div_type)