Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Orders don't get filled

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

    Orders don't get filled

    Hello,

    I have a problem while backtesting a strategy. I've also used the print() command for that I see each profit target. Now the strategy gets a profit target of 9167 for example. Although this price is reached within the following 5 minutes, the profit target doesn't resolve and the position stays open, causing a loss. Now I wanted to know, if anyone could explain this fact... I have really no idea, why the profit target didn't get filled.

    Regards,

    Sepp

    #2
    Sepp,

    I suggest you run with TraceOrders = true. If it was a quick touch at that price, it is possible to not get filled.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      I've enabled now the TraceOrders() command and got this message in the log window:

      18.08.2009 17:15:00 Ignored PlaceOrder() method at 18.08.2009 17:15:00: Action=SellShort OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Sell short' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'

      Unfortunately, I don't really understand what the bold one means. I guess, I have to change something in the Backtest Settings menu?

      Regards,

      Sepp

      Comment


        #4
        It means one of your entry orders was ignored because you were already holding a position/active order in that market direction.

        If you want to have more entries then you will need to bump up the EntriesPerDirection property when you start up the strategy.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          I've put now in the backtest menu "Entries per Direction = 5" and "Entry handling = AllEntries". Backtested again and now there was this message:

          18.08.2009 17:10:00 Entered internal SetStopTarget() method: Type=Target FromEntrySignal='' Mode=Price Value=9167 Currency=0 Simulated=False

          So, although the profit target was set @ 9167 and the price was reached, the order didn't get filled.

          Regards,

          Sepp

          Comment


            #6
            Submitting an order and actually getting filled are separate things. If it only flickered up there at that price it is possible to not be filled. Target orders are essentially limit orders and limit orders do not guarantee you fills.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              So reaching prices doesn't mean that they ARE reached? Just because a price is reached, it doesn't mean, my limit order with target on that price is getting filled, right? Is this also the same in realtime or just while backtesting? Hmm... okay, thank you for that information.

              Regards,

              Sepp

              Comment


                #8
                MasterSepp, correct touching the price of a limit order does not mean it fills. In realtime this will be determined by order dynamics at this price level, in backtesting this is approximated by our simulation engine and depends on the fill algorithm you use - http://www.ninjatrader-support.com/H...AStrategy.html ( Historical Fill Processing )
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Thank you very much, now it looks alot better! I've always calculated with just touching the limit price.
                  Do you have experience by the way to tell me, how realistic the "liberal" setting is? Does it often happen in reality, that your order doesn't get filled, although the price was touched?

                  Regards,

                  Sepp

                  Comment


                    #10
                    MasterSepp, you're welcome - hard to say per se, depends on market, liquidity, time of day and of course individual order size as well as time placed ahead (spot in the price q). You'll have to test with your strategy, but I've seen many strategies falling apart in realtime because of exactly those 'fill assumptions' people held from backtesting. Much better if the strategy holds up with price trading through....
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Hmm, I've got another problem now: I've backtested the strategy and all worked well. Now I wanted to test it in real-time and I got this message:

                      26.08.2009 18:10:01 Default Failed to execute DB job 'StrategyUpdateJob': Der Datensatz kann nicht hinzugefügt oder geändert werden, da ein Datensatz in der Tabelle 'nt_execution' mit diesem Datensatz in Beziehung stehen muss.

                      Sorry, that's in German, translated it would say something like this:

                      Failed to execute DB job 'StrategyUpdateJob': The data series can't be added or change, because a data series in the table 'nt_execution' has to be related with this data series.

                      What does this mean? I have really no idea. The parameters I've set for the strategy are like this:

                      Period: 5 min
                      Calc. on bar close: True
                      fill type: liberal
                      slippage: 0
                      entries per direction: 1
                      stop+target submission: perentryexecution
                      set order quantity: by strategy (is set as "DefaultQuantity")
                      Time in Force: Gtc

                      Hope, this will help you.

                      Regards,

                      Sepp

                      Comment


                        #12
                        Sepp,

                        Please try resetting your NT database in Tools->Options->Misc.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          Thanks, it works no without problems.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Irukandji, Yesterday, 02:53 AM
                          2 responses
                          17 views
                          0 likes
                          Last Post Irukandji  
                          Started by adeelshahzad, Today, 03:54 AM
                          0 responses
                          3 views
                          0 likes
                          Last Post adeelshahzad  
                          Started by CortexZenUSA, Today, 12:53 AM
                          0 responses
                          3 views
                          0 likes
                          Last Post CortexZenUSA  
                          Started by CortexZenUSA, Today, 12:46 AM
                          0 responses
                          1 view
                          0 likes
                          Last Post CortexZenUSA  
                          Started by usazencortex, Today, 12:43 AM
                          0 responses
                          5 views
                          0 likes
                          Last Post usazencortex  
                          Working...
                          X