#NEWLINE# def __init__( self , dt , sid , amount , stop = None , limit = None , filled = 0 , commission = None , id = None ) : #NEWLINE# #INDENT# '\n        @dt - datetime.datetime that the order was placed\n        @sid - asset for the order.  called sid for historical reasons.\n        @amount - the number of shares to buy/sell\n                  a positive sign indicates a buy\n                  a negative sign indicates a sell\n        @filled - how many shares of the order have been filled so far\n        ' #NEWLINE# assert isinstance ( sid , Asset ) #NEWLINE# self . id = ( id or self . make_id ( ) ) #NEWLINE# self . dt = dt #NEWLINE# self . reason = None #NEWLINE# self . created = dt #NEWLINE# self . sid = sid #NEWLINE# self . amount = amount #NEWLINE# self . filled = filled #NEWLINE# self . commission = commission #NEWLINE# self . _status = ORDER_STATUS . OPEN #NEWLINE# self . stop = stop #NEWLINE# self . limit = limit #NEWLINE# self . stop_reached = False #NEWLINE# self . limit_reached = False #NEWLINE# self . direction = math . copysign ( 1 , self . amount ) #NEWLINE# self . type = zp . DATASOURCE_TYPE . ORDER #NEWLINE# self . broker_order_id = None