Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with entry Handling

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Problem with entry Handling

    I have developed a Ninjascript trading strategy with two two different entries which have the following signalnames: The first is called "LONG(SHORT) Entry" and the second one is called "LONG(SHORT) Reentry". Those two entries are mutually exclusive, since "LONG(SHORT) Reentry" can only be taken, when a LONG(SHORT) Entry was stopped out before and a special condition is then true afterwards.

    The logic works overall perfect with one exception. When I compare the NT 7.0 backtesting with backtesting results in TradingBlox I get some entries one day later than Tradingblox. I know that Tradingblox is correct, since I have recalculated the trading logic manually.

    The interesting thing now is the following: When I change the NT backtesting settings for Entry Handling from AllEntries to UniqueEntries this problem suddently disappears. But this does not make sense for me, since AllEntries is correct in that I want both entries mutually exclusive and only 1 position at each point in time.

    Would highly appreciate any hints or comments.

    Thx

    #2
    Hello unter821,

    Unfortunately we can't comment on our behavior compared to Tradingblox. Since you find your results consistent when changing the property, it may help to clarify how these work.

    If set to "EntryHandling.AllEntries", NinjaScript will process all order entry methods until the maximum allowable entries set by the EntriesPerDirection property has been reached while in an open position.

    If set to "EntryHandling.UniqueEntries", NinjaScript will process order entry methods until the maximum allowable entries set by the EntriesPerDirection property per each uniquely named entry.

    With AllEntries and EntriesPerDirection set to 1:
    It will accept the first signal (Entry or Reentry) and ignore any others until the position is closed.

    With UniqueEntries and EntriesPerDirection set to 1:
    It will accept Entry and ReeEntry at the same time (because they're uniquely named).
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Forget about Tradingblox that is not the issue.

      You give the answer by mentioning the case I was using all the time: With AllEntries and EntriesPerDirection set to 1: It will accept the first signal (Entry or Reentry) and ignore any others until the position is closed.

      This should work in my context since it accepts the first signal and ignores any other. But why does a normal EnterLong then come one day later, than it should come. And why is it fixed by changing it from "AllEntries" to "UniqueEntries". Sorry, but that does not make any sense to me.

      Comment


        #4
        Changing entry handling from AllEntries to UniqueEntries has no impact on the timing of entries. It will only accept or ignore signals for entry based on the settings used.

        Our backtesting engine enters one bar after the condition evalutes to true. Is this what you're seeing?
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Problem is fixed, thx! By setting TraceOrders = true I found out that under certain circumstances the second signal (Reentry) was placed but not filled. And then on those days the first signal, which should have been filled was ignored. So my message: TraceOrder is extremely useful, when searching for reasons, why certain fills are not produced!!!

          Comment


            #6
            Thanks for the update, unter821. TraceOrders output can be very useful - glad to hear you were able to use it to identify the cause here.
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            649 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            370 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            109 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            573 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            576 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X