Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Another Entries Per Direction Problem

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

    Another Entries Per Direction Problem

    Hi All,
    I've read all the threads I could find on Entries Per Direction and in Help, and can't figure out why I'm getting multiple entries.
    If I understand correctly, if I limit entries per direction to 1, Unique Entries, as long as a position is open for a particular entry with a signal name, it shouldn't put in another order with that signal name until that position is closed, correct?
    As you can see from the picture1, a short limit order was filled at price 834. (3rd bar from the right hand side of the screen). At this point everything is fine. Entry name is Short66. There are now 2 open short positions,which is fine. Then 2 more bars printed. When the last bar printed, it placed an order to go Short again at 834, even though an open position with signal name Short66 existed (Pic2). You can see this in the picture.
    This should not have happened should it? That order then got filled Total position is now short 3 with another pending order to go short (different signal name). This strat should never have more than 3 open positions at a time. I've seen it be long or short 5 positions at a time.
    I've tried everything to get the Entries Per Direction to work like the definition says, but no luck.
    Any ideas? This is a simple Wizard strat with a Profit Target, no Stop since it exits all positions on EMA cross in the opposite direction.
    Thanks,
    Joe
    Attached Files

    #2
    Hello,

    Can you post your code and text from your log that you get when this happens so I can follow what actually happened? Also, if you can, tell me what you are expecting to have shown in the log file.
    DenNinjaTrader Customer Service

    Comment


      #3
      Ben, here's a picture and the log file. I'll upload the strat right after this post.
      This simply sells on each MA Level (EMA33, EMA66 and SMA112) in a downtrending market and vice versa. It can place all 3 orders at the same time if conditions are met, or it can put in only 1 or 2 orders depending where the Close[0] is. Each order has a unique name. Strategy menu is set to 1 entry per direction, unique entries.
      What I'm expecting is for it to enter only once for each unique signal name until either the profit target or stop loss is hit, at which time it can then submit another order at the same entry level. With 3 entry levels, it can be Long or Short up to 3 contract (1 for each level), but it should never enter at the same level more than once if there is an open position for that Entry point.
      If I remove the SL and PT, then it only enters once at each level (like its supposed to). If I remove all entry conditions except one (say Enter only at EMA 66) then it works like it's supposed to. It must have something to do with the other orders pending????
      I didn't see anything in the log to give me a clue.
      Thanks,
      Joe
      (I couldn't upload a CSV for the Log, so I converted it to txt. Pretty messy)
      Attached Files

      Comment


        #4
        Here's the strategy.
        Thanks again.
        Attached Files

        Comment


          #5
          Trade1953,

          Please upload the relevant log and trace files located in My Documents\NinjaTrader 6.5\log and \trace folders. Thank you.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            Josh,
            The txt log is 22K and the upload limit is 19.5K and it won't let me upload. I stopped the replay a couple of bars after it took 2 offending entries.
            Which lines are safe for me to delete so I can upload it?
            Thanks,
            Joe

            Comment


              #7
              Joe,

              Please email the log and trace files into support [at] ninjatrader [dot] com. In the subject line please do Attn Josh and reference this thread. Thank you.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                OK, e-mail is sent with Log and Trace file. In the log file, problem is around where it first shows Qty 3. Time 2:28:00 PM.
                Joe

                Comment


                  #9
                  Joe,

                  Please try again without Chart Trader. You should not try to manipulate NinjaScript strategy trades with Chart Trader. Please provide the replay file so we can try on our ends too since I am unable to reproduce right now. Thank you.

                  Also, please try this attached strategy. Connect to the Simulated Data Feed and then open a 3 second chart. Open the Tools->Output Window and throw the strategy onto the chart with EntriesPerDirection = 1 and EntryHandling = Unique Entries. You should see two enter commands with the second being ignored because the entry exceeded the maximum allowed. Please confirm/deny this.
                  Attached Files
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    Josh,
                    I'll give your sample a go, but it may be a little bit. As for the replay file, it's 18 MB so I doubt I can even send that through e-mail. Replay file is 13 April, ES 144 tic chart. The strategy I posted has all the settings just as they are when the anomaly happens. It happens on other days too. I'll try to find a smaller replay file and send you that one.
                    I only put on Chart trader to watch the trades happen and to make sure the trades/orders are firing where they are supposed to. I keep my chart with the strategy on it clear of everything. I don't try to manipulate any of the trades. I do this with all my strats and no problems at all.
                    If you want to reproduce the problem, just use an ES 144 tic chart (any day), the strat I posted, start replay before 9:30 EST. Pull up a chart where you can watch the trades and put on it EMA33, EMA66 and SMA112. I have 2 PCs with Ninja, and it happens on both of them so I don't think it's a singular issue.
                    I'll let you know what happens with your test strat.
                    Don't lose any sleep over this one just yet.
                    Thanks,
                    Joe

                    Comment


                      #11
                      Josh,
                      Your test strat produced the results it said it would in the output window. I'm going to try something similar to your strat using mine.
                      Joe

                      Comment


                        #12
                        Josh,
                        I unlocked the Wizard Strategy code and put in the

                        if (Historical)
                        return;

                        like you had in your test strat and it seemed to fix the problem. I guess I'll just make a habit of doing that no matter what kind of strat it is (Wizard or otherwise). I'll try it Live Sim tomorrow and see if it still works as intended.
                        Thanks,
                        Joe

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                        0 responses
                        558 views
                        0 likes
                        Last Post Geovanny Suaza  
                        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                        0 responses
                        324 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by Mindset, 02-09-2026, 11:44 AM
                        0 responses
                        101 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                        0 responses
                        545 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by RFrosty, 01-28-2026, 06:49 PM
                        0 responses
                        547 views
                        1 like
                        Last Post RFrosty
                        by RFrosty
                         
                        Working...
                        X