BLACK FRIDAY IS BACKNov 24 to 30. Join the list and get in a day early.Join the list

Enter Only When Flat: the New ef= Parameter

Traders have asked us for this one for a long time. A strategy fires a buy, the position opens, and then the same signal fires again on the next bar. And again. Each alert is a valid entry on its own, so each one gets sent, and a position you meant to open once ends up three times the size you planned.

The new ef= parameter fixes that from the command line. It stands for Enter When Flat. Add it to an entry, and before anything is sent Autoview reads the open positions on your account. If one is already open on that symbol, the entry is skipped. If you are flat, the order goes out exactly as you wrote it.

Why repeat entries happen

Plenty of signal sources do not know what you hold. An indicator that says "trend is up" will say so on every bar the trend stays up. A script polling a feed sends a buy each time its condition is true. A TradingView strategy has its own pyramiding setting, but an indicator alert or a custom webhook sender has nothing like it. The webhook arrives, the command is valid, and the exchange fills it.

Until now the fix lived outside Autoview. You rewrote the alert logic or added state to your script, or you accepted the stacking and cleaned it up by hand. With ef=, the check happens at the last possible moment, against the account itself, right before the order would go out.

The syntax

ef= takes the same side words as b=:

  • ef=long, ef=buy or ef=bid checks long entries only.
  • ef=short, ef=sell or ef=ask checks short entries only.
  • ef=1, ef=both, or any other value that is not 0, false or any checks entries on both sides.
  • ef=any checks entries on both sides against the whole account, not just the symbol in the command.
  • ef=0, ef=false, or leaving the key off turns the check off. Your command behaves exactly as it did before.

The side word decides which entries get checked. It does not change what counts as "not flat". A checked entry is skipped while any position is open on that symbol, long or short. So with ef=1, a short signal that arrives while you are long is skipped too. If you want the strategy to reverse, close the position first with c=position, then send the entry.

ef=any widens "not flat" from one symbol to the whole account. The entry is skipped while any position is open on the account, whatever the symbol, long or short. Exits are not gated, the same as with every other value. Letter case does not matter, so EF=ANY and ef=Any work too.

When an entry is skipped, nothing reaches the exchange, and Autoview logs a line that says why. It reads like this, with your own symbol and size filled in:

Skipped: ef=1 s=BTCUSDT b=long was not sent because BTCUSDT already has an open position (long 0.05). Close it first (c=position), or remove ef=1 to add to it.

Three examples

These are webhook commands, so there is no e= or a=: the account linked to the webhook decides where they go. On the Chrome extension, add those two the usual way.

One entry per trend, on a futures account

s=BTCUSDT b=long q=2% t=market ef=1

The first alert opens a long. Every repeat of that alert is skipped while the long is open. Once the position is closed, whether by a stop or by a c=position alert, the next buy signal opens a fresh position.

Guard buys only, on OANDA

s=EUR_USD b=long q=1000 t=market ef=long

Only long entries are checked here. A repeat buy is skipped while a EUR/USD position is open. A sell line that does not carry ef=short or ef=1 is sent without the check, just as it would have been before.

Exits always go through

c=position s=BTCUSDT

A close is never gated, and neither is a cancel (c=order) or an order sent with ro=1 or close=1. Those orders cannot open a new position, so ef= has nothing to protect. If you paste ef=1 onto every line of an alert out of habit, your exits still work.

Which exchanges support it

ef= needs an account Autoview can read open positions from. That covers most futures, perpetual, margin and broker connections:

  • Brokers and forex: OANDA, Tradovate, TradeStation, Alpaca, Capital.com, Charles Schwab.
  • Crypto derivatives: Binance Futures (USDT-margined and COIN-margined), Bybit, Bybit copy trading, OKX (including EEA, US and Demo), Kraken Futures, HyperLiquid, BitMEX, Deribit, Bitget futures, Gate.io futures, KuCoin Futures, Huobi futures and swaps, Crypto.com derivatives.
  • Margin: Kraken and Bitfinex margin positions.

Spot is different. A spot account holds balances, not positions, so there is nothing to read. On a spot-only or copy-trading connection where Autoview has no position read (Binance spot, Binance.US, Coinbase, Gemini, Bitget spot, Gate.io spot, KuCoin spot, Huobi spot, Bybit spot, Crypto.com spot, and the Bitget and KuCoin futures copy accounts), an entry with ef= is refused with an error that names the problem. It is not sent unchecked. Remove ef= and the order goes as written.

One caveat on Kraken: its position read covers margin positions only. A spot balance on Kraken does not count as an open position, so ef= will not stop a repeat spot buy there. The same holds for a spot order on Bitfinex or OKX, which sees margin positions only.

ef=any needs a read of every open position on the account in one go. Bybit, Bybit copy trading and Bitget futures can only read positions one symbol at a time, so they refuse ef=any with a message that says what was sent and why. Nothing is sent; use ef=1 there instead. On a spot pair, ef=any counts open derivative and margin positions only, because spot balances are not positions.

Try it safely

Point an alert with ef=1 at a demo or practice connection first. Send the entry twice. The first fills, the second shows up in your log as skipped. Then send c=position and confirm the close goes through. Several demo connections are free, so the test costs nothing.

For where ef= sits among the other keys, see Step 6 of the command reference guide. The alert syntax page lists every value it accepts.

Questions

What does ef= do in an Autoview command?

It reads the open positions on your account before an entry is sent. If a position is already open on that symbol, the entry is skipped. If you are flat, the order goes out as written.

What is the difference between ef=1, ef=long and ef=short?

The value picks which entries get checked: long entries, short entries, or both. A checked entry is skipped while any position is open on the symbol, whichever side it is on. With ef=any, the entry is skipped while any position is open on the account, on any symbol.

Will ef= ever stop my exit or my close?

No. Closes, cancels, and orders with ro=1 or close=1 are never gated.

Which exchanges support ef=?

Any connection Autoview can read open positions from, which means most futures, perpetual, margin and broker accounts. On spot-only and copy-trading connections the entry is refused with an error instead.

Found something odd?

Tell us. Write to support@autoview.com with the exchange, the command, and what you expected to happen.

Read the command reference