Hello,
I'm testing an algo using a single security in minute frequency and want to determine the holding time (in minutes). So, after the order has been filled, how long (in minutes) have I had the open position. Hopefully that makes sense!
For the system, I would only have one position at a time, and its long/short.
Also, if my goal was to compare cost basis to last price in minute frequency, could I use context.portfolio.positions[sid].cost_basis which provides the cost basis per share VS compare context.portfolio.positions[sid].last_sale_price? Just want to make sure i'm comparing apples to apples :)
Thanks for the help!