Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom fill types

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

    Custom fill types

    Hello,

    I realise we can write our own fill types, but I was wondering if there's a bit more background/context into how to do that. I looked at the liberal fill type, and I see nothing about volume, bid/ask, or where varaibles such as NextLow are defined. So, there's something wrapping around it?

    thanks
    Dave

    #2
    Hello Dave,

    Unfortunately there isn't additional documentation on this. What may help is comparing the descriptions of the fill types with the code to figure out what it's doing.

    Default
    An algorithm that takes a conservative and more realistic approach to filling limit and stop limit orders.
    • Limit orders only fill if the limit price was penetrated
    • Limit orders are always filled at the limit price specified never better (for example, if a limit order is submitted on bar n, NinjaTrader will check if the order is filled on bar n+1, if this bar gaps down and the limit order was a buy, the order would be filled at the limit price and NOT the high of bar n+1)

    Liberal
    An algorithm that takes a liberal approach to filling limit and stop limit orders.
    • Limit orders fill if the limit price was touched
    • On gap down bars, buy limit orders will fill at the high of the gap down bar
    • On gap up bars, sell limit orders will fill at the low of the gap up bar
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply Ryan, but that is utterly unacceptable. I will go away and test this properly (I shouldn't have to) but if it appears that the fill algorithms provided are as appears then they are useless for any professional testing of scalping.

      I've clearly already become more familiar with the descriptions and code than you suggest, and that should have been obvious.

      As far as I can see it, there are only two possibilities here. Either fill is a lot more sophisticated than I can tell, in which case I'll test it to determine that, or fill is as it appears in the code, in which case you desperately need to allow people to code a decent one and give them the info to do that.

      What is the point of telling people they can code their own if you won't even tell them how the variables are assigned?
      Last edited by dave1992; 12-12-2010, 07:25 AM. Reason: typo

      Comment


        #4
        Thanks, Dave. I'll forward your request for additional documentation in this area.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Ryan,

          I'd prefer answers actually, if you don't mind.

          Does fill take account of volume? If so, how and where?
          Does fill take account of bid/ask. If so, how and where?

          thanks
          Dave

          Comment


            #6
            No, volume is not taken into account for fills in a backtest.

            Historical bid / ask data is not available unless your provider offers this.. Your strategy would then need to be run on this series rather than last.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Thanks Ryan.

              My question refers to Replay rather than backtest. Replay has volume and bid/ask. Are these used in replay fills?

              Comment


                #8
                Replay fills will use the simulator engine so works differently than backtesting fill types we've been discussing. The source code for this is not available for viewing / editing like the backtesting fill types.

                Yes, bid / ask volume and prices are used to determine simulator fills.
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  OK, so the fill type selection box in the strategy dialog, for replay and live sim - does that box do anything? If so, what?

                  Comment


                    #10
                    No, fill type will not do anything on a strategy run on live/ market replay data. It's only used for backtesting fills.
                    Ryan M.NinjaTrader Customer Service

                    Comment


                      #11
                      Right, thanks - you might want to put that in the strategy properties section of Running a Strategy from the Strategies tab.

                      Comment


                        #12
                        Thanks, Dave. The help guide shows this.

                        Fill Type
                        Sets the algorithm for processing and filling orders on the historical data portion of the chart
                        Ryan M.NinjaTrader Customer Service

                        Comment


                          #13
                          There is no chart! It needs to be updated. Besides, 'historical data portion' is a rather convoluted way of saying 'has no effect in realtime'. I guarantee plenty of users won't find that obvious.

                          Comment


                            #14
                            Thanks for the feedback Dave.
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              Originally posted by NinjaTrader_RyanM View Post
                              ....
                              Default
                              An algorithm that takes a conservative and more realistic approach to filling limit and stop limit orders.

                              Liberal
                              An algorithm that takes a liberal approach to filling limit and stop limit orders.
                              ....
                              I believe I understand how the limit orders are treated differently between the two types, but don't yet follow the difference in treatment of stops.

                              Reviewing the code for the fill types, it looks as though the same reasoning applied to limit orders is applied to stops; i.e. in the "default" case, the stop is only triggered if price moves at least 1 tick through the stop price. Is this correct?

                              If this is correct, then I agree that "default" is more "conservative" than "liberal" in terms of limit order fills, but it seems less "conservative" in terms of stop order triggering (since it will be harder to trigger the stop in the "default" case).

                              Have I understood this correctly?

                              Thanks.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by terofs, Yesterday, 04:18 PM
                              1 response
                              21 views
                              0 likes
                              Last Post terofs
                              by terofs
                               
                              Started by CommonWhale, Today, 09:55 AM
                              1 response
                              3 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by Gerik, Today, 09:40 AM
                              2 responses
                              7 views
                              0 likes
                              Last Post Gerik
                              by Gerik
                               
                              Started by RookieTrader, Today, 09:37 AM
                              2 responses
                              13 views
                              0 likes
                              Last Post RookieTrader  
                              Started by alifarahani, Today, 09:40 AM
                              1 response
                              7 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Working...
                              X