repl.it
@justinholman/

StockMarketSim

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import numpy
sims,years,beginbal = 100,40,10000
mean,stdev = .1188,.1976
endbal=[]

for i in range(sims): 
  stockmarketsim = numpy.random.normal(mean,stdev,years)
  bal=beginbal

  for j in range(years):
    bal=bal*(1+stockmarketsim[j])
  endbal.append(round(bal,2))

print(endbal)