Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order fills on real time vs market replay

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

    Order fills on real time vs market replay

    hello, need some opinion/help on how i can solve my problem

    problem:

    i've created and tested a system on market replay, and now i am doing testing on real time data. my system enters on a limit order when XYZ happens. Most of my orders on market replay data is filled, however, on real time (still simulation) my orders are not filled and then cancelled.

    Any idea how i can find a solution to this? i do know that market replay data is compiled 1/4 of a second?

    thank you in advance!

    #2
    Hello calhawk01,

    Thanks for your note.

    The orders are likely being cancelled because they are not filled on the same bar. To keep an order alive past the close of the bar it was submitted, use the live until cancelled as true.

    For example:

    EnterLongLimit(0, true, 1, Low[0] - 2 * TickSize, "enterlong");

    EnterLongLimit(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double limitPrice, string signalName)

    Below is a link to the help guide on EnterLongLimit.
    http://www.ninjatrader.com/support/h...rlonglimit.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello calhawk01,

      Thanks for your note.

      The orders are likely being cancelled because they are not filled on the same bar. To keep an order alive past the close of the bar it was submitted, use the live until cancelled as true.

      For example:

      EnterLongLimit(0, true, 1, Low[0] - 2 * TickSize, "enterlong");

      EnterLongLimit(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double limitPrice, string signalName)

      Below is a link to the help guide on EnterLongLimit.
      http://www.ninjatrader.com/support/h...rlonglimit.htm
      will the above order stay live until end of day? or manually cancelled?

      my other question is, how can i mimic my realtime data as close as possible to market replay data? how is market replay data aggregated? anyway to modify real data input to mimic market replay data (since ALL of testing was on market replay data)

      Comment


        #4
        Hello calhawk01,

        The order will stay alive unless something else cancels it. The Exit on close option in the strategy parameters being true will cause the order to cancel when the session closes.

        There is also an option in Tools -> Options... -> Strategies tab -> NinjaScript. This option is in the Order handling. Checking the top option "Cancel entry orders when a strategy is disabled" can also cause the order to cancel when stopping the script.

        Below is a link to the help guide on the NinjaScript tab in options. Please refer to the section 'Understanding the NinjaScript tab'.
        http://www.ninjatrader.com/support/h...tegies_tab.htm


        Market Replay data that is downloaded from NinjaTrader is recording of the days level I and/or level II data. This data is the same data that is received by NinjaTrader live during the trading hours. The feed used for this data does broadcast at 4 ticks per second.
        Live and Replay data should be the same.

        You can also record your active instruments incoming data for use in the Market Replay at a later time.

        To do this:
        • Click Tools -> Options... -> select the Data tab -> check the option for Record for market replay -> click OK
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello calhawk01,

          The order will stay alive unless something else cancels it. The Exit on close option in the strategy parameters being true will cause the order to cancel when the session closes.

          There is also an option in Tools -> Options... -> Strategies tab -> NinjaScript. This option is in the Order handling. Checking the top option "Cancel entry orders when a strategy is disabled" can also cause the order to cancel when stopping the script.

          Below is a link to the help guide on the NinjaScript tab in options. Please refer to the section 'Understanding the NinjaScript tab'.



          Market Replay data that is downloaded from NinjaTrader is recording of the days level I and/or level II data. This data is the same data that is received by NinjaTrader live during the trading hours. The feed used for this data does broadcast at 4 ticks per second.
          Live and Replay data should be the same.

          You can also record your active instruments incoming data for use in the Market Replay at a later time.

          To do this:
          • Click Tools -> Options... -> select the Data tab -> check the option for Record for market replay -> click OK
          Thanks Chelsea. Any way to broadcast 4 ticks per second on real time data? What do you think is causing this order slippage that i'm facing? For example on friday I only had 1 fill, but on market replay data i had 6 fills. Same day.. same orders.. same data.. but different fills. COBC= true...

          Comment


            #6
            Hello calhawk01,

            The Simulator in NinjaTrader (which is used for market replay) uses logic to try and mimic a broker very closely but is unable to perfectly react the way a broker would in a live market.

            Market dynamics are very volatile and even between brokers can give you different fills.

            Also, the time that a strategy is started can also greatly affect how it performs. Are you starting the strategies at the same time?

            When a historical order is waiting to be flat before entering live, this can also prevent orders from placing. At any time was the strategy that was live ever colored yellow in the Strategies tab of the Control Center?

            The live data you receive is determined by the data provider / broker and cannot be changed. Some brokers do send data every quarter second.

            This information will have to be obtained from your broker, however.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_ChelseaB View Post
              Hello calhawk01,

              The Simulator in NinjaTrader (which is used for market replay) uses logic to try and mimic a broker very closely but is unable to perfectly react the way a broker would in a live market.

              Market dynamics are very volatile and even between brokers can give you different fills.

              Also, the time that a strategy is started can also greatly affect how it performs. Are you starting the strategies at the same time?

              When a historical order is waiting to be flat before entering live, this can also prevent orders from placing. At any time was the strategy that was live ever colored yellow in the Strategies tab of the Control Center?

              The live data you receive is determined by the data provider / broker and cannot be changed. Some brokers do send data every quarter second.

              This information will have to be obtained from your broker, however.
              yes the strategies are "enabled" at the same time. i have about 4 strategies. why will that effect my orders?

              i agree, market dynamics can change the orders. however, since i am still in live SIM mode, i would had expected little slippage from what my results were on market replay data; as this causes me to reinvent.. pretty much my entire strategy as my current logic in real time SIM is not behaving as i would had expected it to on market replay. but one way around would be to slow down the real time data.. 4 ticks per sec etc.. still no answer to if/how i can do that

              Comment


                #8
                Hello calhawk01,

                Thanks for your reply.

                It is not possible to change the amount of ticks you receive from your data provider or from the market replay (which is an exact recording of the days events). The data provider that NinjaTrader uses to record data for the Market Replay server, broadcasts 4 ticks per second which is why the Market Replay contains the same data.

                If you record the data using the Record for Replay option in Tools -> Options... -> Data, this will be the exact data that your computer receives live.

                When a historical order is waiting to be flat before entering live, this can also prevent orders from placing. At any time was the strategy that was live ever colored yellow in the Strategies tab of the Control Center?
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_ChelseaB View Post
                  Hello calhawk01,

                  Thanks for your reply.

                  It is not possible to change the amount of ticks you receive from your data provider or from the market replay (which is an exact recording of the days events). The data provider that NinjaTrader uses to record data for the Market Replay server, broadcasts 4 ticks per second which is why the Market Replay contains the same data.

                  If you record the data using the Record for Replay option in Tools -> Options... -> Data, this will be the exact data that your computer receives live.

                  When a historical order is waiting to be flat before entering live, this can also prevent orders from placing. At any time was the strategy that was live ever colored yellow in the Strategies tab of the Control Center?
                  No none of the strats are yellow.

                  Another questions. In your original reply you said orders are cancelled when conditions change; what exactly do you mean by that? So when I submit a limit order and it's not filled. Is it X seconds after the order is filled or is it "conditions change"

                  Comment


                    #10
                    Hi calhawk01,

                    The orders are likely being cancelled because they are not filled on the same bar. To keep an order alive past the close of the bar it was submitted, use the live until cancelled as true.
                    Limit orders that do not have the liveUntilCancelled bool in the call use liveUntilCancelled false by default. A limit order that has liveUntilCancelled false that is not filled in the same bar the order was generated on will be cancelled on the next bar.
                    Chelsea B.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    648 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    369 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    108 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    572 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    573 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X