#NEWLINE# def __init__( self , action , ticker , init_quantity , init_price , init_commission , bid , ask ) : #NEWLINE# #INDENT# '\n        Set up the initial "account" of the Position to be\n        zero for most items, with the exception of the initial\n        purchase/sale.\n\n        Then calculate the initial values and finally update the\n        market value of the transaction.\n        ' #NEWLINE# self . action = action #NEWLINE# self . ticker = ticker #NEWLINE# self . quantity = ask #NEWLINE# self . init_price = init_price #NEWLINE# self . init_commission = init_commission #NEWLINE# self . realised_pnl = Decimal ( '0.00' ) #NEWLINE# self . unrealised_pnl = Decimal ( '0.00' ) #NEWLINE# self . buys = Decimal ( '0' ) #NEWLINE# self . sells = Decimal ( '0' ) #NEWLINE# self . avg_bot = Decimal ( '0.00' ) #NEWLINE# self . avg_sld = Decimal ( '0.00' ) #NEWLINE# self . total_bot = Decimal ( '0.00' ) #NEWLINE# self . total_sld = Decimal ( '0.00' ) #NEWLINE# self . total_commission = init_commission #NEWLINE# self . _calculate_initial_value ( ) #NEWLINE# self . update_market_value ( bid , ask )