How does Square off work for closing positions from this automation or across the account?

How Does Square Off Work for Closing Positions From This Automation or Across the Account?

The square off action in Automate is used to exit open positions when an automation reaches a specific trigger, condition, or exit path. Depending on the selected action type, it can close only positions created by the current automation or positions across the entire account.

This action directly places exit orders for live positions.

How does Square off work?

When a square off action node is executed:

  • Exit orders are placed for the applicable open positions.
  • Only positions that are currently open are considered.
  • The scope of positions exited depends on the selected square off action type.
  • The automation continues to the next connected node after the square off attempt.

Types of square off action

FYERS Automate provides multiple square off action types, allowing you to control exactly which positions are exited.

1) Square off automation positions

  • Exits only the positions opened by the current automation.
  • Positions from other automations or manual trades are not affected.

2) Square off all positions

  • Exits all open positions across the account, across all segments.
  • Includes automation positions and manually placed positions.

3) Square off positions by segment

  • Exits positions only in the selected segments.
  • Available segment options include:
    • NSE capital market
    • NSE equity derivatives
    • NSE currency derivatives
    • NSE commodity derivatives
    • BSE capital market
    • BSE equity derivatives
    • BSE currency derivatives
    • MCX commodity derivatives
  • You can further filter exits by product type:
    • CNC
    • INTRADAY
    • MARGIN
    • CO
    • BO

4) Square off all options positions

  • Exits all open positions in the options segment.

5) Square off all NSE options positions

  • Exits all open options positions in NSE only.

6) Square off all commodity positions

  • Exits all open positions in the commodity segment.

7) Square off all intraday positions

  • Exits all open intraday positions across segments.

Steps to use square off action in Automate

Follow these steps when building a new automation from scratch.

  • Log in to FYERS Web and go to Automate → Dashboard.
  • Click Create automation.
  • In the workflow canvas, add the required start, trigger, or condition nodes.
  • In the left panel, open the Actions tab.
  • Expand Square off.
  • Click the required Square off action to add it to the canvas.
  • Click the Square off node to open Edit node configuration.
  • Select the required Action type.
  • If applicable, select the segments and product types.
  • Click Apply to save the configuration.
  • Click Validate to ensure the automation has no errors.
  • After successful validation, click Run now or schedule the automation.


Use square off automation positions to ensure only trades created by the current automation are exited.

Last updated: 22 Dec 2025