Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Difference Live data - simulation

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

    #16
    Brett,

    I know that the order is executed at the bid price because:
    a) I see it on the chart which runs on bid prices
    b) I can verify it with the historical data mangager
    c) I see the current bid/ask prices in IB

    I use the unmanaged approach, for the code please see post # 11.

    Thank you
    DH

    Comment


      #17
      Hello,

      I have done some testing on this. And have found both to be true I see it occur in both cases even with unmanaged orders.

      The simulation engine is an advanced fill engine that is driven off volume, chance to fill, latency, place in line.

      It could be the limit order is just first in line therefor it is filling first for example.

      However I have tested this on my side and I am seeing fills occur correctly.

      Let me know if I can be of further assistance.
      BrettNinjaTrader Product Management

      Comment


        #18
        Brett,
        thank's for testing but I am not sure that we talk about the same thing. Maybe I did not explain it well, sorry.

        I will try to explain the specific circumstances of this case once more:

        Setup:
        1. strategy running on a chart on last (=bid) 1 minute data (GBP/USD)
        2. a buy limit order
        3. real time data from IB
        4. no broker connection

        Outcome / Problem:
        As soon as the bid price hits the buy limt price the order is executed. And that's wrong. This will almost never happen.

        I know this is hard to test, but I am sure there is a bug.
        Thanks,
        DH

        Comment


          #19
          Please clarify your setup. Are you using simulated accounts or are you using live accounts? Is this order against sim (if sim, sim where? IB sim or NT sim?) or on live? Thank you.
          Josh P.NinjaTrader Customer Service

          Comment


            #20
            The strategy runs on a simulated 'NT account (Sim101).

            Comment


              #21
              Hello,

              Ok that was just to double check.

              The internal simulator is proprietary fill engine and it will try to fill your orders in simulation as life like as possible.

              Of coarse no simulation can get it 100 percent. I have run a few tests and have found it to fill on the ask when going long on my side,

              and I have seen it fill on the bid just as the ask price was coming down to hit it. Most likely the tick/order processor fills the order if your first in line with the first ask tick possibly before it is even drawn on the screen due to screen latency?

              Let me know if you have further questions.
              BrettNinjaTrader Product Management

              Comment


                #22
                Brett,
                I will collect some samples and post the screenshots here. This could take some days because it does not happen too often that the bid price is the lowest price in a ceratin span of time and my buy order is exactly at this price.
                Thanks,
                DH

                Comment


                  #23
                  DH,

                  This is ok however the fill engine is working in this case a expected, if it does not occur everytime as it is a proprietary fill engine developed by NinjaTrader that has been in use for many years. You may get files at any location due to the fill engine.

                  Let me know if I can be of further assistance.
                  BrettNinjaTrader Product Management

                  Comment


                    #24
                    Originally posted by NinjaTrader_Brett View Post
                    DH,

                    This is ok however the fill engine is working in this case a expected, if it does not occur everytime as it is a proprietary fill engine developed by NinjaTrader that has been in use for many years. You may get files at any location due to the fill engine.

                    Let me know if I can be of further assistance.
                    Brett,
                    I did some screenshots with replay data GBP/USD of today to demonstrate whats going on. The same is happening with live data: You always get a fill at the bid price.
                    Thanks,
                    DH
                    Attached Files

                    Comment


                      #25
                      Hello,

                      Can you please post a screenshot of your chart settings on this chart. Right click on goto Data Series and take a screenshot of this window.

                      I look forward to assisting you further.
                      BrettNinjaTrader Product Management

                      Comment


                        #26
                        Originally posted by NinjaTrader_Brett View Post
                        Hello,

                        Can you please post a screenshot of your chart settings on this chart. Right click on goto Data Series and take a screenshot of this window.

                        I look forward to assisting you further.
                        Here you go:
                        Attached Files

                        Comment


                          #27
                          Hello,

                          Ok this chart proves then that a trade did occur at the price you displayed in your chart and I think this is where you are missing. As the chart is based on Data Type: Last. Last data bid shows that the last price was there, does not show in relation to the bid or the ask price. Since the last price was there and the last trade was at those lows, this proves that the bid was in fact 1 tick lower then this since a trade did occur here.

                          Since a trade did occur most likely on the ask the simulator will fill.

                          For your chart to be valid you would need to change this Price Based on setting to Ask. To get the bid prices plotted to the chart for the ask price.

                          However the simulator will always trade based of last price and if there are trade taking place at that price point which your chart proved then it will fill you there.

                          Let me know if I can be of further assistance.
                          BrettNinjaTrader Product Management

                          Comment


                            #28
                            I am confused.

                            Originally posted by NinjaTrader_Brett View Post
                            Hello,

                            Ok this chart proves then that a trade did occur at the price you displayed in your chart and I think this is where you are missing. As the chart is based on Data Type: Last. Last data bid shows that the last price was there, does not show in relation to the bid or the ask price. Since the last price was there and the last trade was at those lows, this proves that the bid was in fact 1 tick lower then this since a trade did occur here.
                            The bid was not one tick lower, the fill was at the bid price.

                            Since a trade did occur most likely on the ask the simulator will fill.

                            For your chart to be valid you would need to change this Price Based on setting to Ask. To get the bid prices plotted to the chart for the ask price.
                            The bid price for the ask price?

                            However the simulator will always trade based of last price and if there are trade taking place at that price point which your chart proved then it will fill you there.

                            Let me know if I can be of further assistance.
                            Does that mean, running a strategy with live data but on a simulation account, the bid/ask is not taken into consideration?

                            Thanks
                            DH

                            Comment


                              #29
                              Hello,

                              There are 3 types of data to display, bid data, ask data, and last data. You can choose what to plot on the chart. Currently the chart is only plotting last data which is when trades occurs.

                              A trade occured at the lows of the trade you pictured. This doesnt indicate if the trade was a bid price or an ask price trade. However generally when you have a trade lower a tick the bid and ask will follow or lead this movement.

                              NinjaTrader needs to know only if there has been a trade at this level. The simulator will fill based upon this. If the bid price is at 1000 and the ask price is at 1001. For the simulator to fill you there needs to be a trade at 1000, indetermanant of the bid level or ask level there just needs to be volume at the level to execute a trade at this level. This is how the simulator is designed.
                              BrettNinjaTrader Product Management

                              Comment


                                #30
                                Hello Brett,
                                this is OK for the stock market.
                                But in the forex spot market you don't have a last price nor a volume of the last price, only bid and ask prices and their corresponding volume. There is no trade, so to speak.
                                Thanks,
                                DH
                                PS: For executions, does it matter what I plot on the chart?

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                636 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                366 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                107 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                568 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                571 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X