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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      45 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      21 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      31 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X