Re: HP 17BII+ Black-Scholes using SOLVE Message #2 Posted by tony on 16 Mar 2004, 10:52 p.m., in response to message #1 by Bob Wang
Bob,
My pleasure. Glad you liked it!
Ah yes I forgot the 17bii+ is like the old 17b. Shame that L/G
"escaped" from the 17bii+! I did the one below for the 17b -
requires solving for D1,F1,D2,F2,CALLV and PUTV in order. I
see your SOLVE does the D1. I tried to minimise the typing
required to enter the eqn. Interesting to see your approach!
Timothy Crack has a nice 17B Black-Scholes in his book "Heard
on the Street" - page 278 - he implements the full AMS55
26.2.17, and requires solving for D1,N1,D2,N2, CALL.
{17bbs|0*(PS+PE+RF%+T+S)+
IF(S(D1):D1-(LN(PS/PE)+(RF%/100+S^2/2)*T)/S/SQRT(T):
IF(S(F1):F1-1/(1+ABS(D1)/3.006):
IF(S(D2):D2-D1+S*SQRT(T):
IF(S(F2):F2-1/(1+ABS(D2)/3.006):
IF(S(CALLV):CALLV
-PS*ABS(IF(D1<0;0;-1)+
EXP(-D1^2/2)*F1*((187*F1-24)*F1+87)/500)
+PE*EXP(-RF%*T/100)*ABS(IF(D2<0:0:-1)+
EXP(-D2^2/2)*F2*((187*F2-24)*F2+87)/500):
PUTV-CALLV+PS-PE*EXP(-RF%*T/100))
))))}
Somewhere I have a less accurate 17b one about 60 chars
smaller than the above (300 v 360, approx) which still gives
the correct 14.22 for the Call in that HP17BII example. It
requires solving for D1,D2,CALLV, PUTV. No harm in solving for
D1 & D2 - always good to see for the B-S student<G>. I admit
the F1 and F2 above are not very interesting, but I am not
fast at entering equations in the pioneers. In fact for
something like the above it is almost easier to have separate
equations for the components - then they are really short and
load quickly. The old 18C didn't have the IF(S(.. so there we
had to have separate eqns.
Cheers,
Tony
|