Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to overcome this bug?

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

    How to overcome this bug?

    Hi,
    I developed a strategy which handles stop in OnExecution (like in NT examples). My stops are 8 ticks and the statement for short is:
    stopOrder = ExitShortStop (0, true, execution.Order.Filled, SLPrice, "Stop", EntryName);

    SLPrice is correct!
    I attach two pics from the same run of back testing.
    1. I go short on an up bar and it triggers stop on the same bar. It is probably wrong, because the stop was not reached after the entry, but I understand that NT has no option to know it.
    2. I enter short on a down bar and now the stop wasn't triggered at all, so on this bar or the next I didn't exit on stop. When I run it in VS debugger it runs the statement but stopOrder remains NULL.

    I use limit entries.
    How can I trigger the stop?

    Regards,
    Baruch
    Attached Files

    #2
    Hi Baruch, did you enable TraceOrders already in the Initialize() to check into your order behavior and why it was perhaps ignored? (Internal Order Handling Rules?) -

    Comment


      #3
      Hi Bertrand,
      This is the error:
      08/12/2009 04:25:04 Strategy A BuyToCover stop order placed at '02/12/2009 08:10:00' has been ignored since the stop price is less than or equal to the close price of the current bar. This is an invalid order and subsequent orders may also be ignored. Please fix your strategy.

      I understand this, the question is how to fix it?

      Baruch

      Comment


        #4
        Baruch, you would need to check for the stop Price being valid at the time you submit it.

        Comment


          #5
          Bertrand,
          My stop price is valid its 8 ticks from entry in each direction. The problem is that NT enters in BT on the next bar and if this next bar encloses the stop then there is a problem. Actually NT is treating the bars in reverse that means that if my entry is for short and it happens on a down bar near the low NT sees a problem because the stop is inside the bar. If the short entry is on up bar then NT exits on the same bar without a problem (the attached pics). The correct behavior should be that on the up bar if I execute short near the top then its probably should not trigger the stop, but even if you reverse the behavior it won't help me.
          My question is how to fix this?

          Baruch

          Comment


            #6
            Baruch, you would then need to submit the stop Order to a finer intrabar stream to achieve a more realistic fill behavior in backtesting as for NT the intrabar formation is not know per default in backtesting - http://www.ninjatrader-support2.com/...ead.php?t=6652

            Comment


              #7
              Thanks,
              I'll do that

              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