Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

strange simulator execution

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

    strange simulator execution

    strategy is running in sim mode on TICK bars
    the orders are "Enter Limit" type
    the setting of Limit orders on touch is OFF

    what is the logical explanation for the strategy behaviour ?

    pls see the picture. the trigger was at 11617.5 and the price went through it so the limit order would not trigger, and indeed I have an open SHORT limit order waiting,
    but than there was a tick higher at 11618. and the strategy DID NOT trigger in real data flow situation. I have run it again as historical mode and and it DID trigger.
    So I assume it is an internal ninjatrader market simulator logic? correct ?

    is it also fare to assume that in real live execution it will depend on the Market available contracts and my place in the queue ? Is my thinking correct ?

    Thanks Click image for larger version

Name:	2018-10-22_11-32-47.png
Views:	163
Size:	28.9 KB
ID:	1036639



    #2
    Hello dadarara,

    Thanks for your post.

    There are going to be differences between order fill simulations with historical data and those with realtime data. One major difference is calculating fill price using historical OHLC values from the primary data series, vs. using actual tick data to simulate order fills. Adding intrabar granularity, or using High Order Fill Resolution can help.

    Testing with Market Replay data in the Playback Connection is a good way to test your code using mimicked realtime data, however there still will be real world differences like latency and place-in-queue which would not be seen in simulations.

    I've included some information on the discrepancies seen between historical and realtime data, and have included links for High Order Fill Resolution and adding intrabar granularity.

    Discrepancies between historical and realtime - https://ninjatrader.com/support/help...ime_vs_bac.htm

    Understanding Historical Fill processing (see High Order Fill Resolution) - https://ninjatrader.com/support/help...ical_fill_.htm

    Backtesting with intrabar granularity - https://ninjatrader.com/support/help...ipt_strate.htm

    Keeping these differences in mind, I would suggest taking debugging steps using the Playback Connection and adding prints for your logic to find out if the triggers are actually getting hit, or if the order fills are not in line with the tick data. (As mentioned order fills will be expected to have some difference.)

    Debugging tips - https://ninjatrader.com/support/help...script_cod.htm

    Playback Connection - https://ninjatrader.com/support/help...connection.htm

    Let us know if there is anything else we can do to help.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by algospoke, 04-17-2024, 06:40 PM
    5 responses
    45 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by arvidvanstaey, Today, 02:19 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by mmckinnm, Today, 01:34 PM
    3 responses
    5 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by f.saeidi, Today, 01:32 PM
    2 responses
    8 views
    0 likes
    Last Post f.saeidi  
    Started by alifarahani, 04-19-2024, 09:40 AM
    9 responses
    55 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X