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.

    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.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Rapine Heihei, 04-23-2024, 07:51 PM
      2 responses
      30 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by Shansen, 08-30-2019, 10:18 PM
      24 responses
      943 views
      0 likes
      Last Post spwizard  
      Started by Max238, Today, 01:28 AM
      0 responses
      9 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by rocketman7, Today, 01:00 AM
      0 responses
      7 views
      0 likes
      Last Post rocketman7  
      Started by wzgy0920, 04-20-2024, 06:09 PM
      2 responses
      28 views
      0 likes
      Last Post wzgy0920  
      Working...
      X