@@ -376,15 +376,17 @@ def from_e_order(**kwargs):
376376 order .security = kwargs ['symbol' ]
377377 order .style = OrderStyle (kwargs ['type' ])
378378 order .price = kwargs ['price' ]
379- order .amount = kwargs ['amount' ]
379+ order .amount = kwargs .get ('amount' , 0 )
380+ order .amountProportion = kwargs .get ('amountProportion' )
380381 return order
381382
382- def __init__ (self , id = None , action = None , security = None , amount = None , price = None , style = None ,
383+ def __init__ (self , id = None , action = None , security = None , amount = None , amountProportion = None , price = None , style = None ,
383384 status = OrderStatus .open , add_time = None ):
384385 self ._id = id
385386 self ._action = action
386387 self ._security = security
387388 self ._amount = amount
389+ self ._amountProportion = amountProportion
388390 self ._price = price
389391 self ._style = style
390392 self ._status = status
@@ -407,7 +409,8 @@ def to_e_order(self):
407409 type = self ._style .name ,
408410 priceType = (0 if self ._style == OrderStyle .LIMIT else 4 ),
409411 price = self ._price ,
410- amount = self ._amount
412+ amount = self ._amount ,
413+ amountProportion = self ._amountProportion
411414 )
412415 return e_order
413416
@@ -447,6 +450,14 @@ def amount(self):
447450 def amount (self , value ):
448451 self ._amount = value
449452
453+ @property
454+ def amountProportion (self ):
455+ return self ._amountProportion
456+
457+ @amountProportion .setter
458+ def amountProportion (self , value ):
459+ self ._amountProportion = value
460+
450461 @property
451462 def price (self ):
452463 return self ._price
0 commit comments