Python Forum
Stock Return calculation problem
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stock Return calculation problem
#9
Verify it yourself.
pct_change = percent_change(portfolio, "2013-01-01", "2013-01-10")
print(pct_change)  # Or just print a slice pct_change[:10]
weighted_change = pct_change * portfolio.values()
print(weighted_change)
I don't trust anyone to do anything correctly. I test and verify. You should do the same with your code.
Reply


Messages In This Thread
Stock Return calculation problem - by LFin - Sep-22-2022, 02:13 PM
RE: Stock Return calculation problem - by ibreeden - Sep-23-2022, 08:57 AM
RE: Stock Return calculation problem - by perfringo - Sep-23-2022, 11:23 AM
RE: Stock Return calculation problem - by LFin - Sep-23-2022, 06:46 PM
RE: Stock Return calculation problem - by perfringo - Sep-24-2022, 08:14 AM
RE: Stock Return calculation problem - by LFin - Sep-26-2022, 01:52 PM
RE: Stock Return calculation problem - by LFin - Sep-26-2022, 01:59 PM
RE: Stock Return calculation problem - by deanhystad - Sep-26-2022, 03:24 PM
RE: Stock Return calculation problem - by LFin - Sep-26-2022, 03:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Dataframe mean calculation problem: do we have to loop? sparkt 1 2,214 Aug-28-2020, 02:41 PM
Last Post: sparkt
  Any suggestions to improve BuySell stock problem efficiency? mrapple2020 0 1,401 May-13-2020, 06:19 PM
Last Post: mrapple2020
  Problem with simple 3D Vektor calculation Pythocodras 0 1,742 Dec-11-2019, 07:18 PM
Last Post: Pythocodras
  Matrix Calculation Problem arshad 4 2,735 Nov-04-2019, 03:48 PM
Last Post: baquerik
  Pass variable script return twice output problem Faruk 8 4,518 Dec-26-2018, 11:57 AM
Last Post: Faruk
  problem with function return value ujjwalrathod007 9 23,775 Sep-23-2016, 03:02 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020