Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cancelled expired order

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

    Cancelled expired order

    Hi,
    I have spent quite a few hours trying to resolve the problem that I have, and I've searched for the answers for a long while too... I think I am missing something obvious, so please help anyone...

    I have strategy that I would like to "scale out" of position, using ExitLong.../ExitShort... type orders. I've tried "OnPositionUpdate, OnExecution, OnOrderUpdate", all with the same result. Orders are placed as expected, but at the end of the bar they are canceled by NT for some reason, leaving my position "stop-less" and floating on the market. I am attaching a simple example that duplicates the problem, as well as the output from the order trace. Any help will be much appreciated...
    I suppose the question is: Am I doing something wrong, or do I need to resubmit the stop/limit orders at the close of each bar in order to keep them going?

    Roman

    MyOrders.zip

    OrderTrace.txt
    Last edited by Roman; 01-21-2009, 07:21 AM.

    #2
    Please read the "Order Submission for Entry and Exit Methods - Basic Operation" part of this article: http://www.ninjatrader-support.com/H...verview36.html

    You need to keep your orders alive on every bar.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hi Josh,

      Thanks for the super-fast response... and I am not going nuts after all

      ... yet, you've said
      Originally posted by NinjaTrader_Josh View Post
      Please read the "Order Submission for Entry and Exit Methods - Basic Operation" part of this article: http://www.ninjatrader-support.com/H...verview36.html

      You need to keep your orders alive on every bar.
      ... following the link I've read
      "
      By default, orders submitted via Entry() and Exit() methods automatically cancel at the end of a bar if not re-submitted
      Experienced programmers can submit orders that are live until canceled
      "
      So, can it be done? While I am new to NT environment, I would like to think I can write a few lines of code in a few languages... so can it be done. All I am asking for is a clue... I am willing to work on it, to get there

      Your answer would also imply (I think), that these orders never get to the broker and exist on my PC only, is that right?

      or, does the NT cancels them on broker's server on every bar close?

      Roman

      Comment


        #4
        Roman,

        Depending on who your brokerage is your orders will either reside locally or at your brokerage. Please see this: http://www.ninjatrader-support2.com/...ead.php?t=5349

        You can create orders that are liveUntilCancelled. Please see the last method: http://www.ninjatrader-support.com/H...LongLimit.html
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Josh View Post
          Roman,

          Depending on who your brokerage is your orders will either reside locally or at your brokerage. Please see this: http://www.ninjatrader-support2.com/...ead.php?t=5349

          You can create orders that are liveUntilCancelled. Please see the last method: http://www.ninjatrader-support.com/H...LongLimit.html
          Thanks again!

          I think where I am going wrong is that I assume that your documentation is accurate. (full stop) Looking at the help file (even if I use the link provided by you) I have 4 overrides it would seem, yet there are 6 available. On the 4 documented options, it seems impossible to associate the order with the entry signal (I assume it would not be possible to generate an OCO without it). Yet, if I look at the "Intelisens" I have 6 overrides and bingo... i can do what i just wanted to do.
          Sad, that I have to go on this discovery trip... Why not just list all 6 possibilities in the doco? It would save me 10 hours of digging...

          I know, nothing is perfect, yet your help is pretty close to it . Much appreciated!!!

          Cheers,

          Roman
          Last edited by Roman; 01-21-2009, 09:39 AM.

          Comment


            #6
            Not sure what you mean. An entry order has no entry signal to associate it with. fromEntrySignal is only available for exit orders. What is documented is what is supported. What is not documented is not supported.

            http://www.ninjatrader-support.com/H...LongLimit.html has 6 methods outlined.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Josh View Post
              Not sure what you mean. An entry order has no entry signal to associate it with. fromEntrySignal is only available for exit orders. What is documented is what is supported. What is not documented is not supported.
              What I mean that the link you've sent to me states:
              Syntax
              EnterLongLimit(double limitPrice)
              EnterLongLimit(double limitPrice, string signalName)
              EnterLongLimit(int quantity, double limitPrice)
              EnterLongLimit(int quantity, double limitPrice,string signalName)

              My oversight:
              EnterLongLimit(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double limitPrice,string signalName)

              ... as an option for advanced programmers. Apologies but it is 2AM here...
              still no override #6 which is almost identical to the advanced programmers one, but for one thing... parameter 6: string fromEntrySignal, which I assume is required to create an OCO order.

              As per you sample in SampleOnOrderUpdate strategy, which I have just looked at (I wish I've done it earlier):

              targetOrder = ExitLongLimit(
              0, true, execution.Order.Filled, execution.Order.AvgFillPrice + 80 * TickSize, "MyTarget", "MyEntry");

              which has 6 parameters. None of the 5 documented options lists that! Simply I seem not to be able to find that in your help file...

              Cheers,

              Roman
              Last edited by Roman; 01-21-2009, 10:05 AM.

              Comment


                #8
                That is because that page is not even for the same method. I gave you the link to EnterLongLimit() not ExitLongLimit(). Please see the second link posted in my prior post. You will find all six listed.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Josh View Post
                  That is because that page is not even for the same method. I gave you the link to EnterLongLimit() not ExitLongLimit(). Please see the second link posted in my prior post. You will find all six listed.
                  Yes, you are right... I just followed the link you've provided at first and failed to read the heading (still you pointed me to the wrong spot, to start with!). Obviously at 2:44 am I am no functioning as expected...
                  Apologies!

                  Meanwhile, my test strategy is working fine, thanks to your help, even if we had a hick up or two

                  Thanks again... it was much quicker then digging through the entire doco...

                  Roman

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  633 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  364 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  105 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  567 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  568 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X