Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

On daily charts how can I tell the strategy to take just 1 trade per day?

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

    On daily charts how can I tell the strategy to take just 1 trade per day?

    Hello,

    I would like to go long if the current day opening price is above prior day low
    and then exit with a profit target.

    On daily charts I simply tell the (onbarclose = false) strategy to go long,
    but after my target is hit the strategy keeps on trading and does not wait for the next day.

    How can I tell the strategy to take just 1 trade per day?

    Thank you for any help

    #2
    Hi tradereight, you can for example achieve this type of behavior with boolean flags / user variables - http://www.ninjatrader.com/support/f...ad.php?t=15417

    You would then reset the user variable on a new day / session to activate taking trades again.

    Comment


      #3
      Unfortunatly if the strategy is set to onbarclose = false ninjatrader keeps on opening new trades after the old trade is closed on profit target filled.

      I need to set the strategy on daily chart to onbarclose to access the Opening price of the current day...

      If I use user variables like setting the wait_for_next_day variable to FLASE once a position is filled, how can I reset this variable to TRUE on a new bar?

      Comment


        #4
        Hello,

        You would do this by using the following:



        Code:
         if (FirstTickOfBar)
             {       
            //Reset Variables
              }
        -Brett
        BrettNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        63 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        35 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        54 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        61 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        48 views
        0 likes
        Last Post CarlTrading  
        Working...
        X