Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to restrict strategy to only one trade per day

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

    How to restrict strategy to only one trade per day

    Hello,

    I have a basic breakout strategy which I'm developing that will place one trade per day if the conditions are met. Having backtested the strategy there are instances where the conditions are met twice in the same day therefore a second order is placed - I only want to place one trader per day.

    Is there a way to restrict my strategy to place only one trade per day? If it helps, I'm coding my strategy in the editor.

    Thanks,

    Neil

    #2
    Hello burtoninlondon,

    Thank you for your note.

    I would suggest using a bool variable to keep track whether your one trade has been taken. For example, you could create a bool variable called something like DailyTradeEntered and set this to false initially. You can then check to ensure the bool is false in the conditions for entry, and then when the entry is actually placed, flip the bool to true to keep the entry from being submitted again that day. You can then reset it back to false when Bars.IsFirstBarOfSession is true so you can enter during the next session.



    Please let us know if we may be of further assistance to you.

    Comment


      #3
      NinjaTrader_Kate - thanks for the reply. I was hoping there would be a specific command I could embed in my code but not to worry. I've introduced a bool variable and it works perfectly.

      Thanks again.

      Neil

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      46 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      126 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      66 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X