Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

limit orders, market replay and the ten minute time frame

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

    #16
    the last of the attachments is here as I was limited to 5 per post
    Attached Files

    Comment


      #17
      Hello johnls101,

      Running your basic code I see fills at the closest tick to the Lower Bollinger level. I see the same with your screenshots.

      Where are you pulling your expected price levels for the Limit Orders from if not the Lower Bollinger?

      Comment


        #18
        Thanks Patrick

        I agree that the fills are mostly within a tick above the limit price, but for what I am looking at, this makes all the the difference. It makes back testing and market replay completely meaningless. I have already noted that more trades are being entered than I would expect. Sometimes this makes an unprofitable system look better than it is and other times, a profitable system look worse than it should be. I get that this is probably the result of the filling algorithm trying to allow for slippage. However, there must be better ways of approaching this such as using the level 2 data. Isn't this a problem that should be corrected?

        Comment


          #19
          Ok. Interesting.

          E mini fills are only at a tick, which is every .25.
          You'll never get a fill of .68, so I'm not surprised you're seeing .75 as fill.

          Round2TickSize won't help entirely as you'll probably round up to .75 and not .50.

          You might want to add your own custom logic to round down to .00,.25,.50,.75.

          Comment


            #20
            Patrick and Sledge

            Could I make a suggestion for NinjaTrader's fill algorithm for limit orders. The current approach can be made to be both much more realistic and conservative by only buying at the expected limit price after exceeding this price by one tick. However, having a limit fill system that does not adhere to the limit is just crazy and inaccurate. One should aim to make any back testing as close to real life as possible and I would have thought that the current approach can be improved without too much effort. At least, we should have this choice.

            If anyone else agrees with my thoughts on this, I'd really appreciate a bit of support here.

            johnls101

            Comment


              #21
              Try it in a live ES market. I bet you get rounded up to the next tick.

              Comment


                #22
                Sledge, I will give the live trading a go and let you know what happens. You are right! I should make sure I am clear what actually happens first!

                In terms of rounding down (or up when limit short) I was thinking of using the C# modulus operator after diving by 0.25. I might need some help with this when I get to it and there might be a cleaner way, but I'll look at this over the next week. If in real life buy-limits are rounded up rather than being strictly adhered to, it would be critical to modify my limit indicators this way. Perhaps there is even a way of using the minimum tick value for all futures contract to make the process generic rather than specific for the S&P 500

                Comment


                  #23
                  Might even get rejected entering a limit order and non tick size.
                  I've never tried.

                  I just use market orders in ES. Slippage hasn't been a problem. I did get one day 3 points in my favor though!

                  Comment


                    #24
                    Each broker may be different, of course, but with Interactive Brokers, an order that is not a multiple of 0.25 is not accepted.

                    I have then tested this on Ninja trader when connected to IB and trading manually. When in NT, this rounds the limit price up or down to the nearest 0.25 and asks if that is what you want to submit.

                    It appears that this rounding process is the way Ninja trader "translates" the order before it is submitted to IB.

                    Of course anyone who has a banding strategy where the bands are derived from some kind of indicator or algorithm are likely to have limit orders where the raw limit figures are usually not a multiple of 0.25.

                    I think that I need to look into to this modulus process so that buy limits are rounded down (and rounded up for shorts) . I'll get back to you when looking at the way of making this generic for all futures contracts.

                    Comment


                      #25
                      Originally posted by johnls101 View Post
                      Each broker may be different, of course, but with Interactive Brokers, an order that is not a multiple of 0.25 is not accepted.



                      I think that I need to look into to this modulus process so that buy limits are rounded down (and rounded up for shorts) . I'll get back to you when looking at the way of making this generic for all futures contracts.
                      Round2TickSize https://ninjatrader.com/support/help...trument_ro.htm

                      It'll get you close, but not if you are looking for floor or ceiling of tick on long/short.

                      I guess you could take the difference and subtract .25 if > .125.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by AaronKoRn, Yesterday, 09:49 PM
                      0 responses
                      11 views
                      0 likes
                      Last Post AaronKoRn  
                      Started by carnitron, Yesterday, 08:42 PM
                      0 responses
                      10 views
                      0 likes
                      Last Post carnitron  
                      Started by strategist007, Yesterday, 07:51 PM
                      0 responses
                      11 views
                      0 likes
                      Last Post strategist007  
                      Started by StockTrader88, 03-06-2021, 08:58 AM
                      44 responses
                      3,981 views
                      3 likes
                      Last Post jhudas88  
                      Started by rbeckmann05, Yesterday, 06:48 PM
                      0 responses
                      9 views
                      0 likes
                      Last Post rbeckmann05  
                      Working...
                      X