Lets say I buy 10 shares of AAPL on the 1st of the month and then buy another 10 shares on the 15th. In my portfolio I'll see portfolio.ammount == 20 and portfolio.cost_basis == the cost basis of the two purchases
At the end of the month I want to sell the 10 shares I bought on the 1st and keep the 10 shares I bought on the 15th. Is this possible?
The example above is a really simple example. I'm asking this question because I'd like to write a script that can split my portfolio's cash into several buckets and then test multiple trading strategies side-by-side. Right now I need to write and run one script per strategy and it's a time consuming process.
Thanks