Twinvest/synchrovest ms basic aka gwbasic program
users be aware subject to programming, logic or typo errors
Symbols
m=money installments monthly
p=initial price:or new price
tv=twinvest amount
n= shaeres owned
b=bank
e=a counter
a= action bought or sold in dollars
mo=money at risk or invested in shares
np =new price
v=value of shares owned in dollars
np=new price
Actual program code
10 clear:e=1
20 rem twinvest/synchrovest hybrid
30 rem due diligence"
40 clear
50 open"xyz" for output as #1
60 input "m";m
70 input "p";p
80 input "tv";tv
90 tv=int(tv)
100 n=m*.75/p:n=int(n*10)/10
110 b=.25*m:b=int(b*10)/10
120 read p
130 e=e+1
140 if p-0 goto 250
150 a=tv/p:a=int(aP10)/10: if -a<-m-b then a=b+m
160 b=b+m-a:b=int(b*100)/100
170 n=n+a/p
180 mo=mo+a:mo=int(mo*10)/10
190 np=p
200 v=n*np:v=int(v*1`0)/10
210 if v>1.1*mo then goto 290
220 if v<.9*mo then goto 440
230 write#!e,p,b,v,mo
240 goto 120
250 cls :print "total value ":b+v
260 print "bank ";b
270 print " number of shares ";n
280 close:end
290 b=b+(v-mo)
300 v=v-(v-mo)
310 n=n-(v-mo)/p
320 mo=mo-(v-mo)
330 goto 120
340data 8,5,4,5,8,10,8,5,4,5,8,0
440b=b-(mo-v)
450 v=v+(mo-v)
460n=n+(mo-v)/p
470mo=mo+(mo-v)
480 print "sell ";int(mo-v)/p
490 goto 120
500 rem ms dos twinvest synchrovest hybrid by infooverlad. DUE DILIGENCE PLEASE !
alternate for line 110 input"price ";p
your own data