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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      62 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      134 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      75 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      50 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X