Using the delay parameter
delay tells Autoview to wait before it runs the next part of your alert. That is the whole job. You give it a number of seconds, Autoview pauses for that long, then it carries on. It is the tool you reach for when one alert needs to do two or three things in order rather than all at once.
Here it is in one line:
delay=5
On its own line, that is a five-second pause. Nothing trades. Autoview reads the line, waits five seconds, and moves to whatever comes next.
The rule: delay=seconds
Write delay= followed by a number of seconds. It is a full word, not a single letter, so there is no short alias to memorize. (If you have seen l= around, that one is Leverage, not delay. They are unrelated.)
Three things about the number:
- It is in seconds.
delay=5waits five seconds.delay=30waits half a minute. - Decimals work. Need a sub-second pause?
delay=0.5waits half a second,delay=0.1waits about a tenth of one. Useful for nudging two orders just far enough apart. - It has to be positive.
delay=0and negative values are treated as invalid and dropped, which makes sense: a zero-second wait is just no wait.
What it actually does
When Autoview hits a delay, it stops on that line and holds for the time you asked. It also keeps its worker awake for the full pause, so the wait completes and the lines after it still run. You are not firing-and-forgetting; the rest of the alert is queued behind the pause and runs the moment it ends.
A delay line on its own does not place an order. It is purely a pause between the lines around it. That is the cleanest way to use it, and the one most people want.
When to use it
The common case is a single alert that sends more than one order. By default the lines in an alert run back to back, as fast as Autoview can process them. Sometimes you do not want that.
- Stagger a scale-in or scale-out. Open part of a position, wait, then add to it, so the two fills are not stacked on the same instant.
- Let one action settle before the next. Close a position, pause a beat, then open the other side, rather than sending both at once.
- Space out requests. If you are sending several orders in a burst, a short pause between them spreads the load instead of hammering the exchange in one go.
A worked example
Two entries from one alert, spaced three seconds apart:
// first tranche
e=oanda s=EUR_USD b=long q=1%
delay=3
// second tranche
e=oanda s=EUR_USD b=long q=1%Autoview opens the first 1%, waits three seconds, then opens the second. The two comment lines just label the log so you can read back what happened. Swap the 3 for whatever spacing you want, or use a decimal like delay=0.5 to make it tight.
Things worth knowing
- The pause blocks the rest of that alert. While Autoview is waiting, the lines after the delay are on hold. That is the point, but it means a long
delayholds up everything below it. Keep waits as short as the job needs. - It runs in sequence, per alert. A delay spaces out the lines within one alert. It does not schedule anything for later or carry over to a future alert.
- Positive numbers only. If a delay seems to do nothing, check the value is above zero and is a plain number of seconds.
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.