How does Orderbook check work for counting pending, executed, cancelled, or rejected orders?

How does Orderbook check work for counting pending, executed, cancelled, or rejected orders?

Orderbook check is a Trigger type in FYERS Automate that lets your automation move forward only after a specific number of orders reach a selected orderbook status during the same automation run. This trigger is used to control the flow of your strategy based on what happened to orders placed earlier, and it never places or modifies orders by itself.

What Orderbook check does

Orderbook check continuously looks at orders created by the current automation run, counts how many of them are in a particular status, and allows the automation to continue only when the count reaches the value you set. If the required count is not reached, the automation waits at that step.

Order statuses you can count using Orderbook check

No. of orders executed

This option counts how many orders placed by the automation have been fully executed (traded), meaning the entire order quantity has been filled at the exchange.

Example: You place 3 entry orders and want to proceed only after all of them are filled. You set Orderbook check to continue when executed orders = 3. The automation moves forward only after all three orders are traded.


No. of pending orders

This option counts how many orders are currently pending, meaning they are placed but not yet executed due to price, liquidity, or market conditions.

Example: You place 5 limit orders and want to act if none of them execute. You set Orderbook check to continue when pending orders = 5. The automation moves forward when all orders remain pending.


No. of cancelled orders

This option counts how many orders placed by the automation have been cancelled, either manually, automatically, or by system logic.

Example: You expect fallback orders to get cancelled before switching strategy. You set Orderbook check to continue when cancelled orders = 2. Once two orders are cancelled, the automation proceeds.


No. of rejected orders

This option counts how many orders have been rejected due to reasons such as insufficient margin, invalid parameters, or exchange rules.

Example: You want to stop trading if too many orders fail. You set Orderbook check to continue when rejected orders = 1. As soon as one order is rejected, the automation moves to the next step.


How Orderbook check behaves

  • The automation waits until the selected order status count reaches your defined value.
  • Only the chosen order status is counted; other statuses are ignored.
  • If the condition is never met, the automation does not move forward.
  • Multiple Orderbook checks can be used to handle different outcomes.
Notes: Orderbook check evaluates only orders created by the same automation run. Each Orderbook check can monitor only one order status at a time. This trigger is commonly used before placing exits, retries, alerts, or stopping an automation. Orderbook check controls flow logic, not price movement or execution itself.

What If?

ScenarioWhat happens
Orders execute one by oneThe executed order count increases until it reaches the set value.
Orders stay pendingThe automation waits until the pending count condition is met.
Orders are rejected instead of executedThe automation moves forward only if rejection was the selected status.
I want different actions for success and failureUse multiple Orderbook checks on separate branches.
The required count never occursThe automation remains paused at that step.

Last updated: 22 Dec 2025