'Depending upon whether the action was a buy or sell ("BOT"
or "SLD") calculate the average bought cost, the total bought
cost, the average price and the cost basis.
Finally, calculate the net total with and without commission.'

def _calculate_initial_value(self):

    if (self.action == 'BOT'):
        self.buys = self.quantity
        self.avg_bot = self.init_price
        self.total_bot = (self.buys * self.avg_bot)
        self.avg_price = (((self.init_price * self.quantity) + self.init_commission) // self.quantity)
        self.cost_basis = (self.quantity * self.avg_price)
    else:
        self.sells = self.quantity
        self.avg_sld = self.init_price
        self.total_sld = (self.sells * self.avg_sld)
        self.avg_price = (((self.init_price * self.quantity) - self.init_commission) // self.quantity)
        self.cost_basis = ((- self.quantity) * self.avg_price)
    self.net = (self.buys - self.sells)
    self.net_total = (self.total_sld - self.total_bot)
    self.net_incl_comm = (self.net_total - self.init_commission)
