It's usually not a bug. By default, EntriesPerDirection is 1 and EntryHandling is AllEntries: with a position open, further EnterLong() calls are ignored. To add entries, you need to raise that limit or use uniquely named entries.
| Setting | What it does |
|---|---|
AllEntries | Counts all entries together up to the EntriesPerDirection maximum, while the position is open. |
UniqueEntries | Applies that maximum to each uniquely named entry. |
Two ways to allow more entries
Raise the maximum: with EntriesPerDirection = 2 and AllEntries, two entries are allowed while the position is open.
Split by name: with UniqueEntries, each uniquely named entry is processed once, as in this example based on the guide:
EntriesPerDirection = 1;
EntryHandling = EntryHandling.UniqueEntries;
if (CrossAbove(SMA(10), SMA(20), 1))
EnterLong("SMA Cross Entry");
if (CrossAbove(RSI(14, 3), 30, 1))
EnterLong("RSI Cross Entry");
Before you change it
- These settings only apply to managed order methods. With
IsUnmanagedset to true, they're hidden from the strategy window. - Only set them in
State.SetDefaultsorState.Configure. - If not even the first entry fires, the cause may be different:
BarsRequiredToTradedefaults to 20, and orders aren't processed before those bars. See the 11 causes of a strategy not placing orders. - With several series, that minimum only applies to the primary one. If your logic uses another series, check
CurrentBarstoo.
On a prop firm account, every entry adds risk. Allowing two or three entries can multiply your contracts. Check your firm's maximum and work out how many contracts fit your drawdown before you change it.
Want someone to review it? We check how your NinjaScript strategy enters and how much risk it builds up.
Review from $90 Analyze NinjaTrader with AISources
- EntriesPerDirection (NinjaScript Language Reference)
- EntryHandling (NinjaScript Language Reference)
- BarsRequiredToTrade (NinjaScript Language Reference)
Keep reading
Free: The Other Half Workbook. Nine templates for trading with a cool head: your one-page plan, the pre-session checklist, the twelve-patterns test, your size and the bill for your mistakes.
Get the free workbookGet ready for 2027: the Trader Planner. Each day's US releases in New York time, your pre-market routine and a log for every session.
Paperback on Amazon, $16.99 Get the PDF, $9Educational content based on the official NinjaTrader documentation. Not investment advice. Test any change on a simulation account before using it live.