Pausing ticks while placing order

We have placed our ordering logic inside on_ticks() function which is executed on each tick. When the stock price is correct as per logic we place the order. As our code is inside on_ticks() function it is placing multiple orders. Is there a way I can stop next ticks until I place an order?
  • Vivek
    `on_ticks` is a blocking method and it won't be called again unless you return the function. Ideally you should run your order placing login in separate thread and not block the main thread. The reason is you will miss or get stale ticks which could screw your business logic.
  • tonystark
    This can be handled with a simple boolean flag "ignore_ticks". Before starting the logic for placing order make it true. And on ticks if this is true don't do anything.

    This is more of a programming doubt. It is not under scope of the library or this forum.
This discussion has been closed.