Unfortunately your code has some language errors in it. I expect you're coming from C++ or Python?
If you want to price options with sequential code I'd suggest R, or whatever language you know best.
If you want to use Mathematica, you should first get to grips with the unique elements of its format:
- All built in functions are capitalised. You've tried to make use of 'max' and 'if' for example.
- All function arguments are specified by square bracket. You've tried to pass 'IntegerPart', 'If', 'max', and even your own 'boptval' arguments via curved bracket.
- Brackets should be closed, this is pretty basic, and some potential culprits are even highlighted for you.
Coding out 15 lines at once in an unfamiliar language is not a good idea! If you understand the innards of the function, code it line by line, run it frequently, and check that your output and variables behave as expected.
Finally, defining a single function via Module is not not great leverage of the power of Mathematica!
What's the application? Are you just interested in the market, or are you on a trading desk?