How can I prevent repeated entries on every candle in my TradingView strategy?

Asked by Radhesh Joshi · SOLVED
1 reply 214 views Jump to solution Reply
Radhesh Joshi Original Post
Strategy Builder

I’m developing my own TradingView strategy and I’ve noticed that sometimes it keeps generating Buy or Sell entries repeatedly, even though I’m already in an open position.

I only want my strategy to enter a trade once and wait until the current position is closed before taking another entry.

What is the recommended way to achieve this?

Posted Aug 3
Reply

    1 Reply

    Tech Support AlgoDelta
    Tech Support AlgoDelta Automation Expert ·

    Yes sir, this is a very common issue while developing TradingView strategies.

    In most cases, this doesn’t happen because of AlgoDelta. It happens because the strategy conditions remain true for multiple candles, so the strategy keeps generating new entry signals.

    To avoid this, your strategy should first check whether there is already an open position before creating a new entry.

    For example, if you’re using a Pine Script strategy, you can use strategy.position_size to determine whether a position is already open.

    -Only generate a Buy entry if there is currently no Buy position.

    -Only generate a Sell entry if there is currently no Sell position.

    -Wait until the existing position is closed before allowing a new entry.

    This ensures that your strategy enters only once for each trading opportunity instead of creating repeated entries on every candle.

    If you’re using AlgoDelta with either the JSON Bridge or the Custom Bridge, this approach is highly recommended because it prevents unnecessary duplicate trade signals from reaching the platform.

    So in simple terms:

    -Check whether a position is already open before generating a new entry.

    -Allow a new Buy or Sell signal only after the previous position has been exited.

    -This keeps your strategy clean, avoids repeated entries, and makes the automation much more reliable.

    Verified Solution
      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.