|
4 | 4 |
|
5 | 5 | @author: gaoan |
6 | 6 | """ |
| 7 | +from tigeropen.trade.domain.contract import ContractLeg |
7 | 8 | from tigeropen.trade.domain.order import Order, OrderLeg, AlgoParams |
8 | | -from tigeropen.common.consts import OrderStatus |
| 9 | +from tigeropen.common.consts import OrderStatus, OrderType |
9 | 10 |
|
10 | 11 |
|
11 | 12 | def market_order(account, contract, action, quantity): |
@@ -164,6 +165,17 @@ def algo_order(account, contract, action, quantity, strategy, algo_params=None, |
164 | 165 | limit_price=limit_price, outside_rth=False) |
165 | 166 |
|
166 | 167 |
|
| 168 | +def contract_leg(symbol=None, sec_type=None, expiry=None, strike=None, put_call=None, action=None, |
| 169 | + ratio=1): |
| 170 | + return ContractLeg(symbol=symbol, sec_type=sec_type, expiry=expiry, strike=strike, put_call=put_call, |
| 171 | + action=action, ratio=ratio) |
| 172 | + |
| 173 | + |
| 174 | +def combo_order(account, contract_legs, combo_type, action, quantity, order_type=OrderType.LMT.value, limit_price=None, |
| 175 | + aux_price=None, trailing_percent=None): |
| 176 | + return Order(account, None, action=action, order_type=order_type, quantity=quantity, limit_price=limit_price, |
| 177 | + aux_price=aux_price, trailing_percent=trailing_percent, combo_type=combo_type, |
| 178 | + contract_legs=contract_legs) |
167 | 179 | def get_order_status(value): |
168 | 180 | """ |
169 | 181 | Invalid(-2), Initial(-1), PendingCancel(3), Cancelled(4), Submitted(5), Filled(6), Inactive(7), PendingSubmit(8) |
|
0 commit comments