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 alifarahani, Today, 09:40 AM
      2 responses
      12 views
      0 likes
      Last Post alifarahani  
      Started by junkone, Today, 11:37 AM
      3 responses
      15 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by pickmyonlineclass, Today, 12:23 PM
      0 responses
      1 view
      0 likes
      Last Post pickmyonlineclass  
      Started by frankthearm, Yesterday, 09:08 AM
      12 responses
      44 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by quantismo, 04-17-2024, 05:13 PM
      5 responses
      35 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X