Same Logic different results?

I have two implementations of the same strategy in NinjaTrader:

  1. A monolithic strategy (single series, logic inside the strategy)
  2. A modular version (logic in an indicator, strategy only routes orders, multi-BIP)

Both use the same conditions (EMA crosses, same filters, same parameters).
I built a bar-by-bar compare logger and confirmed:

All signals (Entry1, Entry2, Exit) are 100% identical on every bar.

However, the backtest trade lists are not identical (some trades are missing or extra).

So the problem is not the signal logic, but order / position handling.

Here is a simplified example of the structural difference:

Version A (single strategy):

// Single position model
EntriesPerDirection = 1;

if (CrossAbove(m, s, 1))
    EnterLong(1, "Long");

if(CrossAbove(s, m, 1)
   EnterLong(1, "Long");

if (CrossBelow(f, m, 1))
    ExitLong("Exit", "Long");

Version B (routed / multi-BIP style):

// Allows multiple entries
EntriesPerDirection = 1;

if (signalEntry1)
    EnterLong(1, "ENTRY1");

if (signalEntry2)
    EnterLong(1, "ENTRY2");

if (signalExit)
{
    ExitLong(1, "EXIT1", "ENTRY1");
    ExitLong(1, "EXIT2", "ENTRY2");
}

Even if signalEntry1, signalEntry2, and signalExit are identical to Version A’s logic on every bar, NinjaTrader’s internal position aggregation and order mapping can lead to different executed trades.

My questions:

How can two strategies with identical signals produce different trades?
What is the correct way to structure order/position handling (signal names, EntryHandling, multi-series routing) so both versions produce exactly the same trades?

Any insight into NinjaTrader’s internal position aggregation, signal name handling, or multi-BIP execution model would be appreciated.

I’ve never had a problem with NT’s position tracking so I think it’s unlikely the issue is there.

In my experience, 95% of the time, when I see some disparity like this and I think it shouldn’t be the way it is, I’m simply overlooking something. The other 5% I’m misinterpreting the way NinjaTrader is actually expected to behave. And on very rare occasion I identify a bug which I report to NinjaTrader with a simplified example for repeating that bug.

The only way I’ve found to work out issues like this is to bite the bullet and start from ground zero with super simple examples that work. And then start adding features back in one at a time until I find the problem area. This works pretty well, but it usually takes me a while to surrender.

Probably some order of operation or timing somewhere. I would stick with a modular approach. Consider decoupling from NT as much as possible.