Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Wrong level at BUY LIMIT order

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

    Wrong level at BUY LIMIT order

    Hello, I made a strategy that use buy limit order. The problem appears when I want to buy on a level, and the next bar is a down gap.
    For example:

    Last bar is Close at 6010 point.
    And then...
    EnterLongLimit(6000);
    but the next bar open at 5900
    The correct is that NT8 but at level 5900 because 5900 < 6000 and all broker will put the order at market level.
    But NT8 but at the High level of the new bar.
    Attached Files

    #2
    Hello polxx,

    Thank you for your post.

    You can review the fill logic used on the historical data in NinjaTraader 8 at the following link: http://ninjatrader.com/support/helpG...ical_fill_.htm

    What price would you consider the market price in this instance?

    I look forward to your response.

    Comment


      #3
      This rules are wrong. The correct rules are:

      When the OPEN price of the bar is LOWER than the CLOSE price then:
      1. Open price to the Low price
      2. Low price to the High price
      3. High price to the Close price

      When the OPEN price of the bar is UPPER than the CLOSE price then:
      1. Open price to the High price
      2. High price to the Low price
      3. Low price to the Close price

      This is not certain to be the true behavior within each bar. But it is very likely to be the way I have described it.


      Anyway, think on this basic example:

      protected override void OnBarUpdate()
      {
      EnterLongLimit(6000);
      }


      Think a simply graph with 2 bars:
      bar 1: open = 6010, high = 6015, low = 6005, close = 6010
      bar 2: open = 5900, high = 5905, low = 5895, close = 5900

      When we put a buy litmit order on any broker at level 6000, and the next bar open at 5900, all the broker launch the order at market price, because 5900 level are a best opportunity than 6000 level.

      But NT8 don't launch the order at the open price in this case.

      Comment


        #4
        Hello polxx,

        Thank you for your response.

        Do you have a sample strategy that produces the behavior in your original post on this thread?
        If so, can you attach it to your response or send it over to platformsupport[at]ninjatrader[dot]com with this thread referenced in the body and 'ATTN: Patrick H' in the subject line?

        You can export your strategy by going to Tools > Export > NinjaScript Add On > Add > select your strategy > OK > Export > name the file 'NTsupport' > Save.

        The file will be located under Documents\NinjaTrader 8\bin\Custom\ExportNinjaScript. Please attach the file to your response.

        I look forward to assisting you further.

        Comment


          #5
          Please open Strategy Analyzer, Data Series Type = Day,
          for example FDAX, then looking for a big down gap.
          Attached Files

          Comment


            #6
            Hello polxx,

            Thank you for your patience.

            This breaks down to the fact we are basing fills on the bars objects and on the close of those objects. As the historical fill processing is looking bar to bar rather than tick-by-tick it would make sense that a Buy Limit order may see the fill below the price it was submitted.

            There is no means around this, but I would recommend testing this same item in the Playback Connection: http://ninjatrader.com/support/helpG...connection.htm

            Please let me know if you have any questions.

            Comment


              #7
              I have tested this issue with another trading platform:
              VisualChart works correctly
              Multichart works correctly
              NT7 works wrongly

              And I have tested a new idea, launch a stop market order at gap,
              and NT8 works correctly.

              Concluision:
              EnterLongStopMarket (and short) + NT = ok
              EnterLongLimit (and shor) + NT = fail
              Attached Files

              Comment


                #8
                Hello polxx,

                Thank you for your response.

                Can you provide the code used in NinjaTrader 7 in that example?

                I look forward to your response.

                Comment


                  #9
                  Use this system in time frame of 1 day.

                  Parameters:
                  Day, month and year is the date previous to a gap
                  level, is the level that will launch the order
                  limit1_Stop2, indicating 1 will launch a limit order, indicating 2 will launch a stop order

                  It can be proved, stop order work fine and fill the order at open price of the next bar of gap. But limit order work wrong throwing the order at impossible level in reality

                  In NT8 the same thing happens.
                  Attached Files

                  Comment


                    #10
                    Hello polxx,

                    Thank you for your response.

                    Can you clarify on what price you are setting the variable "level" to?

                    I look forward to your response.

                    Comment


                      #11
                      Open Strategy Analyzer. FDAX. TimeFrame = 1 day.
                      Look for a big gap between 2 days.
                      Indicate the DAY, MONTH and YEAR of the previous day to gap.
                      Indicate LEVEL that the system try to buy or sell. For example:

                      Gap beetwen days 2017/04/21 and 2017/04/24, then:
                      DAY = 21
                      MONTH = 4
                      YEAR = 2017
                      LEVEL = 12200
                      LIMIT1_STOP2 = try 1 (for sell limit order) and 2 (for buy stop order)
                      When launch a limit order the operation is incorrect!!!.
                      When launch a stop order all is ok!!! and operates at the open of the next bar.
                      You can also try this for down gap. The problem is the same for NT7 and NT8.

                      Comment


                        #12
                        Hello polxx,

                        Thank you for your response.

                        Currently, this is the expected behavior for historical fills. If you would like I can submit a feature request for the change you requested.

                        Please let me know if I may be of further assistance.

                        Comment


                          #13
                          Originally posted by polxx View Post
                          Hello, I made a strategy that use buy limit order. The problem appears when I want to buy on a level, and the next bar is a down gap.
                          For example:

                          Last bar is Close at 6010 point.
                          And then...
                          EnterLongLimit(6000);
                          but the next bar open at 5900
                          The correct is that NT8 but at level 5900 because 5900 < 6000 and all broker will put the order at market level.
                          But NT8 but at the High level of the new bar.
                          Experiencing the very same issue as you are.

                          Comment


                            #14
                            Hello Serje,

                            Thank you for your post and welcome to the NinjaTrader Support Forum!
                            Originally posted by Serje View Post
                            Experiencing the very same issue as you are.
                            This is expected behavior if what you are seeing is truly what was detailed in this thread.
                            If you would like I can submit a feature request for a change to the historical fill processing.

                            Please let me know if you have any questions.

                            Comment


                              #15
                              Hello,

                              I am also experiencing this error. I guess if your development staff implements the enhancement about "Custom Filled Algorithm" as in NT7 (SFT-1137), this error could be easily solved.

                              If this enhancement is not scheduled, then submit a feature request for a change to the historical fill processing, please.

                              Thanks

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by funk10101, Today, 12:02 AM
                              1 response
                              11 views
                              0 likes
                              Last Post NinjaTrader_LuisH  
                              Started by GLFX005, Today, 03:23 AM
                              1 response
                              6 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by nandhumca, Yesterday, 03:41 PM
                              1 response
                              13 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by The_Sec, Yesterday, 03:37 PM
                              1 response
                              11 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by vecnopus, Today, 06:15 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post vecnopus  
                              Working...
                              X