Bitmex交易所中的被动委托用什么语句或接口能实现

Author: yzk520025, Created: 2018-11-22 15:56:16, Updated:

被动委托不会立刻在市场里成交,如果委托会立刻与市场里已有委托成交,那么该委托将被取消。 这个用语句如何实现?


More

小小梦 如果 交易所 有类似 这样的接口, 可以使用exchange.IO 调用。

小小梦 就是上面这个 IO 的形式 , 直接调用交易所接口, 参数写成 symbol=XXX&orderQty=YYY&price=ZZZ 这样的形式。

yzk520025 我要的就是下多单,平多单,下空单,平空单的被动委托,有吗?用语句怎么写?

小小梦 ``` # https://testnet.bitmex.com/api/v1 # POST /order ``` Limit: The default order type. Specify an orderQty and price. Market: A traditional Market order. A Market order will execute until filled or your bankruptcy price is reached, at which point it will cancel. MarketWithLeftOverAsLimit: A market order that, after eating through the order book as far as permitted by available margin, will become a limit order. The difference between this type and Market only affects the behavior in thin books. Upon reaching the deepest possible price, if there is quantity left over, a Market order will cancel the remaining quantity. MarketWithLeftOverAsLimit will keep the remaining quantity in the books as a Limit. Stop: A Stop Market order. Specify an orderQty and stopPx. When the stopPx is reached, the order will be entered into the book. On sell orders, the order will trigger if the triggering price is lower than the stopPx. On buys, higher. Note: Stop orders do not consume margin until triggered. Be sure that the required margin is available in your account so that it may trigger fully. Close Stops don't require an orderQty. See Execution Instructions below. StopLimit: Like a Stop Market, but enters a Limit order instead of a Market order. Specify an orderQty, stopPx, and price. MarketIfTouched: Similar to a Stop, but triggers are done in the opposite direction. Useful for Take Profit orders. LimitIfTouched: As above; use for Take Profit Limit orders. 这些是 订单类型参数,有止损单,止盈单 等等,你看那种是你需要的。 ``` var ret = exchange.IO("api", "POST", "/api/v1/order/bulk", param); ``` param 就是 访问接口时要 给接口的参数,可以写成 : symbol=XXX&orderQty=YYY&price=ZZZ BITMEX API 文档: https://testnet.bitmex.com/api/explorer/#!/Order/Order_new

yzk520025 好的 谢谢

小小梦 我看看接口,如果有了 我写个范例。

yzk520025 能帮我写一段吗?

小小梦 需要,最起码 需要调用下 交易所接口 ,发送订单,并且做后续处理 其实就是个简单小策略了。

yzk520025 那被动委托需要写策略吗?不懂怎么实现