Skip to content

Commit ceb8b6e

Browse files
committed
modify OrderLeg attribute
1 parent 6522ac1 commit ceb8b6e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tigeropen/trade/domain/order.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def __init__(self, leg_type, price, time_in_force='DAY', outside_rth=None):
131131
:param time_in_force: 附加订单有效期. 'DAY'(当日有效)和'GTC'(取消前有效).
132132
:param outside_rth: 附加订单是否允许盘前盘后交易(美股专属). True 允许, False 不允许.
133133
"""
134-
self.type = leg_type
134+
self.leg_type = leg_type
135135
self.price = price
136136
self.time_in_force = time_in_force
137137
self.outside_rth = outside_rth

tigeropen/trade/request/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,15 +557,15 @@ def to_openapi_dict(self):
557557

558558
if self.order_legs:
559559
for order_leg in self.order_legs:
560-
if order_leg.type == 'PROFIT':
560+
if order_leg.leg_type == 'PROFIT':
561561
params['attach_type'] = 'PROFIT'
562562
if order_leg.price is not None:
563563
params['profit_taker_price'] = order_leg.price
564564
if order_leg.time_in_force is not None:
565565
params['profit_taker_tif'] = order_leg.time_in_force
566566
if order_leg.outside_rth is not None:
567567
params['profit_taker_rth'] = order_leg.outside_rth
568-
if order_leg.type == 'LOSS':
568+
if order_leg.leg_type == 'LOSS':
569569
params['attach_type'] = 'LOSS'
570570
if order_leg.price is not None:
571571
params['stop_loss_price'] = order_leg.price

0 commit comments

Comments
 (0)