How to close Nifty Option when opposite signal generates

Asked by Sejpalsinh Jadeja ·
1 reply 272 views Reply
Sejpalsinh Jadeja Original Post
AlgoDelta Team

I am using a Indicator which is generating Buy and Sell signals, I am using this indicator on Nifty chart, when a buy signal generates then I want to Buy a CE ATM of Nifty, when sell signal generates then I want to close CE and buy PE, but when I am selecting exit when opposite signal generates then it is not closing current opened position but it is opening opposite position. I.e if a CE is bought after buy signal, before TP if sell signal generates then it is not closing CE but buying PE. How to close PE before buying CE and closing CE before buying PE?

Posted Sep 3
Reply

    1 Reply

    Support AlgoDelta
    Support AlgoDelta AlgoDelta Support ·

    Yes sir, you can achieve this using AlgoDelta's JSON Bridge or Custom Bridge. Below are the steps to configure the Custom Bridge for your requirement.

    -Step 1: Create and Configure the Custom Bridge
    Create a Custom Bridge in AlgoDelta and configure the UP-side and DOWN-side executions according to your option trading strategy.

    -Step 2: Configure the UP-Side Execution
    Configure the UP-side execution to Buy a NIFTY ATM Call (CE), as shown below.
    image

    -Step 3: Configure the DOWN-Side Execution
    Configure the DOWN-side execution to Buy a NIFTY ATM Put (PE), as shown below.
    image

    -Step 4: Enable Exit on Opposite Signal
    Enable the Exit on Opposite Signal option in the Custom Bridge configuration.

    When an opposite signal arrives, the existing position is squared off according to the bridge configuration, and the new opposite-side position is entered.

    -Step 5: Connect Your Signal Source
    Connect the Custom Bridge to your signal source, such as TradingView alerts or your Python code, and configure it to send the appropriate UP and DOWN signals.

    Now the flow will be:

    BUY signal -> Buy NIFTY ATM CE

    SELL signal -> Exit the existing CE position and Buy NIFTY ATM PE

    BUY signal again -> Exit the existing PE position and Buy NIFTY ATM CE

    This way, you can configure your strategy to exit the existing option position when an opposite signal arrives before entering the new position.

      Markdown supported · ```json for code blocks · paste or drop screenshots

      Be specific and kind. Never share API keys, passwords or personal account details.

      Welcome to the community

      Log in or create your account in under a minute.

      1. 1Mobile
      2. 2E-mail
      3. 3Password
      +91

      Have a password?

      By continuing you agree to the community guidelines. We’ll send a one-time code by SMS.