add "PortfolioState" to track all the portfolio changes;
move the Equity to Portfolio;
combined the position removal and equity change calculation