Place a buy order. This is included to maintain backwards compatibility with older versions of cbpro-Python. For maximum support from docstrings and function signatures see the order type-specific functions place_limit_order, place_market_order, and place_stop_order.
(self, product_id, order_type, **kwargs)
| 283 | return self._send_message('post', '/orders', data=json.dumps(params)) |
| 284 | |
| 285 | def buy(self, product_id, order_type, **kwargs): |
| 286 | """Place a buy order. |
| 287 | |
| 288 | This is included to maintain backwards compatibility with older versions |
| 289 | of cbpro-Python. For maximum support from docstrings and function |
| 290 | signatures see the order type-specific functions place_limit_order, |
| 291 | place_market_order, and place_stop_order. |
| 292 | |
| 293 | Args: |
| 294 | product_id (str): Product to order (eg. 'BTC-USD') |
| 295 | order_type (str): Order type ('limit', 'market', or 'stop') |
| 296 | **kwargs: Additional arguments can be specified for different order |
| 297 | types. |
| 298 | |
| 299 | Returns: |
| 300 | dict: Order details. See `place_order` for example. |
| 301 | |
| 302 | """ |
| 303 | return self.place_order(product_id, 'buy', order_type, **kwargs) |
| 304 | |
| 305 | def sell(self, product_id, order_type, **kwargs): |
| 306 | """Place a sell order. |
nothing calls this directly
no test coverage detected