天择加密量化开放框架下载
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

891 lines
29 KiB

1 year ago
  1. # coding: utf-8
  2. """
  3. Gate API v4
  4. Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501
  5. Contact: support@mail.gate.io
  6. Generated by: https://openapi-generator.tech
  7. """
  8. import pprint
  9. import re # noqa: F401
  10. import six
  11. from gate_api.configuration import Configuration
  12. class FuturesOrder(object):
  13. """NOTE: This class is auto generated by OpenAPI Generator.
  14. Ref: https://openapi-generator.tech
  15. Do not edit the class manually.
  16. """
  17. """
  18. Attributes:
  19. openapi_types (dict): The key is attribute name
  20. and the value is attribute type.
  21. attribute_map (dict): The key is attribute name
  22. and the value is json key in definition.
  23. """
  24. openapi_types = {
  25. 'id': 'int',
  26. 'user': 'int',
  27. 'create_time': 'float',
  28. 'finish_time': 'float',
  29. 'finish_as': 'str',
  30. 'status': 'str',
  31. 'contract': 'str',
  32. 'size': 'int',
  33. 'iceberg': 'int',
  34. 'price': 'str',
  35. 'close': 'bool',
  36. 'is_close': 'bool',
  37. 'reduce_only': 'bool',
  38. 'is_reduce_only': 'bool',
  39. 'is_liq': 'bool',
  40. 'tif': 'str',
  41. 'left': 'int',
  42. 'fill_price': 'str',
  43. 'text': 'str',
  44. 'tkfr': 'str',
  45. 'mkfr': 'str',
  46. 'refu': 'int',
  47. 'auto_size': 'str',
  48. 'stp_id': 'int',
  49. 'stp_act': 'str',
  50. 'amend_text': 'str',
  51. }
  52. attribute_map = {
  53. 'id': 'id',
  54. 'user': 'user',
  55. 'create_time': 'create_time',
  56. 'finish_time': 'finish_time',
  57. 'finish_as': 'finish_as',
  58. 'status': 'status',
  59. 'contract': 'contract',
  60. 'size': 'size',
  61. 'iceberg': 'iceberg',
  62. 'price': 'price',
  63. 'close': 'close',
  64. 'is_close': 'is_close',
  65. 'reduce_only': 'reduce_only',
  66. 'is_reduce_only': 'is_reduce_only',
  67. 'is_liq': 'is_liq',
  68. 'tif': 'tif',
  69. 'left': 'left',
  70. 'fill_price': 'fill_price',
  71. 'text': 'text',
  72. 'tkfr': 'tkfr',
  73. 'mkfr': 'mkfr',
  74. 'refu': 'refu',
  75. 'auto_size': 'auto_size',
  76. 'stp_id': 'stp_id',
  77. 'stp_act': 'stp_act',
  78. 'amend_text': 'amend_text',
  79. }
  80. def __init__(
  81. self,
  82. id=None,
  83. user=None,
  84. create_time=None,
  85. finish_time=None,
  86. finish_as=None,
  87. status=None,
  88. contract=None,
  89. size=None,
  90. iceberg=None,
  91. price=None,
  92. close=False,
  93. is_close=None,
  94. reduce_only=False,
  95. is_reduce_only=None,
  96. is_liq=None,
  97. tif='gtc',
  98. left=None,
  99. fill_price=None,
  100. text=None,
  101. tkfr=None,
  102. mkfr=None,
  103. refu=None,
  104. auto_size=None,
  105. stp_id=None,
  106. stp_act=None,
  107. amend_text=None,
  108. local_vars_configuration=None,
  109. ): # noqa: E501
  110. # type: (int, int, float, float, str, str, str, int, int, str, bool, bool, bool, bool, bool, str, int, str, str, str, str, int, str, int, str, str, Configuration) -> None
  111. """FuturesOrder - a model defined in OpenAPI""" # noqa: E501
  112. if local_vars_configuration is None:
  113. local_vars_configuration = Configuration()
  114. self.local_vars_configuration = local_vars_configuration
  115. self._id = None
  116. self._user = None
  117. self._create_time = None
  118. self._finish_time = None
  119. self._finish_as = None
  120. self._status = None
  121. self._contract = None
  122. self._size = None
  123. self._iceberg = None
  124. self._price = None
  125. self._close = None
  126. self._is_close = None
  127. self._reduce_only = None
  128. self._is_reduce_only = None
  129. self._is_liq = None
  130. self._tif = None
  131. self._left = None
  132. self._fill_price = None
  133. self._text = None
  134. self._tkfr = None
  135. self._mkfr = None
  136. self._refu = None
  137. self._auto_size = None
  138. self._stp_id = None
  139. self._stp_act = None
  140. self._amend_text = None
  141. self.discriminator = None
  142. if id is not None:
  143. self.id = id
  144. if user is not None:
  145. self.user = user
  146. if create_time is not None:
  147. self.create_time = create_time
  148. if finish_time is not None:
  149. self.finish_time = finish_time
  150. if finish_as is not None:
  151. self.finish_as = finish_as
  152. if status is not None:
  153. self.status = status
  154. self.contract = contract
  155. self.size = size
  156. if iceberg is not None:
  157. self.iceberg = iceberg
  158. if price is not None:
  159. self.price = price
  160. if close is not None:
  161. self.close = close
  162. if is_close is not None:
  163. self.is_close = is_close
  164. if reduce_only is not None:
  165. self.reduce_only = reduce_only
  166. if is_reduce_only is not None:
  167. self.is_reduce_only = is_reduce_only
  168. if is_liq is not None:
  169. self.is_liq = is_liq
  170. if tif is not None:
  171. self.tif = tif
  172. if left is not None:
  173. self.left = left
  174. if fill_price is not None:
  175. self.fill_price = fill_price
  176. if text is not None:
  177. self.text = text
  178. if tkfr is not None:
  179. self.tkfr = tkfr
  180. if mkfr is not None:
  181. self.mkfr = mkfr
  182. if refu is not None:
  183. self.refu = refu
  184. if auto_size is not None:
  185. self.auto_size = auto_size
  186. if stp_id is not None:
  187. self.stp_id = stp_id
  188. if stp_act is not None:
  189. self.stp_act = 'cn'
  190. if amend_text is not None:
  191. self.amend_text = amend_text
  192. @property
  193. def id(self):
  194. """Gets the id of this FuturesOrder. # noqa: E501
  195. Futures order ID # noqa: E501
  196. :return: The id of this FuturesOrder. # noqa: E501
  197. :rtype: int
  198. """
  199. return self._id
  200. @id.setter
  201. def id(self, id):
  202. """Sets the id of this FuturesOrder.
  203. Futures order ID # noqa: E501
  204. :param id: The id of this FuturesOrder. # noqa: E501
  205. :type: int
  206. """
  207. self._id = id
  208. @property
  209. def user(self):
  210. """Gets the user of this FuturesOrder. # noqa: E501
  211. User ID # noqa: E501
  212. :return: The user of this FuturesOrder. # noqa: E501
  213. :rtype: int
  214. """
  215. return self._user
  216. @user.setter
  217. def user(self, user):
  218. """Sets the user of this FuturesOrder.
  219. User ID # noqa: E501
  220. :param user: The user of this FuturesOrder. # noqa: E501
  221. :type: int
  222. """
  223. self._user = user
  224. @property
  225. def create_time(self):
  226. """Gets the create_time of this FuturesOrder. # noqa: E501
  227. Creation time of order # noqa: E501
  228. :return: The create_time of this FuturesOrder. # noqa: E501
  229. :rtype: float
  230. """
  231. return self._create_time
  232. @create_time.setter
  233. def create_time(self, create_time):
  234. """Sets the create_time of this FuturesOrder.
  235. Creation time of order # noqa: E501
  236. :param create_time: The create_time of this FuturesOrder. # noqa: E501
  237. :type: float
  238. """
  239. self._create_time = create_time
  240. @property
  241. def finish_time(self):
  242. """Gets the finish_time of this FuturesOrder. # noqa: E501
  243. Order finished time. Not returned if order is open # noqa: E501
  244. :return: The finish_time of this FuturesOrder. # noqa: E501
  245. :rtype: float
  246. """
  247. return self._finish_time
  248. @finish_time.setter
  249. def finish_time(self, finish_time):
  250. """Sets the finish_time of this FuturesOrder.
  251. Order finished time. Not returned if order is open # noqa: E501
  252. :param finish_time: The finish_time of this FuturesOrder. # noqa: E501
  253. :type: float
  254. """
  255. self._finish_time = finish_time
  256. @property
  257. def finish_as(self):
  258. """Gets the finish_as of this FuturesOrder. # noqa: E501
  259. How the order was finished. - filled: all filled - cancelled: manually cancelled - liquidated: cancelled because of liquidation - ioc: time in force is `IOC`, finish immediately - auto_deleveraged: finished by ADL - reduce_only: cancelled because of increasing position while `reduce-only` set- position_closed: cancelled because of position close - stp: cancelled because self trade prevention # noqa: E501
  260. :return: The finish_as of this FuturesOrder. # noqa: E501
  261. :rtype: str
  262. """
  263. return self._finish_as
  264. @finish_as.setter
  265. def finish_as(self, finish_as):
  266. """Sets the finish_as of this FuturesOrder.
  267. How the order was finished. - filled: all filled - cancelled: manually cancelled - liquidated: cancelled because of liquidation - ioc: time in force is `IOC`, finish immediately - auto_deleveraged: finished by ADL - reduce_only: cancelled because of increasing position while `reduce-only` set- position_closed: cancelled because of position close - stp: cancelled because self trade prevention # noqa: E501
  268. :param finish_as: The finish_as of this FuturesOrder. # noqa: E501
  269. :type: str
  270. """
  271. allowed_values = [
  272. "filled",
  273. "cancelled",
  274. "liquidated",
  275. "ioc",
  276. "auto_deleveraged",
  277. "reduce_only",
  278. "position_closed",
  279. "reduce_out",
  280. "stp",
  281. ] # noqa: E501
  282. if self.local_vars_configuration.client_side_validation and finish_as not in allowed_values: # noqa: E501
  283. raise ValueError(
  284. "Invalid value for `finish_as` ({0}), must be one of {1}".format( # noqa: E501
  285. finish_as, allowed_values
  286. )
  287. )
  288. self._finish_as = finish_as
  289. @property
  290. def status(self):
  291. """Gets the status of this FuturesOrder. # noqa: E501
  292. Order status - `open`: waiting to be traded - `finished`: finished # noqa: E501
  293. :return: The status of this FuturesOrder. # noqa: E501
  294. :rtype: str
  295. """
  296. return self._status
  297. @status.setter
  298. def status(self, status):
  299. """Sets the status of this FuturesOrder.
  300. Order status - `open`: waiting to be traded - `finished`: finished # noqa: E501
  301. :param status: The status of this FuturesOrder. # noqa: E501
  302. :type: str
  303. """
  304. allowed_values = ["open", "finished"] # noqa: E501
  305. if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501
  306. raise ValueError(
  307. "Invalid value for `status` ({0}), must be one of {1}".format(status, allowed_values) # noqa: E501
  308. )
  309. self._status = status
  310. @property
  311. def contract(self):
  312. """Gets the contract of this FuturesOrder. # noqa: E501
  313. Futures contract # noqa: E501
  314. :return: The contract of this FuturesOrder. # noqa: E501
  315. :rtype: str
  316. """
  317. return self._contract
  318. @contract.setter
  319. def contract(self, contract):
  320. """Sets the contract of this FuturesOrder.
  321. Futures contract # noqa: E501
  322. :param contract: The contract of this FuturesOrder. # noqa: E501
  323. :type: str
  324. """
  325. if self.local_vars_configuration.client_side_validation and contract is None: # noqa: E501
  326. raise ValueError("Invalid value for `contract`, must not be `None`") # noqa: E501
  327. self._contract = contract
  328. @property
  329. def size(self):
  330. """Gets the size of this FuturesOrder. # noqa: E501
  331. Order size. Specify positive number to make a bid, and negative number to ask # noqa: E501
  332. :return: The size of this FuturesOrder. # noqa: E501
  333. :rtype: int
  334. """
  335. return self._size
  336. @size.setter
  337. def size(self, size):
  338. """Sets the size of this FuturesOrder.
  339. Order size. Specify positive number to make a bid, and negative number to ask # noqa: E501
  340. :param size: The size of this FuturesOrder. # noqa: E501
  341. :type: int
  342. """
  343. if self.local_vars_configuration.client_side_validation and size is None: # noqa: E501
  344. raise ValueError("Invalid value for `size`, must not be `None`") # noqa: E501
  345. self._size = size
  346. @property
  347. def iceberg(self):
  348. """Gets the iceberg of this FuturesOrder. # noqa: E501
  349. Display size for iceberg order. 0 for non-iceberg. Note that you will have to pay the taker fee for the hidden size # noqa: E501
  350. :return: The iceberg of this FuturesOrder. # noqa: E501
  351. :rtype: int
  352. """
  353. return self._iceberg
  354. @iceberg.setter
  355. def iceberg(self, iceberg):
  356. """Sets the iceberg of this FuturesOrder.
  357. Display size for iceberg order. 0 for non-iceberg. Note that you will have to pay the taker fee for the hidden size # noqa: E501
  358. :param iceberg: The iceberg of this FuturesOrder. # noqa: E501
  359. :type: int
  360. """
  361. self._iceberg = iceberg
  362. @property
  363. def price(self):
  364. """Gets the price of this FuturesOrder. # noqa: E501
  365. Order price. 0 for market order with `tif` set as `ioc` # noqa: E501
  366. :return: The price of this FuturesOrder. # noqa: E501
  367. :rtype: str
  368. """
  369. return self._price
  370. @price.setter
  371. def price(self, price):
  372. """Sets the price of this FuturesOrder.
  373. Order price. 0 for market order with `tif` set as `ioc` # noqa: E501
  374. :param price: The price of this FuturesOrder. # noqa: E501
  375. :type: str
  376. """
  377. self._price = price
  378. @property
  379. def close(self):
  380. """Gets the close of this FuturesOrder. # noqa: E501
  381. Set as `true` to close the position, with `size` set to 0 # noqa: E501
  382. :return: The close of this FuturesOrder. # noqa: E501
  383. :rtype: bool
  384. """
  385. return self._close
  386. @close.setter
  387. def close(self, close):
  388. """Sets the close of this FuturesOrder.
  389. Set as `true` to close the position, with `size` set to 0 # noqa: E501
  390. :param close: The close of this FuturesOrder. # noqa: E501
  391. :type: bool
  392. """
  393. self._close = close
  394. @property
  395. def is_close(self):
  396. """Gets the is_close of this FuturesOrder. # noqa: E501
  397. Is the order to close position # noqa: E501
  398. :return: The is_close of this FuturesOrder. # noqa: E501
  399. :rtype: bool
  400. """
  401. return self._is_close
  402. @is_close.setter
  403. def is_close(self, is_close):
  404. """Sets the is_close of this FuturesOrder.
  405. Is the order to close position # noqa: E501
  406. :param is_close: The is_close of this FuturesOrder. # noqa: E501
  407. :type: bool
  408. """
  409. self._is_close = is_close
  410. @property
  411. def reduce_only(self):
  412. """Gets the reduce_only of this FuturesOrder. # noqa: E501
  413. Set as `true` to be reduce-only order # noqa: E501
  414. :return: The reduce_only of this FuturesOrder. # noqa: E501
  415. :rtype: bool
  416. """
  417. return self._reduce_only
  418. @reduce_only.setter
  419. def reduce_only(self, reduce_only):
  420. """Sets the reduce_only of this FuturesOrder.
  421. Set as `true` to be reduce-only order # noqa: E501
  422. :param reduce_only: The reduce_only of this FuturesOrder. # noqa: E501
  423. :type: bool
  424. """
  425. self._reduce_only = reduce_only
  426. @property
  427. def is_reduce_only(self):
  428. """Gets the is_reduce_only of this FuturesOrder. # noqa: E501
  429. Is the order reduce-only # noqa: E501
  430. :return: The is_reduce_only of this FuturesOrder. # noqa: E501
  431. :rtype: bool
  432. """
  433. return self._is_reduce_only
  434. @is_reduce_only.setter
  435. def is_reduce_only(self, is_reduce_only):
  436. """Sets the is_reduce_only of this FuturesOrder.
  437. Is the order reduce-only # noqa: E501
  438. :param is_reduce_only: The is_reduce_only of this FuturesOrder. # noqa: E501
  439. :type: bool
  440. """
  441. self._is_reduce_only = is_reduce_only
  442. @property
  443. def is_liq(self):
  444. """Gets the is_liq of this FuturesOrder. # noqa: E501
  445. Is the order for liquidation # noqa: E501
  446. :return: The is_liq of this FuturesOrder. # noqa: E501
  447. :rtype: bool
  448. """
  449. return self._is_liq
  450. @is_liq.setter
  451. def is_liq(self, is_liq):
  452. """Sets the is_liq of this FuturesOrder.
  453. Is the order for liquidation # noqa: E501
  454. :param is_liq: The is_liq of this FuturesOrder. # noqa: E501
  455. :type: bool
  456. """
  457. self._is_liq = is_liq
  458. @property
  459. def tif(self):
  460. """Gets the tif of this FuturesOrder. # noqa: E501
  461. Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none # noqa: E501
  462. :return: The tif of this FuturesOrder. # noqa: E501
  463. :rtype: str
  464. """
  465. return self._tif
  466. @tif.setter
  467. def tif(self, tif):
  468. """Sets the tif of this FuturesOrder.
  469. Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none # noqa: E501
  470. :param tif: The tif of this FuturesOrder. # noqa: E501
  471. :type: str
  472. """
  473. allowed_values = ["gtc", "ioc", "poc", "fok"] # noqa: E501
  474. if self.local_vars_configuration.client_side_validation and tif not in allowed_values: # noqa: E501
  475. raise ValueError(
  476. "Invalid value for `tif` ({0}), must be one of {1}".format(tif, allowed_values) # noqa: E501
  477. )
  478. self._tif = tif
  479. @property
  480. def left(self):
  481. """Gets the left of this FuturesOrder. # noqa: E501
  482. Size left to be traded # noqa: E501
  483. :return: The left of this FuturesOrder. # noqa: E501
  484. :rtype: int
  485. """
  486. return self._left
  487. @left.setter
  488. def left(self, left):
  489. """Sets the left of this FuturesOrder.
  490. Size left to be traded # noqa: E501
  491. :param left: The left of this FuturesOrder. # noqa: E501
  492. :type: int
  493. """
  494. self._left = left
  495. @property
  496. def fill_price(self):
  497. """Gets the fill_price of this FuturesOrder. # noqa: E501
  498. Fill price of the order # noqa: E501
  499. :return: The fill_price of this FuturesOrder. # noqa: E501
  500. :rtype: str
  501. """
  502. return self._fill_price
  503. @fill_price.setter
  504. def fill_price(self, fill_price):
  505. """Sets the fill_price of this FuturesOrder.
  506. Fill price of the order # noqa: E501
  507. :param fill_price: The fill_price of this FuturesOrder. # noqa: E501
  508. :type: str
  509. """
  510. self._fill_price = fill_price
  511. @property
  512. def text(self):
  513. """Gets the text of this FuturesOrder. # noqa: E501
  514. User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance # noqa: E501
  515. :return: The text of this FuturesOrder. # noqa: E501
  516. :rtype: str
  517. """
  518. return self._text
  519. @text.setter
  520. def text(self, text):
  521. """Sets the text of this FuturesOrder.
  522. User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance # noqa: E501
  523. :param text: The text of this FuturesOrder. # noqa: E501
  524. :type: str
  525. """
  526. self._text = text
  527. @property
  528. def tkfr(self):
  529. """Gets the tkfr of this FuturesOrder. # noqa: E501
  530. Taker fee # noqa: E501
  531. :return: The tkfr of this FuturesOrder. # noqa: E501
  532. :rtype: str
  533. """
  534. return self._tkfr
  535. @tkfr.setter
  536. def tkfr(self, tkfr):
  537. """Sets the tkfr of this FuturesOrder.
  538. Taker fee # noqa: E501
  539. :param tkfr: The tkfr of this FuturesOrder. # noqa: E501
  540. :type: str
  541. """
  542. self._tkfr = tkfr
  543. @property
  544. def mkfr(self):
  545. """Gets the mkfr of this FuturesOrder. # noqa: E501
  546. Maker fee # noqa: E501
  547. :return: The mkfr of this FuturesOrder. # noqa: E501
  548. :rtype: str
  549. """
  550. return self._mkfr
  551. @mkfr.setter
  552. def mkfr(self, mkfr):
  553. """Sets the mkfr of this FuturesOrder.
  554. Maker fee # noqa: E501
  555. :param mkfr: The mkfr of this FuturesOrder. # noqa: E501
  556. :type: str
  557. """
  558. self._mkfr = mkfr
  559. @property
  560. def refu(self):
  561. """Gets the refu of this FuturesOrder. # noqa: E501
  562. Reference user ID # noqa: E501
  563. :return: The refu of this FuturesOrder. # noqa: E501
  564. :rtype: int
  565. """
  566. return self._refu
  567. @refu.setter
  568. def refu(self, refu):
  569. """Sets the refu of this FuturesOrder.
  570. Reference user ID # noqa: E501
  571. :param refu: The refu of this FuturesOrder. # noqa: E501
  572. :type: int
  573. """
  574. self._refu = refu
  575. @property
  576. def auto_size(self):
  577. """Gets the auto_size of this FuturesOrder. # noqa: E501
  578. Set side to close dual-mode position. `close_long` closes the long side; while `close_short` the short one. Note `size` also needs to be set to 0 # noqa: E501
  579. :return: The auto_size of this FuturesOrder. # noqa: E501
  580. :rtype: str
  581. """
  582. return self._auto_size
  583. @auto_size.setter
  584. def auto_size(self, auto_size):
  585. """Sets the auto_size of this FuturesOrder.
  586. Set side to close dual-mode position. `close_long` closes the long side; while `close_short` the short one. Note `size` also needs to be set to 0 # noqa: E501
  587. :param auto_size: The auto_size of this FuturesOrder. # noqa: E501
  588. :type: str
  589. """
  590. allowed_values = ["close_long", "close_short"] # noqa: E501
  591. if self.local_vars_configuration.client_side_validation and auto_size not in allowed_values: # noqa: E501
  592. raise ValueError(
  593. "Invalid value for `auto_size` ({0}), must be one of {1}".format( # noqa: E501
  594. auto_size, allowed_values
  595. )
  596. )
  597. self._auto_size = auto_size
  598. @property
  599. def stp_id(self):
  600. """Gets the stp_id of this FuturesOrder. # noqa: E501
  601. Orders between users in the same `stp_id` group are not allowed to be self-traded 1. If the `stp_id` of the two orders is not `0` and equal when matching, the trade will not be executed, but the strategy will be executed according to the `stp_act` of the `taker` 2. `stp_id` returns `0` by default for orders that have not been set for `STP group` # noqa: E501
  602. :return: The stp_id of this FuturesOrder. # noqa: E501
  603. :rtype: int
  604. """
  605. return self._stp_id
  606. @stp_id.setter
  607. def stp_id(self, stp_id):
  608. """Sets the stp_id of this FuturesOrder.
  609. Orders between users in the same `stp_id` group are not allowed to be self-traded 1. If the `stp_id` of the two orders is not `0` and equal when matching, the trade will not be executed, but the strategy will be executed according to the `stp_act` of the `taker` 2. `stp_id` returns `0` by default for orders that have not been set for `STP group` # noqa: E501
  610. :param stp_id: The stp_id of this FuturesOrder. # noqa: E501
  611. :type: int
  612. """
  613. self._stp_id = stp_id
  614. @property
  615. def stp_act(self):
  616. """Gets the stp_act of this FuturesOrder. # noqa: E501
  617. Self-Trading Prevention Action. Users can use this field to set self-trade prevetion strategies 1. After users join the `STP Group`, he can pass `stp_act` to limit the user's self-trade prevetion strategy. If `stp_act` is not passed, the default is `cn` strategy。 2. When the user does not join the `STP group`, an error will be returned when passing the `stp_act` parameter。 3. Users don't pass `stp_act` parameter when placing order, `stp_act` field of the order does not return - cn: Cancel newest, Cancel new orders and keep old ones - co: Cancel oldest, Cancel old orders and keep new ones - cb: Cancel both, Both old and new orders will be cancelled # noqa: E501
  618. :return: The stp_act of this FuturesOrder. # noqa: E501
  619. :rtype: str
  620. """
  621. return self._stp_act
  622. @stp_act.setter
  623. def stp_act(self, stp_act):
  624. """Sets the stp_act of this FuturesOrder.
  625. Self-Trading Prevention Action. Users can use this field to set self-trade prevetion strategies 1. After users join the `STP Group`, he can pass `stp_act` to limit the user's self-trade prevetion strategy. If `stp_act` is not passed, the default is `cn` strategy。 2. When the user does not join the `STP group`, an error will be returned when passing the `stp_act` parameter。 3. Users don't pass `stp_act` parameter when placing order, `stp_act` field of the order does not return - cn: Cancel newest, Cancel new orders and keep old ones - co: Cancel oldest, Cancel old orders and keep new ones - cb: Cancel both, Both old and new orders will be cancelled # noqa: E501
  626. :param stp_act: The stp_act of this FuturesOrder. # noqa: E501
  627. :type: str
  628. """
  629. allowed_values = ["co", "cn", "cb"] # noqa: E501
  630. if self.local_vars_configuration.client_side_validation and stp_act not in allowed_values: # noqa: E501
  631. raise ValueError(
  632. "Invalid value for `stp_act` ({0}), must be one of {1}".format(stp_act, allowed_values) # noqa: E501
  633. )
  634. self._stp_act = stp_act
  635. @property
  636. def amend_text(self):
  637. """Gets the amend_text of this FuturesOrder. # noqa: E501
  638. The custom data that the user remarked when amending the order # noqa: E501
  639. :return: The amend_text of this FuturesOrder. # noqa: E501
  640. :rtype: str
  641. """
  642. return self._amend_text
  643. @amend_text.setter
  644. def amend_text(self, amend_text):
  645. """Sets the amend_text of this FuturesOrder.
  646. The custom data that the user remarked when amending the order # noqa: E501
  647. :param amend_text: The amend_text of this FuturesOrder. # noqa: E501
  648. :type: str
  649. """
  650. self._amend_text = amend_text
  651. def to_dict(self):
  652. """Returns the model properties as a dict"""
  653. result = {}
  654. for attr, _ in six.iteritems(self.openapi_types):
  655. value = getattr(self, attr)
  656. if isinstance(value, list):
  657. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  658. elif hasattr(value, "to_dict"):
  659. result[attr] = value.to_dict()
  660. elif isinstance(value, dict):
  661. result[attr] = dict(
  662. map(
  663. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  664. value.items(),
  665. )
  666. )
  667. else:
  668. result[attr] = value
  669. return result
  670. def to_str(self):
  671. """Returns the string representation of the model"""
  672. return pprint.pformat(self.to_dict())
  673. def __repr__(self):
  674. """For `print` and `pprint`"""
  675. return self.to_str()
  676. def __eq__(self, other):
  677. """Returns true if both objects are equal"""
  678. if not isinstance(other, FuturesOrder):
  679. return False
  680. return self.to_dict() == other.to_dict()
  681. def __ne__(self, other):
  682. """Returns true if both objects are not equal"""
  683. if not isinstance(other, FuturesOrder):
  684. return True
  685. return self.to_dict() != other.to_dict()