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:	224
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 burtoninlondon, Today, 12:38 AM
        0 responses
        10 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        14 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Yesterday, 07:51 PM
        0 responses
        14 views
        0 likes
        Last Post strategist007  
        Started by StockTrader88, 03-06-2021, 08:58 AM
        44 responses
        3,983 views
        3 likes
        Last Post jhudas88  
        Working...
        X