Skip to content

Instantly share code, notes, and snippets.

@JustinGuese
Created October 7, 2022 11:00
Show Gist options
  • Save JustinGuese/08add43a61947016e164ecb996566c67 to your computer and use it in GitHub Desktop.
Save JustinGuese/08add43a61947016e164ecb996566c67 to your computer and use it in GitHub Desktop.
Getting a baseline of data. See "getdata.py" on how to get data
startMoney = 10000
COMMISSION = 0.00025 # interactive brokers commission
howmany = startMoney / msft.iloc[0]["Adj Close"]
win = howmany * msft.iloc[-1]["Adj Close"] - startMoney
days = (msft.index[-1] - msft.index[0]).days
print("with just holding you would have made %.2f$" % win)
winPerMonth = win / (days / 30)
winPctPerYear = winPerMonth * 12 / startMoney * 100
print("or %.2f%% per year" % winPctPerYear)
print("or %.2f$ per month" % winPerMonth)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment