Skip to content

Instantly share code, notes, and snippets.

@kanzitelli
Last active November 11, 2017 03:29
Show Gist options
  • Save kanzitelli/04c52960e3e1d0bdf029708989a8abdc to your computer and use it in GitHub Desktop.
Save kanzitelli/04c52960e3e1d0bdf029708989a8abdc to your computer and use it in GitHub Desktop.
AAPL_p_01_01_2016 = 5000
number_of_shares_start = math.floor(AAPL_p_01_01_2016 / close_prices_2016.AAPL[0])
AAPL_p_12_31_2016 = number_of_shares_start * close_prices_2016.AAPL[-1]
print "1. Relative return for Apple = %.2f%%" % ( (AAPL_p_12_31_2016 - AAPL_p_01_01_2016) / AAPL_p_01_01_2016 * 100 )
AMZN_p_01_01_2016 = 5000
number_of_shares_start = math.floor(AMZN_p_01_01_2016 / close_prices_2016.AMZN[0])
AMZN_p_12_31_2016 = number_of_shares_start * close_prices_2016.AMZN[-1]
print "2. Relative return for Amazon = %.2f%%" % ( (AMZN_p_12_31_2016 - AMZN_p_01_01_2016) / AMZN_p_01_01_2016 * 100 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment