Alert counting on the webhook: trade only on the last alert of a sequence
Sometimes one signal is not enough. You want three conditions to fire in a set order, and only then place the trade. Alert counting does that. Each alert says which step it is with ac=, and Autoview keeps count on its side. The order goes out only when the last step arrives right after the ones before it.
This page covers alerts sent to your Autoview webhook URL. The Chrome extension keeps its own, separate counter, and a sequence started on one does not carry over to the other.
The shape of a counted alert
Each alert in the sequence has two parts. The first line holds the count. The lines after it hold the order.
ac=1/3 acg=breakout
s=EUR_USD b=long q=2%ac=1/3means step 1 of 3. Write it as a fraction. A number with no slash, such asac=3, is read as1/1, and a missing or zero part counts as 1.acg=breakoutnames the counter. Leave it off and the alert uses a counter nameddefault. Letter case does not matter, soacg=Breakoutis the same counter.- The line that carries
ac=never places an order itself. Put the order on the next line, or after a pipe on the same line:ac=1/3 acg=breakout | s=EUR_USD b=long q=2%.
Watch that last point. An alert like ac=3/3 s=EUR_USD b=long q=2% on one line counts the step and then sends nothing, even on the final step, because the order sits on the count line.
A three-step example
Set up three alerts, one for each condition, in whatever tool sends your webhooks. They differ only in the step:
ac=1/3 acg=breakout
s=EUR_USD b=long q=2%ac=2/3 acg=breakout
s=EUR_USD b=long q=2%ac=3/3 acg=breakout
s=EUR_USD b=long q=2%When they arrive in order, this is what happens:
- Step 1 arrives. Nothing is sent. The event log shows
Alert Count (breakout): 1 / 3. - Step 2 arrives. Nothing is sent. The event log shows
Alert Count (breakout): 2 / 3. - Step 3 arrives. The order line
s=EUR_USD b=long q=2%goes to your linked account. The event log showsAlert Count (breakout): 3 / 3.
Only the line after ac= is sent, never the count line. If your webhook is linked to several accounts, the counter still steps once per alert, and every linked account gets the order on the last step.
What breaks the sequence
The counter moves forward only one step at a time. Anything else resets it to zero, and that alert sends nothing:
- A step out of order.
ac=2/3with no step 1 before it resets. - A skipped step.
ac=1/3followed byac=3/3resets. - A repeat. The same step twice in a row resets, including the last one. After
ac=3/3has traded, a secondac=3/3sends nothing.
A reset shows in the event log as Alert Count (breakout): reset. Step 1 always starts over, so an ac=1/3 after a reset puts you back at the start of the sequence.
This is why alert counting is not a way to act on every third copy of the same alert. Three copies of ac=1/3 each restart at step 1 and never reach step 3. Each condition needs its own alert with its own step number.
ac=1/1, and a bare number like ac=3, pass every time. They count as a one-step sequence, so a repeat never blocks them.
Running more than one sequence
Each acg= name has its own counter, so two strategies on the same account can count separately: give each its own name. Two alerts that share a name share a counter, even if they come in on different webhook URLs on your account. A step from one strategy can then break the other's sequence.
The counter does not reset on a timer. It only moves when an alert with ac= arrives for that name.
Lines before and after the count
Autoview reads an alert from the top down. Lines above the ac= line are not counted and always go out. Lines below it go out only on a final step that keeps the sequence intact. Take this alert:
c=order s=EUR_USD
ac=1/2 acg=pre
s=EUR_USD b=long q=2%The cancel on the first line is sent. The count is step 1 of 2, so the entry on the third line is not.
If the counter cannot be reached
When Autoview cannot reach the counter, it does not guess. The ac= line and every line after it are dropped, lines above it still go out, and the event log shows an entry that starts Alert Count (breakout): the counter could not be reached and ends so this line and the lines after it were not sent. That entry carries status 503. Your webhook sender still gets a normal reply.
Test it first
Point the sequence at a demo account, or add d=1 to the order line while you try it. Fire the steps in order and check the event log for each count line before you aim it at a funded account. Testing and debugging covers d=1 and the log.
FAQ
What does ac=2/3 mean in an Autoview webhook alert?
It marks this alert as step 2 of a 3-step sequence. Autoview keeps a counter for your account and only lets the order lines through when step 3 arrives right after steps 1 and 2. Steps 1 and 2 place nothing.
Can ac= make Autoview act on every 3rd alert?
Not by sending the same alert three times. Each alert has to say which step it is, so you need one alert with ac=1/3, one with ac=2/3 and one with ac=3/3. Sending ac=1/3 again only restarts the sequence at step 1.
Why did my ac= alert place nothing even on the last step?
On the webhook, the line that carries ac= never places an order itself. Put ac= on its own line, or before a pipe, and put the order on the next line.
What is acg= for?
acg= names the counter. Sequences with different names never affect each other. Without acg=, the alert uses a counter named default. The name is not case-sensitive.
A note on what Autoview is. Autoview is an execution tool, not a trading or investment advisor. It places the orders your own alerts tell it to. It does not generate signals, recommend trades, or make any claim about results. Trading carries risk of loss. See our disclosures.