Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop order rejected

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

    Stop order rejected

    I write EasyLanguage code using the NtDirect.dll and using the external data feed from TradeStation. This is done using the sim account. The broker who runs the code in live trading does not have this problem as far as I know. What happens is that orders are rejected because of the apparent absence of market data. For instance, yesterday 2 orders were issued simultaneously. The first buy order is filled at 4323.00 while the second order, a sell stop market at 4313.00, is rejected due to being above the market, which is clearly not the case. When this happens, I usually get a message saying there is no market data. We know there is market data because the first order gets filled immediately. Is this a glitch in the external data feed? What can I do to keep it from happening?

    Click image for larger version

Name:	NTOrderRejected.PNG
Views:	1
Size:	8.1 KB
ID:	902392

    #2
    Atomic, we're not aware of a specific issue - how many symbols of Level 1 data would you feed over the External Feed connection as this is seen?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Atomic, we're not aware of a specific issue - how many symbols of Level 1 data would you feed over the External Feed connection as this is seen?
      I'm feeding five symbols (ES, NQ, YM, EMD, and TF). Same trade occurred today, but problem did not occur. I seem to notice this more in fast markets, but the order is always issued within about 15 minutes of open, so it's hard to judge.

      I just tried to execute an order for a symbol which has no data (GC). After about 15 seconds, I get the message that there is no data to drive the simulation engine. So, for whatever reason, the external data feed experiences a delay and I'm getting timed out even though my TS platform is actively getting data. I'll try to come up with a workaround and let you know if I find something.
      Last edited by Atomic; 02-13-2015, 11:35 AM.

      Comment


        #4
        I set up a timer to send the last price once per second when the order is transmitted. Once the order is accepted, I turn the timer off. Seems to work now, but I'll have to test it during the fast market conditions to be sure.

        Comment


          #5
          also having stop order issues

          While backtesting/optimizing I am getting many of the following messages:

          An Enter() method to submit an entry order at '2/5/2015 1:30:00 PM' has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation
          .
          My submissions are made using the following code:


          Code:
           if (LE[0]==false 
                                  && LX[0]==true 
                                  && Position.MarketPosition==MarketPosition.Long )                         
                                  ExitLong(Position.Quantity, "LX","LE");
                              
                              if (SE[0]==false 
                                   && SX[0]==true 
                                  && Position.MarketPosition==MarketPosition.Short )                         
                                  ExitShort(Position.Quantity,"SX","SE");
                  
                              if(LE[0] && (LX[0]==false) && SE[0]==false                        
                                  && (Orders.Count==Orders.Filled && Position.MarketPosition != MarketPosition.Long) )
                              {
                                  if( Close[0]<High[0])
                                      EnterLongStop(posSize,High[0],"LE");
                                  else
                                      EnterLong(posSize,"LE");
                              }    
                              
                              if(SE[0] && (SX[0]==false)     && LE[0]==false                    
                                  && (Orders.Count==Orders.Filled && Position.MarketPosition != MarketPosition.Short) )
                              {
                                  if( Close[0]>Low[0])
                                      EnterShortStop(posSize,Low[0],"SE");
                                  else
                                      EnterShort(posSize,"SE");
                              }
          This has happened before and usually was fixed by a re-boot and database repair.
          Now even that does not help.
          My data provider is "Barchart"...
          Running Windows 7 pro; I7 CPU, 64bit version, 16 gig, All SSD.

          Comment


            #6
            Hello hairymug,

            Thanks for your post.

            Using TraceOrders in your strategy can help the debugging process. When enabled, traces are generated and displayed in the NinjaScript Output window for each call of an order method providing confirmation that the method is entered and providing information if order methods are ignored and why. This is valuable for debugging if you are not seeing expected behaviour when calling an order method. This property can be set programatically in the Initialize() method.

            Traceorders help guide reference: http://www.ninjatrader.com/support/h...raceorders.htm

            This post will provide further guidance on using trace orders: http://www.ninjatrader.com/support/f...ead.php?t=3627

            Please let me know if I can be of further assistance.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Thank You Paul,

              I finally found out that it was my Samsung SSD which has an "optimizing" function call "RAPID".
              After turning off this feature, it made my tests faster and more consistent.
              Here is the description of this feature:

              RAPID mode increases the overall performance of your computer by pairing the industry’s fastest SSD with the most advanced storage management techniques to deliver the fastest and most reliable user experience. RAPID mode analyzes your application and data usage, dynamically optimizes the I/O for Samsung SSDs, and eliminates system performance bottlenecks. RAPID mode is fully automated; no user management is necessary.
              I suspect that the database does not play well with this type of "accelerator".

              I hope this is helpful to someone else "tearing their hair out"...

              Walt

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by samish18, Yesterday, 08:31 AM
              4 responses
              14 views
              0 likes
              Last Post elirion
              by elirion
               
              Started by funk10101, Yesterday, 09:43 PM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by TheWhiteDragon, 01-21-2019, 12:44 PM
              5 responses
              551 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by rtwave, 04-12-2024, 09:30 AM
              5 responses
              37 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by funk10101, Today, 12:02 AM
              1 response
              11 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Working...
              X