Covered option analysis.
Source Code
50 GO SUB 5000 51 DIM Q(12) 52 LET Q(1)=31 53 LET Q(2)=28 54 LET Q(3)=31 55 LET Q(4)=30 56 LET Q(5)=31 57 LET Q(6)=30 58 LET Q(7)=31 59 LET Q(8)=31 60 LET Q(9)=30 62 LET Q(10)=31 64 LET Q(11)=30 66 LET Q(12)=31 70 LET Q1=0 80 CLS 90 PRINT "ENTER\::STOCK\::SYMBOL" 92 INPUT S$ 94 PRINT S$ 110 PRINT "ENTER\::STRIKE\::PRICE" 115 INPUT P 117 PRINT P 120 PRINT "ENTER\::OPTION\::DATE MMYY" 125 INPUT Z$ 127 IF LEN Z$<>4 THEN GO TO 120 128 LET Z$=Z$(1 TO 2)+"/01/"+Z$(3 TO 4) 129 PRINT Z$ 140 GO SUB 2000 210 IF NZ=0 THEN GO TO 120 230 LET C1=NZ-7*INT (NZ/7) 240 LET C1=9-C1 242 LET C1=C1-7*INT (C1/7) 250 LET D1=NZ+15+C1 251 REM PRINT D1 260 PRINT "ENTER\::TODAYS\::DATE MMDDYY" 262 INPUT Z$ 263 IF LEN Z$<>6 THEN GO TO 260 264 LET Z$=Z$(1 TO 2)+"/"+Z$(3 TO 4)+"/"+Z$(5 TO 6) 266 PRINT Z$ 270 GO SUB 2000 272 IF NZ=0 THEN GO TO 260 280 LET D2=D1-NZ 282 REM PRINT D2 300 PRINT "ENTER\::NO.\::OF\::SHARES" 305 INPUT NS 307 PRINT NS 309 PRINT "ENTER\::PRICE/SHARE" 311 INPUT PS 313 PRINT PS 315 PRINT "ENTER\::PERIOD\::DIVIDEND" 317 INPUT PD 319 PRINT PD 320 PRINT "ENTER\::UNDERLYING\::COMMISSION" 322 INPUT UC 324 PRINT UC 325 CLS 326 PRINT "ENTER\::NO.\::OF\::CALLS" 327 INPUT NC 329 PRINT NC 332 PRINT "ENTER\::PREMIUM" 334 INPUT PR 336 PRINT PR 340 PRINT "ENTER\::OPTION\::COMMISSION" 342 INPUT OC 344 PRINT OC 347 350 LET PR=PR*100 360 LET L1=NS*PS 362 LET L2=L1+UC 364 LET L3=NC*PR 366 LET L4=L3-OC 370 LET D3=PD*NS 372 LET P1=NS*P 380 LET L5=P1-(L2+UC) 382 LET L6=L5+D3+L4 390 LET R1=L6/L2 392 LET R2=R1*(365/D2) 400 LET R1=R1*100 402 LET R2=R2*100 410 LET L7=D3+L4 412 LET R3=100*(L7/L2) 414 LET R4=R3*(365/D2) 420 LET L8=(L2-L7)/NS 430 CLS 432 PRINT AT 0,2;"COVERED\::OPTION\::ANALYSIS--";S$ 434 PRINT AT 1,1;"\::\::\::\::\::\::EXERCISED\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::" 436 PRINT AT 2,1;"ROI= ";R1 438 PRINT AT 3,1;"ANN.\::ROI= ";R2 440 PRINT AT 4,1;"NET\::RETURN= ";L6 442 PRINT AT 5,1;"\::\::\::\::\::\::UNEXERCISED\::\::\::\::\::\::\::\::\::\::\::\::\::" 444 PRINT AT 6,1;"ROI= ";R3 446 PRINT AT 7,1;"ANN.\::ROI= ";R4 448 PRINT AT 8,1;"NET\::RETURN= ";L7 450 PRINT AT 9,1;"\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::" 460 PRINT AT 10,1;"NET PROCEEDS: $";L4 590 PRINT AT 11,1;"BRK.EVEN $";L8;" /SHARE" 595 PRINT AT 12,1;"NET CAPITAL INVESTED $";L2-L4 650 PRINT AT 13,1;"BUY ";NS;" SHARES AT ";PS 660 PRINT AT 14,1;"SELL ";NC;" OPTIONS AT ";PR/100 670 PRINT AT 15,1;"DAYS TO EXPIRATION ";D2 680 LET N=D1-1 682 GO SUB 3000 684 PRINT AT 16,1;"LAST TRADING DAY ";Z$ 700 PRINT AT 17,1;"COMMISSIONS: " 702 PRINT AT 18,4;"STOCK= ";UC;" OPTION= ";OC 710 PRINT AT 19,1;"PERIOD DIVIDEND= ";PD 720 PRINT AT 20,1;"STRIKE PRICE= $";P 750 780 PRINT AT 21,1;"CONTINUE\::? Y/N " 785 IF INKEY$="" THEN GO TO 780 787 IF INKEY$="Y" THEN GO TO 51 999 STOP 1100 STOP 2000 REM 2003 IF Q1=1 THEN GO TO 2009 2004 DIM T(3) 2005 DIM W(12) 2006 GO SUB 4000 2009 LET Q1=1 2011 LET T(1)=0 2012 LET T(2)=0 2013 LET T(3)=0 2015 LET T(1)=VAL Z$(1 TO 2) 2017 LET T(2)=VAL Z$(4 TO 5) 2019 LET T(3)=VAL Z$(7 TO 8) 2021 IF T(3)<48 THEN LET T(3)=T(3)+100 2023 LET T(3)=T(3)-48 2024 LET JJ=INT (1+T(3)/4) 2026 IF JJ<0 THEN LET JJ=0 2028 IF T(1)<3 AND (INT (T(3)/4)=(T(3)/4)) THEN LET JJ=JJ-1 2030 LET T(1)=W(T(1)) 2032 LET NZ=T(1)+T(2)+(T(3)*365)+JJ 2036 RETURN 3000 FOR B=0 TO 99 3001 LET Q7=(B/4)-INT (B/4) 3002 GO SUB 4500 3003 IF 0>=N-(365+Q7) THEN GO TO 3007 3004 LET N=(N-(365+Q7)) 3005 NEXT B 3006 STOP 3007 LET Q8=48+B 3008 LET Q(2)=28+Q7 3009 FOR A=1 TO 12 3010 IF 0>=N-Q(A) THEN GO TO 3020 3012 LET N=N-Q(A) 3014 NEXT A 3017 STOP 3020 LET Q9=A 3025 LET P7=N 3030 LET Z$=STR$ (Q9)+"/"+STR$ (P7)+"/"+STR$ (Q8) 3050 RETURN 4000 LET W(1)=0 4001 LET W(2)=31 4002 LET W(3)=59 4003 LET W(4)=90 4004 LET W(5)=120 4006 LET W(6)=151 4008 LET W(7)=181 4009 LET W(8)=212 4010 LET W(9)=243 4011 LET W(10)=273 4012 LET W(11)=304 4013 LET W(12)=334 4015 RETURN 4500 REM 4510 IF Q7=0 THEN LET Q7=1 4520 IF Q7=1 THEN RETURN 4530 LET Q7=0 4540 RETURN 5000 REM 5010 PRINT AT 10,10;"TS-STOCK" 5012 PRINT AT 11,3;"COVERED OPTION ANALYSIS" 5020 FOR N=1 TO 25 5030 NEXT N 5040 CLS 5099 RETURN