(self, quantity, price)
return self._curl_bitmex(api=endpoint, postdict=postdict, verb="POST")
Place an order.
Place an order.
Place an order .
def place_order(self, quantity, price):
        """Place an order."""
        if price < 0:
            raise Exception("Price must be positive.")

        endpoint = "order"
        # Generate a unique clOrdID with our prefix so we can identify it.
        clOrdID = self.orderIDPrefix + base64.b64encode(uuid.uuid4().bytes).decode('utf-8').rstrip('=\n')
        postdict = {
            'symbol': self.symbol,
            'orderQty': quantity,
            'price': price,
            'clOrdID': clOrdID,
            'execInst': 'ParticipateDoNotInitiate'
        }
        return self._curl_bitmex(api=endpoint, postdict=postdict, verb="POST")
def place_order ( self , quantity , price ) : if price < 0 : raise Exception ( "Price must be positive." ) endpoint = "order" # Generate a unique clOrdID with our prefix so we can identify it. clOrdID = self . orderIDPrefix + base64 . b64encode ( uuid . uuid4 ( ) . bytes ) . decode ( 'utf-8' ) . rstrip ( '=\n' ) postdict = { 'symbol' : self . symbol , 'orderQty' : quantity , 'price' : price , 'clOrdID' : clOrdID , 'execInst' : 'ParticipateDoNotInitiate' } return self . _curl_bitmex ( api = endpoint , postdict = postdict , verb = "POST" )