Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

New order every bar

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

    New order every bar

    If I have code like this:

    PHP Code:
    protected override void OnBarUpdate()
    if (High[1] > 0)
         EnterLongStop(10, "long"); 
    
    Assuming price is greater than zero at all times, this will mean that this entry condition is always true. Also assume that price never reaches 10, so the entry order is never filled. I've found that in this case, the entry order will get cancelled and re-submitted every time a new bar begins to draw. Is there a way to stop this from happening, and only have the entry order be cancelled if the entry conditions are no longer true?

    #2
    Hello,

    Please see our Reference Sample on Keeping orders alive for instructions on how to prevent the order from canceling with every new bar:

    MatthewNinjaTrader Product Management

    Comment


      #3
      Thanks, that worked.

      Comment


        #4
        Glad to hear it.
        MatthewNinjaTrader Product Management

        Comment


          #5
          Edit: Never mind, I figured it out.
          Last edited by Radical; 12-13-2011, 08:44 PM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          666 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          377 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          110 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          575 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          580 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X