Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simulation entry price wrong?

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

    Simulation entry price wrong?

    I have a strategy that uses managed order handling, but I'm wondering why it doesn't work properly for limit entries in simulation? I am running in the C# debugger, so I know every step that is taken. It is backtest data, not real-time.

    Here is the sequence:
    1) entryOrder = EnterShortLimit( DefaultQuantity, limit, "Short " + entry_cnt );
    where limit = 700.01 & entry_cnt = 0.
    2) Bars go by where the High[0] is always less than 698 (as is the Low[0] and Close[0], and Open[0]).
    3) For many bars nothing happens with the limit order, as it should be.
    4) OnExecution(IExecution execution) gets a callback. It has the entryOrder IOrder structure as a fill at 700.01. Yet there never was a bar that had a High[0] even equal to 700.01! The graph on the chart has a dotted entry line from above the bars somewhere in outer space! The highs are not even close.

    Now before you ask me to package up my system (which is a hard and laborious process), can we start with what should happen and ways I could isolate it further? Should I use Unmanaged order handling in order to have finer control? How could NT do this when the data is not there?

    #2
    Additional info is that the bar it "enters" on is one bar before a bar that has Low[0] = 707, High[0] = 710. This is a gap bar, so there could be no entry at 700.01 as the low is above the limit. If anything, it should enter at 707 or the Open[0] = 709.2. But it says it entered at 700.01!

    Comment


      #3
      Hi tradetree, which filltype for the historical processing are you testing with?

      Comment


        #4
        Default fill type.

        Comment


          #5
          The outcome you see would be expected for the filltype, it will fill at your limit price, never better to be conservative.

          Comment


            #6
            That's just it, it is filling far better than it could in reality. In other words, it gives me my fill price when that fill price is never hit. Do you know what a gap is? So lets say I set my limit at 110. The previous days close was 100, and the open is 120. The low of the first bar is also 120, same as the open. NT gives me 110! No person in the entire market gets 110 unless they already owned it at 100 the day before. So this is not conservative at all, it is wildly unrealistic and liberal.

            Comment


              #7
              tradetree,

              When you gap in the mornings, this will be the case. It is expected and accurate behavior to the fill model. When price gaps in the morning it generally means there was price movement in out-of-session times. This would all be taken into account by the fill model. If you want to fill on the actual bar, use the Liberal fill model. If you want any other behavior you will then need to self program your own.
              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
              650 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              370 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              109 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              574 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              577 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X