Open giorgiooriani opened 4 years ago
Good find, I modified the logic slightly and it should be working now, let me know if you still have issues!
Thanks! I am a complete novice at coding, how can I export the results in csv format? (stuff like portfolio returns and benchmark returns etc?) Also is it possible to have foreign stocks and have their gain converted to USD or vice versa? (taking into account the exchange rate at purchase and sale)
Good find, I modified the logic slightly and it should be working now, let me know if you still have issues!
Apologies, I just tried with your fix and it's still not displaying stocks added within the specified time period. It still only takes stocks purchased before stocks_start.
Thanks! I am a complete novice at coding, how can I export the results in csv format? (stuff like portfolio returns and benchmark returns etc?) Yup using the pandas library you can do
combined_df.to_csv('<whatever_you_want_the_final_name_as>.csv')
Also is it possible to have foreign stocks and have their gain converted to USD or vice versa? (taking into account the exchange rate at purchase and sale) This would need to be added. It would need to account for trading calendars in different markets and you'd need to merge historical currency exchange data for FX using a library like https://github.com/MicroPyramid/forex-python
Apologies, I just tried with your fix and it's still not displaying stocks added within the specified time period. It still only takes stocks purchased before stocks_start.
Could you send me 2 symbols and the start/end date you're using?
I have BA and AMD as two of the symbols I am using. The dates I am using are 16/03/2020 (or 2020, 03, 16 for your code) to yesterday.
edit: if it helps, if I move the start date forward to beyond the date I purchased the stock, it includes it. If the start date is before the purchase, it includes it
what were the purchase dates of BA and AMD??
Boeing was 24/04 and AMD was 14/04
Hi, when I insert my own stock portfolio csv, and change the stocks_start and stocks_end period, it only plots stocks bought before the stocks_start date. Any stocks bought within the time period are not graphed or calculated.
Thanks for the great work!