Stopping duplicate orders: the dedupe parameter

Autoview · Alert syntax

dedupe is how you stop Autoview placing the same order twice. You attach a value to your alert, Autoview remembers it, and the next time the alert fires with that same value, Autoview skips it. That is the whole job. It is the parameter you reach for when an alert can fire more than once for the same signal and you only want the first one to trade.

Here it is on an order:

e=oanda s=EUR_USD b=long q=2% dedupe=long-2026-06-22

The first time that line runs, Autoview has no stored value to match, so the order goes through and Autoview records long-2026-06-22. If the exact same line runs again, the value matches what it stored, and Autoview stops before placing the order a second time.

The rule: dedupe=value

Write dedupe= followed by a value of your choosing. It is a full word, not a single letter, so there is no short alias. The value is taken as a plain string, exactly as you type it, so it can be a word, a number, a date, a placeholder your platform fills in, or any combination.

Two things decide whether an alert is treated as a duplicate:

  • The alert it belongs to. Autoview stores the dedupe value against the alert that sent it. A value sent by one alert is compared only against the last value that same alert sent. Different alerts keep separate records.
  • The value itself. Within that one alert, the new dedupe value is compared, character for character, to the last value Autoview stored for it. Same value means duplicate. Any difference means new.

What it actually does

When Autoview hits a dedupe on a command, it looks up the last value it stored for that alert and compares it to the value you just sent.

  • If the value is new (different from the stored one, or there is nothing stored yet), Autoview saves the new value and carries on. The order runs as normal.
  • If the value is the same as the last one stored, Autoview treats the alert as a duplicate. It logs a De-dupe note and stops there. The rest of that alert does not run, so no order is placed.

That second case is the point. A matched dedupe halts the alert before the trade. So the value you send is what controls the gate: change it and the next signal passes, repeat it and the next signal is dropped.

One detail worth knowing: when a value matches and the alert is skipped, Autoview leaves the stored value as it was. It does not overwrite the record on a duplicate, only on a value it lets through.

The repainting problem, and why dedupe fixes it

Some TradingView strategies repaint. A signal appears on the current candle, the alert fires, then the candle moves and the signal changes or disappears, and the alert fires again. From your strategy's point of view that can be one decision. From Autoview's point of view it is several alerts arriving back to back, each one trying to place an order.

A double-fired alert is the same shape of problem from a different cause: the same signal reaching Autoview more than once. Without a gate, every one of those repeats places an order, and you end up stacked into a position you only meant to enter once.

dedupe closes that gate. If every repeated firing for the same signal carries the same dedupe value, only the first one trades. The repeats match the stored value and get dropped with a De-dupe log line. The trick is choosing a value that stays the same across the repeats you want to collapse, and changes when a genuinely new signal arrives.

Dedupe by UID: one value per real signal

The clean pattern is to give each genuine signal a unique id, a UID, and pass it as the dedupe value. Then "same signal" and "same value" mean the same thing. Repaints and double-fires of one signal all carry that one UID, so only the first trades. A new signal carries a new UID, which does not match anything stored, so it passes.

The natural UID is whatever is stable for a real signal and different for the next one. A bar timestamp is the common choice: every repaint of the candle shares its open time, and the next candle has a new open time. If your platform can stamp that into the alert, you have a ready-made UID.

// one entry per candle, repaints collapse into the first
e=oanda s=EUR_USD b=long q=2% dedupe={{time}}

Here {{time}} is a TradingView placeholder. TradingView substitutes the bar time before the alert is ever sent to Autoview, so Autoview receives a literal value. Every repaint of that candle sends the same time, matches the stored value, and is dropped. The next candle sends a different time, does not match, and trades. If your sending platform does not fill that placeholder, the value arrives as written and every firing looks identical, which collapses them all rather than just the repeats, so confirm your platform substitutes it.

You are not limited to a timestamp. Anything unique per signal works: a strategy-supplied trade id, a combination of side and bar, or any token your platform can make distinct per real entry. The rule is the same every time. Same value is treated as a repeat and skipped. A new value is treated as a new signal and allowed through.

A worked example

A repainting long that should only enter once per bar:

// repaints share the bar time, so only the first fires
e=kraken s=BTCUSD b=long q=10% sl=1.5% dedupe={{time}}

First firing for the bar: nothing stored matches, so Autoview opens the 10% long and records the bar time. The candle repaints and the alert fires again with the same bar time: it matches, Autoview logs De-dupe and stops, no second order. The next bar fires with a new time: no match, so it trades. One entry per real signal, however many times the alert repeats inside it.

Things worth knowing

  • A match stops the whole alert. On a duplicate, Autoview logs De-dupe and skips the remaining commands in that alert. Put dedupe on the alert you want gated, and remember that a match means nothing below it runs either.
  • The value is compared exactly. Matching is on the literal text of the value. A trailing space or a changed character makes it a different value, which Autoview treats as a new signal and lets through.
  • It is per alert, not global. Autoview keeps a separate stored value for each alert. A value used by one alert does not block another. The gate is between repeats of the same alert.
  • It compares against the last value only. Autoview stores one value per alert at a time. dedupe compares your new value to that one stored value, not to a history of everything the alert has ever sent.

What is certain, and what is not

Certain from the code: dedupe takes a plain string value; Autoview stores one value per alert; a value equal to the stored one is treated as a duplicate and the alert is skipped with a De-dupe log line, while a different or first-seen value is stored and allowed through; and on a duplicate the stored value is left unchanged.

Unknown from the code alone: exactly how long a stored value persists, and precisely how the alert identity that scopes the comparison is derived. If you need a UID scheme to behave a specific way across restarts or across very long gaps between signals, test it against your own alerts rather than assuming, and lean on values that are genuinely unique per signal.

For everything the order lines themselves can do, side, sizing, stops, order type and the rest, see the command reference, or the full alert syntax page.

Read the command reference