Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 OllieFeraher, Today, 11:14 AM
      0 responses
      1 view
      0 likes
      Last Post OllieFeraher  
      Started by aman jain, 10-01-2020, 09:25 PM
      3 responses
      292 views
      0 likes
      Last Post Legiboka  
      Started by quicksandatl, Today, 11:11 AM
      0 responses
      3 views
      0 likes
      Last Post quicksandatl  
      Started by reynoldsn, Today, 07:23 AM
      5 responses
      12 views
      1 like
      Last Post NinjaTrader_Gaby  
      Started by pecunianonolet, 11-28-2016, 03:34 AM
      6 responses
      4,514 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X