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 Walter2011, Today, 08:27 AM
      2 responses
      6 views
      0 likes
      Last Post Walter2011  
      Started by arangocj, Today, 06:28 AM
      1 response
      14 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by BIllblast, Today, 08:03 AM
      4 responses
      15 views
      0 likes
      Last Post BIllblast  
      Started by jerryblack, Yesterday, 05:04 PM
      3 responses
      16 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by mattage86, Today, 06:43 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_RyanS  
      Working...
      X