Home Forums Trading view How can I prevent repeated entries on every candle in my TradingView strategy?

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

  • Author
    Posts
    • 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?

    • 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.

Viewing 1 reply thread
×

Start a Discussion

Get help from the AlgoDelta community.

×

Welcome Back!

Enter your email to sign in or create an account. No passwords needed.

⚠️

Delete This?

Are you sure you want to delete this? This action is permanent and cannot be undone.

Scroll to Top