Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

LiveUntilCancelled

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

    LiveUntilCancelled

    I have been spending a lot of time stripping my code back to get it debugged and have noticed that there are a couple of times that an entry should be placed but it isn't. It appears that it is because it was not filled on the same bar and therefore it was cancelled automatically. I need to set my entry order to be live until cancelled.

    In looking through the overloads for my order entry, it appears that there is only one option to include the live until cancelled, but it comes with in barsInProgressIndex as the first overload, which I don't understand what to do with that. I have read the material in the help section and it appears that it is only dealing with multi-instrument strategies.

    my current entry looks like this:

    Code:
    if (SignalCandleLong == true)
    			{
                    LongEntryA = EnterLongStop(DefaultQuantity, TrendPilotPricesLong(EntryPerc, StopPerc, TargetPerc).LongEntry[0], "LongEntryA");
                    LongEntryB = EnterLongStop(DefaultQuantity, TrendPilotPricesLong(EntryPerc, StopPerc, TargetPerc).LongEntry[0], "LongEntryB");
    				barResetUp = true;
    I need to set both of those entries to live until cancelled. Can you please help me with
    1. Should I be using barsInProgressIndex with this in some way?
    2. If I should, what should go in that field?
    3. If not, how do I continue forward with my entry logic making sure that it is live until it is either cancelled or filled?


    Thank you for your help.

    #2
    Hello jg123,

    You would need to use 0 for the bars in progress as this will reference the primary series that you are running the strategy on.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      This helped a ton. Thank you.

      I have gone through and tested all of my entries for Long and Short and they are all working perfectly now. I really appreciate the help.

      Now to add in the next steps....hmmm, long processes to get this all correct, but I am sure that it will pay off.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      582 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      338 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      554 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      552 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X