Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Only one entry per bar?

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

    Only one entry per bar?

    Hello,

    I am testing my strategy using the Playback connection, and everything appears to be working well, but I am having one small issue. If a single bar which triggers my entry also grows long enough to trigger all of my exits, the entry conditions still exist, and it immediately jumps back into another entry during that same bar. I don't want that to happen. I want it to wait at least until that bar closes before it starts looking for the conditions for a new entry.

    I know about IsFirstTickOfBar, but that won't work, because, obviously, I want to be able to enter and exit within the same bar. And I can't use the Maximum Entries per Direction, because I've actually exited at that point.

    Does anyone have any suggestions about how to get it to ignore entry conditions that may be still be present if there have already been trades within that bar?

    Thanks in advance!

    #2
    Hello NjMatthew,

    Thank you for your inquiry.

    You can use a bool to determine when it is OK to enter a new trade. Require the bool to be true in order to enter a new position. Set the bool to false after entering, and reset the bool back to true after your exit.

    Please let us know if you have any further questions.

    Comment


      #3
      Originally posted by NinjaTrader_Gaby View Post
      Hello NjMatthew,
      You can use a bool to determine when it is OK to enter a new trade. Require the bool to be true in order to enter a new position. Set the bool to false after entering, and reset the bool back to true after your exit.
      I actually set it up the opposite way. I have a boolean that is false when I am not in a trade, and is true when I have an open position. Absolutely irrelevant to the function of the algorithm, I know, but I just wanted to let you know that it works now.

      Thank you!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      87 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      128 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      65 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      117 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      67 views
      0 likes
      Last Post PaulMohn  
      Working...
      X