Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Fill outside the bar...

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

    Fill outside the bar...

    Hi,

    While running NTv6.0.0.6 Strategy Analyzer there are sometimes trade fills appearing outside the prices of the bar at that time, see attached graphic for an example.

    Thanks.
    Attached Files

    #2
    imported post

    Just on one particular order/fill:
    - what type of order was that? (market/limit/stop/stop limit)?
    - what market direction? (long/short)
    - what was the limit and stop price?
    - what was the historical fill price?

    Thanks

    Comment


      #3
      imported post

      Forgot:
      - what was OHLC of the very bar?
      - what was OHLC of the bar before?

      Thanks

      Comment


        #4
        imported post

        I've added comments below at **DT**. Were you able to see the graphic?

        Thanks.

        Dierk Droth wrote:
        Just on one particular order/fill:
        - what type of order was that? (market/limit/stop/stop limit)?
        **DT** Limit.
        - what market direction? (long/short)
        **DT** Covering long and entering short at the same time.
        - what was the limit and stop price?
        **DT** Limit entry at 796.10
        - what was the historical fill price?
        **DT** Filled at 796.10

        - what was OHLC of the very bar?
        **DT** 796.2, 796.4, 796.2, 796.2
        - what was OHLC of the bar before?
        **DT** 796.1, 796.2, 796.1, 796.2
        Thanks

        Comment


          #5
          imported post

          Hmm. To get the information for the previous reply I changed the Strategy Analyzer to show only 1 day's data so I could add some print statements to the code. And the chart looks different. The bar of the fill is now larger (see attached graphic), and the fill is the low of the bar. A couple of questions:

          - How is it possible for the chart to be different? Yes, these are volume bars, but the volume from the start ofa givenday should be the same whether we're chartingthat single day or looking at the day within a chart of several weeks.

          - I thought limit orders in backtesting were only filled if there was a trade through the limit price? The bar of the fill, and the bars before and after all have the same low, equal to the limit entry price of 796.1.

          Thanks.
          Attached Files

          Comment


            #6
            imported post

            Several points -

            Filling outside the bar - This is possible with our conservative fill algorithm. Limit orders submitted that would fill at market (sell limit below the market) will fill at your limit price, not better. This is what you experienced. If you do not agree with our approach, you can add a user defined fill algorithm. This is currently not documented however, all you need to do is make a copy of C:\Program Files\NinjaTrader 6\bin\Custom\Type\@DefaultFillType.cs, open it in VS orsome other editor, change class name, display name and the fill logic. Compile any indicator or strategy in the NinjaScript Editor. Next time you backtest, this new fill type will be an option.

            Chart - If you have session start and endtime defined (not 12 - 12) then the chart should be identical. If this is not the case, please let us know. If the chart is 12 - 12 this is considered 24 hour and bars can span across a calendar day thus you could have a different chart for 3 days than 2 days.

            Ray
            RayNinjaTrader Customer Service

            Comment


              #7
              Updated Question

              Hello,

              I am using NT 6.5 beta, and I get the exact same problem - a signal generates a limit buy order with limit price @ current bar close + 5 ticks; and the system gives me fills on the following price bar, but outside of the price bar (above, at a price that did not exist).

              How can we change this? Ideally, I would like to get the opening price of the following bar, to be able to analyze market behavior alone, without any consideration for market impact (will conduct this analysis at a later stage).

              Thank you,
              Guillaume

              Comment


                #8
                In reality, if your order was live, it would have filled at that price and not worse as the next bar gaps down. Have you tried the Liberal fill type? I can't remember if this algorithm will ensure that you are filled on the bar.
                RayNinjaTrader Customer Service

                Comment


                  #9
                  NT v6.5

                  Thanks for your reply. Yes, I tried the liberal algorithm, and it does fill within the bar. Is it possible to just get the opening price of the bar, to analyze the strategy itself? Would it be possible to modify the code of the existing default algorithms to get this?

                  Thank you,
                  Guillaume

                  Comment


                    #10
                    It is possible to custom program your own fill type algorithm but we do not provide support on how to do this. If you are an accomplished programmer, you can take a look at the source code for the provided fill types located in the \Custom folder and figure out how to code what you want.
                    RayNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by usazencort, Today, 01:16 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post usazencort  
                    Started by kaywai, 09-01-2023, 08:44 PM
                    5 responses
                    603 views
                    0 likes
                    Last Post NinjaTrader_Jason  
                    Started by xiinteractive, 04-09-2024, 08:08 AM
                    6 responses
                    22 views
                    0 likes
                    Last Post xiinteractive  
                    Started by Pattontje, Yesterday, 02:10 PM
                    2 responses
                    21 views
                    0 likes
                    Last Post Pattontje  
                    Started by flybuzz, 04-21-2024, 04:07 PM
                    17 responses
                    230 views
                    0 likes
                    Last Post TradingLoss  
                    Working...
                    X