This could be a design issue or maybe there are some more efficient tools or path I'm not aware off. Below is my thought start from scratch but any other idea is greatly appreciated. 1. download store portfolio positions 2. download and store prices of each position very often. 3. calculate the portfolio total value at each sbapshot (daily) 4. calculate sharpe ratio based on the daily portfolio value. and store it. The final goal is I can flexibly compare the sharpe ratio of current portfolio and a proposed alternative strategies.
I can recommend https://github.com/erdewit/ib_insync. I had to develop a couple of scripts for a client and that library made it easier. Your task is fairly easy, you can ask for detailed steps at https://groups.io/g/insync
Thanks for the link. I was looking for a little different information, but thanks to you I found it very useful. Thank you!