Skip to main content
All posts
Blog

Stop or Limit? Entering at a Chart Level in NinjaTrader 8

The order type for an entry at a price level is decided by geometry, not preference, and the correct answer flips the moment the level crosses the market. What NinjaTrader 8 does, what it will not do for you, and how the rule is written in code.

Wizdough8 min read

You have a level. It is the high of a signal bar, a swing point, a line an indicator drew. You want to be filled there and nowhere else. So you reach for Chart Trader and you have to answer a question before you can place anything: is this a stop order or a limit order?

The answer is not a preference. It is geometry, and NinjaTrader 8 will let you get it wrong.

The rule, and why it feels backwards

For a buy, the split is simple. If your level sits above the current price, the only order that waits there is a stop. A buy limit above the market is marketable the instant it is accepted, so the platform fills you now at whatever the book offers rather than later at your number. If your level sits below the current price, it is a limit. A buy stop below the market has the same problem in reverse.

For a sell, both halves swap. Above the market is a limit, below it is a stop.

That is four cases to keep straight, and they are easy to keep straight when you are reading about them. They are less easy at the moment you actually need them, which is a market moving toward a level you decided on ten minutes ago. Written as code, with dir positive for a buy and v the price of the level, the whole decision is four branches:

oType = v > Close[0]
          ? dir > 0 ? entryTypeStop  : entryTypeLimit
          : dir > 0 ? entryTypeLimit : entryTypeStop;

Nothing clever happens there. It is a rule a person can apply and a rule a machine can apply, and only one of them is working against the clock.

Two order types per side, not one

The choice is slightly wider than stop or limit, and the second half of it is worth setting once.

On the waiting side, a Limit order rests in the book at your price. A Market if Touched order does not rest anywhere: it sits on the platform until your price trades, then goes out as a market order. Limit means you get your price or nothing. MIT means you get filled, at whatever the next available price turns out to be.

On the triggered side, a Stop Market order becomes a market order when your price trades. A Stop Limit becomes a limit order at your price instead, which protects you from a bad fill on a fast move and leaves you flat if the move never comes back.

Neither pair has a universally correct member. They trade certainty of fill against certainty of price, and which one you want depends on the instrument and the setup rather than on the day. This is exactly the kind of decision that belongs in a settings screen, chosen once while calm, rather than in a dropdown you are clicking during the setup. In ATM Whisperer they are two settings, Entry Type Limit and Entry Type Stop, and every order it places uses the pair you picked.

What happens when the level crosses the price

Levels move, which is how a rule you applied correctly ends up wrong anyway. A swing point updates, a moving average slides, a line gets redrawn. The order you placed does not know about any of that, so if you are attaching it to the plot and letting the price follow, an order that started as a perfectly correct buy limit below the market can find itself above the market ten bars later. At that moment it is no longer the order you reasoned about. It is a marketable order sitting at a price the market has already passed.

NinjaTrader 8's built in Attach to Indicator will carry an order across that line without comment, because attaching changes the price and only the price. We wrote about where that feature runs out in Attach to Indicator: what it does and where it runs out, and this is the limitation with real money attached to it.

ATM Whisperer guards the half of this that can be guarded without guessing what you want. A stop order is never chased through the market: if the new level has reached or passed the last price, the repricing pass stops there and the order keeps the price it has. A stop that is already sitting beyond the current price is left alone for the same reason. Limit orders get the weaker version of that protection. One already on the wrong side is not moved, but a limit that is still correctly placed can be repriced to a level that has since crossed the market, which is the case to watch on a fast move. Worth knowing rather than assuming, and worth watching in sim on your own instrument.

Two smaller behaviours follow from the same instinct:

  • Only orders in a Working or Accepted state are touched. Anything that has reached a terminal state, filled, cancelled or rejected, drops out of the managed set the moment the account reports it.
  • Every reprice is rounded to the instrument's tick size, so a plot value that lands between ticks does not go out as an unfillable number.

There is also a setting called Modify toward last price only, off by default, which restricts repricing to movements that bring the order closer to the market. It exists because a level that wanders away from price can walk your entry somewhere you never intended to trade.

Which bar the level comes from

One detail decides whether the price you get is the price you meant.

An indicator that calculates on bar close has no value yet for the bar in progress, so reading the current bar gives you either nothing or a stale figure. An indicator that calculates on each tick does have one, and it can change several times before that bar closes. The two need to be read differently, and the difference is one bar.

ATM Whisperer checks the attached indicator's own Calculate setting and reads the last closed bar when the indicator is on bar close, and the current bar when it is on each tick. It is a single line of code and it is invisible when it is right. If this distinction is new, Calculate: OnBarClose vs OnEachTick is the longer version.

On top of that there is a BarsAgo lookback for setups that reference an older bar, such as the high of the bar before the signal, and an Offset in ticks, zero by default, for sitting a fixed distance past the level rather than exactly on it. The offset is applied in the direction away from the market, so a buy above sits higher and a buy below sits lower, and it is stored rather than retyped.

If the indicator has no valid value at the bar being read, the price falls back to a fixed distance from the last price, set by a Default Offset that ships at 40 ticks. It is a real number and it will look like an ordinary order, so it is worth knowing that this is what an unreadable plot produces.

The bracket is a separate machine

An ATM strategy is NinjaTrader's bracket manager. It attaches to a fill and runs the stop and target from there. Its position and its profit and loss are self contained, which the platform's own sample strategy states in as many words: an ATM runs on its own and does not affect the position of the script that started it.

Placing the entry is a different job, and it happens before the ATM has anything to attach to. ATM Whisperer does that job and hands the order to the ATM strategy already selected in Chart Trader, along with the account and quantity you have set there. If no ATM strategy is selected, the entry is submitted on its own, exactly as a manual order would be.

So it does not trail your stop, move anything to breakeven, or scale you out. Your ATM template already does that and does it well. What it removes is the gap between deciding on a level and having a correctly typed order resting at it.

Trying it

Nothing here needs a purchase to understand. The geometry rule is free, and writing it on a sticky note beside the monitor is a real fix for a real error.

If the error keeps happening anyway, which is common when the level is only known a second or two before it matters, ATM Whisperer automates the same rule against any indicator on your chart, including WiSE if you trade second entries. It has a seven day free trial and a getting started guide.

Run it on sim first, on the instrument you actually trade, and check the order type it chooses against the one you would have chosen. If the two agree every time, you did not need it.

Futures trading involves substantial risk of loss and is not appropriate for all investors. Automating order placement reduces mechanical error; it does not create an edge.

Share
Mentioned in this post

ATM Whisperer

The Ultimate Tool for Precision Order Placement. $15/mo · 7-day free trial.

View product