#NEWLINE# def calculate( self , transaction ) : #NEWLINE# #INDENT# '\n        returns a tuple of:\n        (per share commission, total transaction commission)\n        ' #NEWLINE# commission = abs ( ( transaction . amount * self . cost ) ) #NEWLINE# if ( self . min_trade_cost is None ) : #NEWLINE# #INDENT# return ( self . cost , commission ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# commission = max ( commission , self . min_trade_cost ) #NEWLINE# return ( abs ( ( commission / transaction . amount ) ) , commission )