Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Rejected

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

    Order Rejected

    3/2/2009 9:13:31 AM|0|32|For a market order, the expiration must be Day or MOC. Affected Order: Buy 3727 Market
    3/2/2009 9:13:36 AM|0|128|Strategy 'Strat1' submitted an order that generated the following error 'OrderRejected'. Strategy has sent cancel requests, attempted to close the position and terminated itself.

    How do I set the expiration date for a market order?

    #2
    Phyre,

    When you first start up your strategy you should be able to select Day for the order TIF.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Okay, Thanks!

      Comment


        #4
        position

        When I restarted the strategy NT is showing my position as long even though the market order for the buy was rejected. How do I tell the strategy to reset?

        Comment


          #5
          You are talking about your historical strategy position and not your account position, correct? This is expected, as upon startup the strategy will cycle through all trades to arrive at the last historical open one.

          Comment


            #6
            Actual trading position is flat since the order was rejected. Since NT shows the order as rejected I would think it could keep in sync but it seems to think it's now long and it's not.

            To put it simply, the strategy thinks it's 4000 shares long and it's not. How do I reset it?

            Originally posted by NinjaTrader_Bertrand View Post
            You are talking about your historical strategy position and not your account position, correct? This is expected, as upon startup the strategy will cycle through all trades to arrive at the last historical open one.

            Comment


              #7
              Phyre,

              If a strategy receives an OrderRejected event it will try to terminate itself. There is no reconciliation done by the strategy. If you start up your strategy again it will start up as if it were brand new.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                It did terminate itself.

                When I start the strategy it says 4000 long in the position column...

                Comment


                  #9
                  Hi Phyre, which option do you checked under Tools > Options > Strategies > NinjaScript > On starting a real time strategy?

                  Comment


                    #10
                    Immediately submit.

                    Comment


                      #11
                      Phyre,

                      Remember, as you start a strategy it always calculates out a strategy position. A strategy position is NOT to be confused with an account position. Please see this article: http://www.ninjatrader-support2.com/...ead.php?t=4033
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        Originally posted by NinjaTrader_Josh View Post
                        Phyre,

                        Remember, as you start a strategy it always calculates out a strategy position. A strategy position is NOT to be confused with an account position. Please see this article: http://www.ninjatrader-support2.com/...ead.php?t=4033
                        This is a new strategy and on it's very first attempt to make a trade it died. The first trade would have put it in a long position if it had worked but it didn't. The actual position is flat.

                        If the strategy thinks its in a long position, am I to assume that I just have to let it run until it tries to sell it's virtural position so that it will be flat in both virtual and actual? Is there really no way to reset the virtual position to flat???

                        I guess I'm having a hard time believing that I have no control over the virtual position and that once NT gets out of sync there isn't an easy way reset the strategy back to flat. Am I really going to have to a control variable to my strategy to fake close out my virtual position?

                        This all makes me suspicious that NT does a lot of guessing when it comes to PnL calculations and reports. Are trade confirmations used at all?
                        Last edited by Phyre; 03-04-2009, 03:51 PM.

                        Comment


                          #13
                          Phyre,

                          The strategy NEVER knows or cares about what your account position is. To the strategy its always a strategy position. As far as it is concerned, it is always virtual. You need to ensure your account position is in line with the strategy position when you start it. If you do not want to worry about it that much you can just select "Wait until flat before executing live" and then just ensure your account position is flat before you start up your strategy. Then they will become in sync with each other.

                          If you restart your strategy it goes through and recalculates based on the historical data. There is no setting or resetting. As you start your strategy again it already is a new instance.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            Originally posted by NinjaTrader_Josh View Post
                            Phyre,

                            The strategy NEVER knows or cares about what your account position is. To the strategy its always a strategy position. As far as it is concerned, it is always virtual. You need to ensure your account position is in line with the strategy position when you start it. If you do not want to worry about it that much you can just select "Wait until flat before executing live" and then just ensure your account position is flat before you start up your strategy. Then they will become in sync with each other.

                            If you restart your strategy it goes through and recalculates based on the historical data. There is no setting or resetting. As you start your strategy again it already is a new instance.
                            Forget about my real account or my real position. What I hear you telling me is that I don't have control over my strategy. I can't start flat. It's always going to start somewhere based on history. Strategies aren't flexible enough to start where I tell them to.

                            Comment


                              #15
                              Phyre,

                              The way you have coded your strategy you are evaluating all historical bars on the chart. From those bars you evaluate out a strategy position. This is what you are seeing. If you don't want it to process old bars, don't have it calculate historically.

                              Code:
                              if (Historical)
                                   return;
                              At the beginning of the OnBarUpdate().
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              633 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              364 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              105 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              567 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              568 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X