Beispiel #1
0
    def sell(self,
             owner,
             data,
             size,
             price=None,
             plimit=None,
             exectype=None,
             valid=None,
             tradeid=0,
             oco=None,
             trailamount=None,
             trailpercent=None,
             parent=None,
             transmit=True,
             **kwargs):

        order = SellOrder(owner=owner,
                          data=data,
                          size=size,
                          price=price,
                          pricelimit=plimit,
                          exectype=exectype,
                          valid=valid,
                          tradeid=tradeid,
                          trailamount=trailamount,
                          trailpercent=trailpercent,
                          parent=parent,
                          transmit=transmit)

        order.addinfo(**kwargs)
        self._ocoize(order, oco)

        return self.submit(order)
    def sell(self, owner, data,
             size, price=None, plimit=None,
             exectype=None, valid=None, tradeid=0, oco=None,
             trailamount=None, trailpercent=None,
             parent=None, transmit=True,
             histnotify=False, _checksubmit=True,
             **kwargs):

        order = SellOrder(owner=owner, data=data,
                          size=size, price=price, pricelimit=plimit,
                          exectype=exectype, valid=valid, tradeid=tradeid,
                          trailamount=trailamount, trailpercent=trailpercent,
                          parent=parent, transmit=transmit,
                          histnotify=histnotify)
        #这里直接挂限价单了 
        orderInfo = self.fmexinterface.sell_post_only_limit_short("btcusd_p", price, 1)
        order.ref = orderInfo["data"]["id"]

        order.addinfo(**kwargs)
        self._ocoize(order, oco)

        if (orderInfo["data"]["status"] == "pending"):
            return self.submit(order, check=_checksubmit)

        return None
Beispiel #3
0
    def sell(self, owner, data,
             size, price=None, plimit=None,
             exectype=None, valid=None, tradeid=0,
             **kwargs):

        order = SellOrder(owner=owner, data=data,
                          size=size, price=price, pricelimit=plimit,
                          exectype=exectype, valid=valid, tradeid=tradeid)

        order.addinfo(**kwargs)

        return self.submit(order)
Beispiel #4
0
    def sell(self, owner, data,
             size, price=None, plimit=None,
             exectype=None, valid=None, tradeid=0,
             **kwargs):

        order = SellOrder(owner=owner, data=data,
                          size=size, price=price, pricelimit=plimit,
                          exectype=exectype, valid=valid, tradeid=tradeid)

        order.addinfo(**kwargs)

        return self.submit(order)
Beispiel #5
0
    def sell(self,
             owner,
             data,
             size,
             price=None,
             plimit=None,
             exectype=None,
             valid=None,
             tradeid=0,
             oco=None,
             trailamount=None,
             trailpercent=None,
             parent=None,
             transmit=True,
             histnotify=False,
             _checksubmit=True,
             **kwargs):

        price = 20 if price is None else price

        order = SellOrder(owner=owner,
                          data=data,
                          size=size,
                          price=price,
                          pricelimit=plimit,
                          exectype=exectype,
                          valid=valid,
                          tradeid=tradeid,
                          trailamount=trailamount,
                          trailpercent=trailpercent,
                          parent=parent,
                          transmit=transmit,
                          histnotify=histnotify)

        order.addinfo(**kwargs)
        self._ocoize(order, oco)

        return self.submit(order, check=_checksubmit)
Beispiel #6
0
    def sell(self, owner, data,
             size, price=None, plimit=None,
             exectype=None, valid=None, tradeid=0,
             **kwargs):

        order = SellOrder(owner=owner, data=data,
                          size=size, price=price, pricelimit=plimit,
                          exectype=exectype, valid=valid, tradeid=tradeid)
        order.addcomminfo(self.getcommissioninfo(data))
        order.addinfo(**kwargs)
        return self.o.order_create(order, **kwargs)