Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Lack of fills

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

    Lack of fills

    Hi,

    I'd like to know how the slippage setting affects my strategy in real time. I've run backtests over periods where my strategies were running in real life. Many of the trades which occurred in the backtest never materialized in real time.

    I suspected that slippage might have been the key, since I left slippage at the default 0 setting. I thought that this would not matter, since my automated strategy uses simple default market orders.

    Since I don't use limit orders, I should get a fill, no matter how bad the price. Isn't that so? Or does slippage still determine whether I will get filled even when market orders are used? Is my lack of fills caused by setting slippage to 0?

    I've read the guide over and over, so please don't direct me to the guide. The guide simply states that:

    During real-time live brokerage trading, orders are filled according to market dynamics.
    This doesn't help. I thought that as long as the indicator logic flashed positive, the trade would be executed at market at the end of the bar. Someone pls help!

    #2
    Hello skyholder84,

    Slippage only applies to the strategy historically. For real time, your fills are based on the simulator engine or live market dynamics if you're submitting to a live account.

    Yes, backtesting results can vary between real time results. Please see here for discrepancies expected backtesting versus real-time

    For market orders you will typically get a fill right away unless there is no bid / ask volume available for the instrument.

    For your strategy, it would help to add additional signal confirmation. You can add drawing objects that signal when a condition is true, so will work to alert you to true signals independent of order placement.

    If it's not working as you expect, you will want to start to Print() all values that are critical in conditional order placement. To track the flow of strategy order submission, use TraceOrders output. Please see here for help using these debugging tools.

    Finally, the strategies tab of the control center should be monitored for helpful information on the state of the strategy. If it's highlighted yellow, for example, the strategy is waiting for a flate state before it starts submitting orders. This page can help with monitoring the status of strategies on the control center.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan, I'm not sure how the Print command works, and where I can actually see all the values in the output window you mentioned. How do I reach the output window?

      Comment


        #4
        The output window is accessed with Tools > Output Window. This link explains how to use Print(), along with TraceOrders:

        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Hi, I'm having trouble printing indicator values which aren't calculated from the primary bars. Ie, the use of BarsArray seems to prevent the values from being reported correctly.

          Print(String.Format("StoK={0} StoD={1} StDev={2} SMAStDev={3}", Stochastics(7, 14, 3).K, Stochastics(7, 14, 3).D, StdDev(BarsArray[1],14), SMA(StdDev(BarsArray[1],14), 14)));

          The stochastics values are printing fine, but not the StdDev and SMA)StdDev) values.

          Any idea how I could get them to print?

          Comment


            #6
            You'll want to print the double values you're trying to access, and maybe start simple and print one indicator value at a time.

            Print("K " + Stochastics(7, 14, 3).K[0] + " D " + Stochastics(7, 14, 3).D[0] + " StdDev " + StdDev(BarsArray[1],14)[0] + " SMA " + SMA(StdDev(BarsArray[1],14), 14)[0]);
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Awesome! Thanks for fixing the code snippet!

              Also, I select OnBarUpdate, NT calculates indicator values on every tick.

              1) Does this also mean that when the logic is satisfied, an order is immediately sent out? Or is the order submitted only at the end of the bar?

              2) If the order is submitted only at the end of the bar, what happens if the logic which triggered the trade is no longer valid at the end of the bar? Does the trade get canceled?

              Also, you mentioned that it was possible to program a signal confirmation system independent of order placement. How would you suggest I implement this idea?

              Thanks!

              Comment


                #8
                Originally posted by skyholder84 View Post
                Awesome! Thanks for fixing the code snippet!

                Also, I select OnBarUpdate, NT calculates indicator values on every tick.

                1) Does this also mean that when the logic is satisfied, an order is immediately sent out? Or is the order submitted only at the end of the bar?

                2) If the order is submitted only at the end of the bar, what happens if the logic which triggered the trade is no longer valid at the end of the bar? Does the trade get canceled?

                Also, you mentioned that it was possible to program a signal confirmation system independent of order placement. How would you suggest I implement this idea?

                Thanks!
                I just happened across this thread, figured I'd add my two cents since I've worked through this sort of thing in the past.

                Be very careful when calculating on bar tick...especially if you use a crossover type system. You can literally find yourself triggering a hundred crossovers in the space of 5 seconds as an 'on tick' calculation causes the final calculation of your indicator to cross above and below whatever reference line you're using.

                Best bet, in my experience, is to stick with "on bar close."

                Comment


                  #9
                  Yes, if you're using CalculateOnBarClose = false in real time, order are submitted immediately when conditions are true. If you're submitting market orders then they're sent as well, even if the bar closes with the condition false. For stop or limit orders, default behavior is for orders to expire if they are not filled on the bar they're submitted to. If the conditions remain true on the next bar, the orders are resubmitted.

                  You can add drawing actions to draw on your chart when conditions are true. This sample can help with that:
                  Ryan M.NinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by NinjaTrader_RyanM View Post
                    For stop or limit orders, default behavior is for orders to expire if they are not filled on the bar they're submitted to.
                    Can I assume you're referring to managed orders?

                    Comment


                      #11
                      Yes, that applies to managed orders only.
                      Ryan M.NinjaTrader Customer Service

                      Comment


                        #12
                        I've just looked at the output window and I see exactly what you mean cgeorgan. That advice is really a great help. Thanks for the share!

                        Comment


                          #13
                          Hi,

                          Something strange is happening. Apparently, the logic for trades has in fact materialized, and an internal PlaceOrder() event occurred. However, no trade signal was sent.

                          Here are some snippets of the log file, which I have also attached.

                          3/17/2011 10:00:00 AM Entered internal PlaceOrder() method at 3/17/2011 10:00:00 AM: BarsInProgress=1 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='PSARLONG' FromEntrySignal=''

                          After the "Entered internal PlaceOrder() method" signal, no trade was placed.

                          I am using Interactive Brokers and hoping to autotrade YM, ES, TF, CL, BRN, HHI, HSI and GC. Am I able to auto-trade all these products with Interactive Brokers? So far, only ES has traded. The rest have not activated throughout the week. Is the problem caused by an inability to autotrade these tickers on IB?
                          Attached Files

                          Comment


                            #14
                            Thanks, Syholder.

                            To see the whole progression of order submission, can you please send your log and trace files to support 'at' ninjatrader 'dot' com.

                            In the subject, write: Attn RyanM

                            The file you're looking for are:
                            My Documents\NinjaTrader\log\log.20110317.txt
                            My Documents\NinjaTrader\trace\trace.20110317.txt
                            Ryan M.NinjaTrader Customer Service

                            Comment


                              #15
                              Thank you for the files. I see a trade placed on CL at 10:00.

                              Can you please let us know which version you're using? Check with Help > About
                              Ryan M.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by NullPointStrategies, Yesterday, 05:17 AM
                              0 responses
                              64 views
                              0 likes
                              Last Post NullPointStrategies  
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              139 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              75 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              45 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              50 views
                              0 likes
                              Last Post TheRealMorford  
                              Working...
                              X