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

Internal Order Handling Rules look like applied to market order

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

    #16
    Hello margandi,

    Thanks for your reply.

    You can debug your strategy using print statements. If you add a print statement to print the value of BarSinceEntry() inside the 2nd entry block you would see that it returns a value greater than 1 which is what your entry condition for the 2nd entry specifies.

    Here is what we see in the output window with added print statements to your code:
    11/28/2006 3:00:00 PM EnterLong - First
    11/28/2006 3:00:00 PM EnterLong - Second BarsSinceentry = 16
    11/28/2006 3:00:00 PM ExitLong LL
    Strategy 'ChanKenXshares/-1': An Set() method to submit an exit order at '11/28/2006 3:00:00 PM' has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.


    When you have the first entry on the same bar at the same time as the second entry, the object that updates BarsSinceEntry() has not instantaneously updated it as fast as your code requires, this means that BarsSinceEntry would be using a prior bars entry and not the current bars entry.

    What you can do is to add further logic to ensure that 2nd entry does not occur in the same bar by saving the current bar number in your first entry and then checking to see if the current bar is not equal to that saved bar number in your second entry.

    Paul H.NinjaTrader Customer Service

    Comment


      #17
      thank you!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by geddyisodin, 04-25-2024, 05:20 AM
      8 responses
      58 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by halgo_boulder, 04-20-2024, 08:44 AM
      2 responses
      21 views
      0 likes
      Last Post halgo_boulder  
      Started by mishhh, 05-25-2010, 08:54 AM
      19 responses
      6,189 views
      0 likes
      Last Post rene69851  
      Started by gwenael, Today, 09:29 AM
      0 responses
      5 views
      0 likes
      Last Post gwenael
      by gwenael
       
      Started by Karado58, 11-26-2012, 02:57 PM
      8 responses
      14,830 views
      0 likes
      Last Post Option Whisperer  
      Working...
      X