trader/core/portfolio/portfolio.py
def __add_position(self, timestamp, action, ticker, quantity, price,
                       commission):
        """
        Adds a new Position object to the Portfolio.
        """
        if ticker not in self.positions:
            position = Position(
                timestamp, action, ticker, quantity, price, commission
            )
            self.positions[ticker] = position
        else:
            print(
                "Ticker %s is already in the positions list. "
                "Could not add a new position." % ticker
            )

        Adds a new Position object to the Portfolio.
        
Adds a new Position object to the Portfolio.
Adds a new Position object to the Portfolio .
def __add_position(self, timestamp, action, ticker, quantity, price,
                       commission):
        if ticker not in self.positions:
            position = Position(
                timestamp, action, ticker, quantity, price, commission
            )
            self.positions[ticker] = position
        else:
            print(
                "Ticker %s is already in the positions list. "
                "Could not add a new position." % ticker
            )
def __add_position ( self , timestamp , action , ticker , quantity , price , commission ) : if ticker not in self . positions : position = Position ( timestamp , action , ticker , quantity , price , commission ) self . positions [ ticker ] = position else : print ( "Ticker %s is already in the positions list. " "Could not add a new position." % ticker )
Adds a new Position object to the Portfolio.
Adds a new Position object to the Portfolio .
"""
        Adds a new Position object to the Portfolio.
        """
self
timestamp
action
ticker
quantity
price
commission