'The PortfolioHandler is designed to interact with the
backtesting or live trading overall event-driven
architecture. It exposes two methods, on_signal and
on_fill, which handle how SignalEvent and FillEvent
objects are dealt with.
Each PortfolioHandler contains a Portfolio object,
which stores the actual Position objects.
The PortfolioHandler takes a handle to a PositionSizer
object which determines a mechanism, based on the current
Portfolio, as to how to size a new Order.
The PortfolioHandler also takes a handle to the
RiskManager, which is used to modify any generated
Orders to remain in line with risk parameters.'

def __init__(self, initial_cash, events_queue, price_handler, position_sizer, risk_manager):

    self.initial_cash = initial_cash
    self.events_queue = events_queue
    self.price_handler = price_handler
    self.position_sizer = position_sizer
    self.risk_manager = risk_manager
    self.portfolio = Portfolio(price_handler, initial_cash)
