on_order_update

balasoft80

Hello,

What is equivalent python code for below java order listener?

tickerProvider.setOnOrderUpdateListener(new OnOrderUpdate() {
public void onOrderUpdate(Order order) {
}
});

The below method code not printing any of the orders. Could you please someone guide? The above java code prints all my orders

ticker.on_order_update = self.on_order_update

def on_order_update(self, ws, data):
self.onOrderUpdate(data)

thanks
Bala

  • rakeshr
    def on_order_update(self, ws, data):
    self.onOrderUpdate(data)
    ticker.on_order_update = self.on_order_update
    Yes, you have to use on_order_update, to receive order update stream. No need to add this onOrderUpdate again, you can just print the order update data. Something like:
    def on_order_update(ws, data):
    print("order update: ", data)

    # Order update callback
    kws.on_order_update = on_order_update
    You can go through python websocket example here.
Sign In or Register to comment.