Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitShortLimit not working if SetStopLoss is set

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

    ExitShortLimit not working if SetStopLoss is set

    I have SetStopLoss in my Initialize(), then I send out an ExitShortLimit when I would like to buyToCover. I can see the ExitShortLimit is placed

    3/2/2009 3:06:45 PM Entered internal PlaceOrder() method at 3/2/2009 3:06:45 PM: Action=BuyToCover OrderType=Limit Quantity=0 LimitPrice=703.25 StopPrice=0 SignalName='TSSFdFixPrf' FromEntrySignal='TSSFdMid'


    But there is not order being placed. Can you tell me why? If I take out the SetStopLoss statement, the ExistShortLimit order works again.

    I use the SetStopLoss() for disastrous event. Another question: Is SetStopLoss() put out the stop order to broker server as soon as the order filled?

    #2
    Please provide the full trace output around that order. Thank you.

    SetStopLoss() puts out the protection immediately.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      As requested
      Attached Files

      Comment


        #4
        At what timestamp did this occur? Thanks.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          See my first message should be around 15:06

          Comment


            #6
            Sorry. I am looking for the TraceOrders = true output to the Output Window. Thanks.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              As you request TraceOrders = True
              Attached Files

              Comment


                #8
                Thanks for posting those, at 6:59:01 your ExitLongLimit expires, as you don't resubmit it. You can set this to liveUntilCancelled, then it will not expire at the next OnBarUpdate() call.

                Comment


                  #9
                  But if you look at the trace, I call the exitLongLimit every OnBarUpdate().

                  If I do not have the SetStopLoss in Initialize(), it works fine.
                  If u look at the attached files. The first buy work as I expected, the second by does not work. ( There is red color statement to mark off the two different cases, with n without SetStopLoss

                  Comment


                    #10
                    How are you determining its not working? Your logs indicates the order is still active.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      I have create a demo strategy to illustrate the problem by using the simulation feed.

                      Start the strategy in the chart
                      If you first put trend gauge to max (i.e, trend up), you will see the following statement in the Output Window:
                      "StopLossTest: Looking for Buy"
                      Now Set the trend gauge to min (i.e. doing a retrace from the up trend), you will see a market buy order after the third down bar.
                      Once you see a Market Buy is executed, you put the trend gauge back to Max, you will then see a ExitLongLimit order out at (entryPrice + 3)>
                      This works perfectly.

                      Now if you restart the strategy and set the SetStopLossFlag to true (This will execute SetStopLoss() inside the initialize()), then rerun the above scenario, the extiLongLimit order no longer work.

                      I hope this small strategy help the investigation
                      Attached Files

                      Comment


                        #12
                        xewoox,

                        Here is your problem: 3/2/2009 6:58:12 PM Ignored PlaceOrder() method at 3/2/2009 6:58:12 PM: Action=Sell OrderType=Limit Quantity=0 LimitPrice=1284.75 StopPrice=0 SignalName=TLFdFixPrf' FromEntrySignal='TLFdMid' Reason='An Exit() method to submit an exit order has been ignore. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.'


                        Please review the rules on the bottom of this article: http://www.ninjatrader-support.com/H...verview36.html


                        Namely this one:
                        Code:
                        Methods that generate orders to exit a position will be ignored if a strategy position is open and:[LIST][*]An order submitted by a set method ([URL="http://www.ninjatrader-support.com/HelpGuideV6/SetStopLoss.html"]SetStopLoss()[/URL] for example) is active[/LIST]
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          The reason I have to SetStopLoss order out there is to protect the disastrous event (e.g. loss the internet connection). Is there a way you can suggest to do the same?

                          Comment


                            #14
                            Use ExitLongStop().
                            Josh P.NinjaTrader Customer Service

                            Comment


                              #15
                              ExitLongStop will not work. I will not be able to put such an order ahead of time. It will fill right away if I replace the ExitLongLimit to ExitLongStop.

                              Once you are in a position, there has to be way to make sure you do not 'lose the shirt' if we lose internet connection.

                              How do NT recommend strategy developer to guard against disastrous event.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              627 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              359 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
                              562 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              567 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X