I'm building a new plugin and found a point that I struggled with longer than expected. Would be great if anyone had some inputs on this one.
I want to calculate equity curves based on individual symbols and then aggregate on various factors. That means that I need a daily equity series showing each symbol's total gain or loss up until that day, counting both closed and open positions. That part seems a little more tricky than I had thought. It's easy to see how much a position gained or lost in total, but I can't seem to find a way to check how much the unrealized gain was up until a specified date.
There is an old post asking about this, but it doesn't really help in getting the day by day data. http://www.rightedgesystems.com/forums/12511/Equity-Curve-by-symbol
Would be great if anyone has some ideas on this.