Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

One Trade Per Direction Problem

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

    One Trade Per Direction Problem

    I am using the Strategy Wizard and having the following problem. Part of a strategy I am working on buys long when a Fast SMA(35) agrees with a very slow SMA(200). It does not need to cross first. I am getting multiple entries in the same direction(One after the other) even though I have the order entry in the Optimizer set to 1 entry per direction. This happens when the market is trending for awhile and my first profit target is hit. It then enters again in the same direction on the next bar.

    Anyone with any ideas?

    Thanks

    Mark

    #2
    Mark,

    It sounds like you have a strategy that tries to scale-out from a single entry order. To scale-out you need to scale-in first.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh, I am not sure what you mean by scaling in. I think you are talking about entering with more than 1 contract. I am entering with only one contract. After the profit target is hit and I am flat it will enter again on the next candle if the trend has not changed.

      Comment


        #4
        123r34,

        Got it. So what exactly are you seeing then? Can you please provide a series of events as they happen chronologically? Thank you.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Click image for larger version

Name:	ES 03-09  2_25_2009 (5 Min).jpg
Views:	1
Size:	86.2 KB
ID:	850367I wasn't sure how to insert a Ninja screen capture so I tried the attachment clip on this screen. If it doesn't come through please let me know how to attach or insert a screen capture in this box.

          Comment


            #6
            The screen capture in the response below shows an initial entry when the fast MA is increasing with the slow MA. It is profitable and closes when it hits the profit target. The problem is that it re enters again. I have the optimizer set to 1 entry per direction which is what I want. Any idea why it re enters?

            Comment


              #7
              123r34,

              From your screen shot it would appear that your same entry conditions are still true as you exited. This is why it reentered. You would need to make more stringent entry rules.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                The one entry per direction setting means only one entry at a time. Once that trade exited, another can occur. You will need to code a bool function to keep track of your trades in the strategy but since I don't use the builder, I don't know if you can without hand coding it.
                eDanny
                NinjaTrader Ecosystem Vendor - Integrity Traders

                Comment


                  #9
                  Thank you eDanny and NinjaTrader Josh. I haven't found anything in Strategy Wizard to limit the second entry. Maybe that is something that could be added to it on the next release. Have a great day.

                  Comment


                    #10
                    123r34,

                    You need to first come up with what you want to limit it with. On pen and paper, what would be the objective rule that prevents you from entering a second time?
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      I'm a little confused on the entry handling issue. If you specify "Entries per Direction = 1;" and EntryHandling = EntryHandling.AllEntries;", then why do you need strategy logic to prevent a second entry from taking place while the first entry is still active?

                      Comment


                        #12
                        You don't. You need to step through your code and trace it step by step to truly understand what position our strategy has at any point in time to determine if EntriesPerDirection will prevent any order placement.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          Having a similar issue as well. I understand the Entries per direction 1 means it only takes 1 trade at a time but if my condition for entry is met again after a target/stop then it will enter again.

                          Assuming my entry condition is met for buy and sell what would be the best way to have it take only 1 buy and 1 sell order a day? Then the next day it's reset so it can take only 1 buy and 1 sell order again.

                          Comment


                            #14
                            You can work with boolean flagsfor this, then reset it on a new day to allow trade taking again.

                            Comment


                              #15
                              Originally posted by NinjaTrader_Bertrand View Post
                              You can work with boolean flagsfor this, then reset it on a new day to allow trade taking again.
                              Do you have a example? I do not know now to code... What I've done is use the strategy builder.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              637 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              366 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              107 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              569 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              571 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X