Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pandas_datareader.data import get_quote_yahoo
- increasethreshold = 20
- ticker = 'DEB.L'
- purprice = 3.2
- #liveprice = 1.1
- liveprice = get_quote_yahoo(ticker)['price']
- print ("Purchase price: ", purprice)
- print (liveprice)
- if float(purprice) > float(liveprice):
- print ("Negative investment, sleeping...")
- else:
- print ("Positive investment, analysing...")
- diff = float(liveprice) - float(purprice)
- print ("Price increase of:", round(diff, 2))
- percentincrease = ((float(diff) / float(purprice) * 100))
- print ("Stock increase of:", round(percentincrease, 2,), "%")
- if (percentincrease) > (increasethreshold):
- print ("Stock", ticker, "has increased past", increasethreshold, "time to sell")
- else:
- print ("Stock", ticker, "has risen but not above", increasethreshold, "hang onto the stock")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement