• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Potential Bug with TimeInForce and EntriesPerDirection

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

    Potential Bug with TimeInForce and EntriesPerDirection

    Hi, I have stumbled upon a potential bug.

    Please use my attached strategy as a demo. For my test, I used SPY as the primary instrument, 30 minute bars from 1/1/2016 - 1/1/2018.

    When running a multi-instrument strategy, TimeInForce is set to Day, and ExitOnSessionClose is False, there seems to be a problem entering positions in the secondary instrument due to EntriesPerDirection. It is as if the strategy is seeing phantom positions in the secondary instrument.

    Running my strategy, it prints an output every time conditions are met to go long in the secondary along with a counter (i.e. "Test - Should Have Entered #332"). This is very different to the number of trades seen in the Strategy Analyzer, which suggests that EnterLong is being called but nothing is being executed because the EntriesPerDirection rule is being violated. This shouldn't be the case though, as the secondary has a separate, unique string. This also doesn't seem to affect the primary instrument.

    It seems that this problem can be overcome by setting EntriesPerDirection to some very high value (e.g. 10,000), by setting TimeInForce to Gtc, by setting ExitOnSessionClose to true, or by using day bars instead.

    It also seems that the phantom positions are being taken when an order is placed on the 4:00 pm bar (note, using US Equity RTH) such that it should be entered at the open of the next bar/day. It's fine if the trade is not taken seeing as TimeInForce is Day, but it seems weird that it occupies a phantom position and therefore blocks further entries.
    Attached Files

    #2
    Hello wuileng,

    Thank you for your post.

    I am able to reproduce this behavior on my end. I will report this to our development team and follow up with you when I have any details.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Hello wuileng,

      Thank you for your patience.

      A fix is planned for the next release of NinjaTrader 8. I cannot guarantee implementation of the fix at this point and I do not have a release date for the next release.

      Please let me know if you have any questions.
      Last edited by NinjaTrader_PatrickH; 02-28-2018, 07:51 AM.
      Patrick H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Hanstanz, Today, 04:44 AM
      0 responses
      2 views
      0 likes
      Last Post Hanstanz  
      Started by juniortut, Today, 04:38 AM
      0 responses
      3 views
      0 likes
      Last Post juniortut  
      Started by rojiinko, Today, 03:58 AM
      0 responses
      3 views
      0 likes
      Last Post rojiinko  
      Started by mreanuzlazx, Today, 01:30 AM
      0 responses
      3 views
      0 likes
      Last Post mreanuzlazx  
      Started by xinepev, Today, 12:33 AM
      0 responses
      4 views
      0 likes
      Last Post xinepev
      by xinepev
       
      Working...
      X