Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sim account gives illogical fills

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

    Sim account gives illogical fills

    Click image for larger version  Name:	nt.png Views:	0 Size:	10.2 KB ID:	1181277

    As can be seen my script detect bar 1 and 3 based on their shape, then on the first tick of the next bar it sends a stop buy 1 tick above previous high high. and stoploss below previous low.
    Bar 3 works. But bar 1 gives illogical fill. In reality it never fills. But NT fills the buy entry at a non-existing price then stops out below.

    What can I do to get rid of this? Thank you

    Edit: Version is 8.0.25.0 64-bit

    #2
    Hello xxzbill,

    Thanks for your post.

    What instrument, bar type and bar size are you using?

    What type of order did you place? (What order method did you use?)

    Paul H.NinjaTrader Customer Service

    Comment


      #3
      MES 03-22, 100tick bar chart

      en1 = createEntry(enPrice, GetCurrentAsk(), "en1_LONG");
      activeAcc.Submit(new[] {en1});

      with

      Order createEntry(double enPrice, double ask, string orderName)
      {
      if (ask < enPrice)
      {
      return activeAcc.CreateOrder(
      Instrument,
      OrderAction.Buy,
      //OrderType.StopLimit,
      OrderType.StopMarket,
      OrderEntry.Manual,
      TimeInForce.Day,
      input_qty,
      enPrice,
      enPrice,
      "",
      orderName + DateTime.Now.ToString(),
      DateTime.MaxValue,
      null);
      }
      else
      {
      return activeAcc.CreateOrder(
      Instrument,
      OrderAction.Buy,
      OrderType.Limit,
      OrderEntry.Manual,
      TimeInForce.Day,
      input_qty,
      enPrice,
      enPrice,
      "",
      orderName + DateTime.Now.ToString(),
      DateTime.MaxValue,
      null);
      }
      }

      Edit: the buy statement occurs in OnBarUpdate, with: double enPrice = High[1] + Instrument.MasterInstrument.TickSize;
      Last edited by xxzbill; 12-10-2021, 09:12 PM.

      Comment


        #4
        Hello xxzbill,

        Thanks for your reply.

        One contributing factor can be your PC clock.

        Please use the steps below to change/check your Time Zone and sync the PC clock:
        • Shutdown NinjaTrader
        • Right-click the clock in the lower right corner of your desktop
        • Select Adjust date/time
        • For Windows 10 click 'Date, Time, and regional formatting' -> Then click 'Additional date, time, and regional settings' -> then click 'Set the time and date'
        • Select the 'Internet Time' tab at the top
        • Set the server to time.nist.gov and then click Update.
        • If the message that appears says successful your PC clock should now be updated.
        • If not, select a different server from the Server: drop-down and try again (repeat until one of the servers is successful)
        After updating the PC clock, please restart NinjaTrader, then right-click the chart and select Reload All Historical Data.

        Also, it is possible that the order was filled on the Ask and the Ask may not have been the Last and only the Last is shown in the charts.

        To help illustrate here is a screenshot of a 1 tick chart with 3 data series of Ask, Bid, and Last. The ask is Gold, the bid is Red and the last price is Magenta. As you can see the Last price can either be on the Bid or on the Ask. There are several points where the last was on the bid and of course the ask is always higher than the bid (and the last in some cases)

        Click image for larger version

Name:	xxzbill-1.PNG
Views:	223
Size:	69.7 KB
ID:	1181453

        You could probably use Playback with market replay data and create a similar 1 tick chart to look at the specific area you have in question, assuming the PC clock reset does not resolve the issue.
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        40 views
        0 likes
        Last Post jeronymite  
        Started by bill2023, Today, 08:51 AM
        2 responses
        16 views
        0 likes
        Last Post bill2023  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        167 responses
        2,260 views
        0 likes
        Last Post jeronymite  
        Started by warreng86, 11-10-2020, 02:04 PM
        7 responses
        1,362 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Perr0Grande, Today, 08:16 PM
        0 responses
        5 views
        0 likes
        Last Post Perr0Grande  
        Working...
        X