Re: Hp-19BII, S Function Message #5 Posted by W. Bruce Maguire II on 7 Dec 2001, 6:54 p.m., in response to message #3 by Jim Kimes
Jim:
Here are the alterations to your equation that I made. You did, indeed, have a few parentheses errors, as well as confusion with the "S" function. I changed the names of some of the variables, just to give you some ideas of naming conventions I like for clarity. One thing I like is to always enter percent values in percent, rather than a fraction. This is what I did in your equation, but if you are trained to use fractional values, than you will want to take out the "%" symbols in the names, and take out all the "divide by 100" instances in the equation. I also show you a technique to re-order your variables. Finally, you do not need the "=0" at the end, the machine will assume that.
I also remember seeing a technique to produce multiple results at once, which is really what you want here. If I can find it, I will post it.
For clarity, I use "_mult_" for the multiplication symbol, and "_div_" for the division symbol in the listing.
The program starts with "SELLING~CALLS:" followed by two spaces (for name readability), then key in the rest of the program without the white-space.
SELLING~CALLS:
0_mult_
SP$_mult_
PP$_mult_
SC%_mult_
OP$_mult_
OC%_mult_
SH#_mult_
DAT1_mult_
DAT2+
IF(S(PRO$):
PRO$-
SH#_mult_(
SP$_mult_(
1-SC%_div_100
)+
OP$_mult_(
1-OC%_div_100
)-
PP$_mult_(
1+SC%_div_100
)
)
:
IF(S(RTN%):
RTN%_div_100-
PRO$_div_(
SH#_mult_
PP$_mult_(
1+SC%_div_100
)
)
:
ANN%_div_100-(
365_div_
DDAYS(D1:D2:1)_mult_
RTN%_div_100
)
)
)
I checked the formula on my 19BII with the parameters you sent me, and I get the same results:
----------Jim wrote:----------
A sample problem would be:
SH = number of shares; SP = strike price of stock; SC = stock commissions; OC = Options commissions; PP = purchase of stock; OPPROF = profit on an options
transactions if stock is called. So, if SH = 1,000; SP = $25.00; SC = .015; OC = .05; OP = $1.05; PP = $23.65; D2 = 12/21/01 and D1 = 11/23/01, solving this problem
OPPROF = $1,617.75; RET = 6.74%; and ANRET (annualized return)= 87.9%
It will be interesting to see what you get. Jim Kimes
------------------------------
Let me know how it works out,
Bruce.
|