class_docstr: The current state of the positions held.
  
  Parameters
  ----------
  data_frequency : {'daily', 'minute'}
      The data frequency of the simulation.
class_docstr_tok: ["The","current","state","of","the","positions","held",".","Parameters","--","--","--","--","--","data_frequency",":","{","'daily","'",",","'minute","'","}","The","data","frequency","of","the","simulation","."]
code: def update_position(
      self,
      asset,
      amount=None,
      last_sale_price=None,
      last_sale_date=None,
      cost_basis=None,
  ):
      self._dirty_stats = True
  
      if asset not in self.positions:
          position = Position(asset)
          self.positions[asset] = position
      else:
          position = self.positions[asset]
  
      if amount is not None:
          position.amount = amount
      if last_sale_price is not None:
          position.last_sale_price = last_sale_price
      if last_sale_date is not None:
          position.last_sale_date = last_sale_date
      if cost_basis is not None:
          position.cost_basis = cost_basis
  
imports: from __future__ import division
  from collections import namedtuple, OrderedDict
  from functools import partial
  from math import isnan
  import logbook
  import numpy
  import pandas
  from six import iteritems, itervalues, PY2
  from zipline.assets import Future
  from zipline.finance.transaction import Transaction
  import zipline.protocol
  from zipline.utils.sentinel import sentinel
  from .position import Position
  from ._finance_ext import PositionStats, calculate_position_tracker_stats, update_position_last_sale_prices
label_desc: Use image node_id 2 for calling the PositionTracker obj's underlying member method code with example usage: obj.update_position(asset, amount, last_sale_price, last_sale_date, cost_basis) without return types