Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reversing a position after stoploss triggered

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

    #16
    No, I am saying to monitor for it in your code directly.

    Code:
    if (Position.MarketPosition == MarketPosition.Long)
         EnterShortStop(....);
    Josh P.NinjaTrader Customer Service

    Comment


      #17
      Thank you

      Thank You Josh,
      You are the Man! I finally get it. I've been going nuts for a week. Thanks for your patience! Now I'm off to make money! Have a great day.
      Rick

      Comment


        #18
        Well, it appears I was a little premature in my celebration, but don't worry Josh I still think your the man.'
        I think I'm running into an order handling rule problem. I need to use a stoploss with my regular entry and the stop entry in order for the strategy to work. I think I understand that there can't be 2 entries with and exit. Is that right? Can the EntriesPerDirection solve this issue for me?
        If I use the stoploss the stop entries are not recognized.
        Rick
        Attached Files

        Comment


          #19
          Rick, with this approach you're running into our 'Internal Order Handling Rules' - http://www.ninjatrader-support.com/H...verview36.html (bottom section of this link).

          You will need to monitor the price directly and then submit only the one needed leg of your entry bracket to workaround this.

          NinjaTrader 7 will also offer a completely unmananged approach to order submission -

          Comment


            #20
            In my strategy I think I could get around this challenge if I could reference my entry points without actually having an entry. It seems to me this would be an easy thing to do. We reference that point when our conditions are met for entries, stoplosses, drawing, sounds, etc. So is there a way to just reference that point to put into a stop entry? You showed me how to do that on a reverse by using Position.AvgPrice in the StopEntry while determing if the last position was long or short. How can I reference a possible entry condition price without being in any position at all.
            Rick

            Comment


              #21
              Rick,

              You need to move away from the Strategy Wizard then and custom program your own variables and track the states yourself in the variables.
              Josh P.NinjaTrader Customer Service

              Comment


                #22
                Can you give me an example of how to identify and plug the variable into a strategy? I use a crossover for my entries. How would I tell the strategy to reference the price at which crossover occurs and then plug that number into a stopentry? I think the strategy would also need to identify again the direction the crossover was calling in order to fill the correct stopentry. I'm thinking the Position.MarketPosition==MarketPositionLong/Short may not work to identify direction in this case as the trade may be the first of the day, etc.
                Thanks,
                Rick
                Last edited by RickStevenson1; 02-25-2010, 09:03 PM.

                Comment


                  #23
                  Rick,

                  You need to create a variable and store it.

                  Code:
                  if (CrossAbove(....))
                  {
                       someVar = Close[0];
                  }
                  Any time in the future now when you want to reference the price at the crossover you can use someVar to get that price.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #24
                    Reversing a Position using Strategy Wizard

                    I am unable to get strategy wizard to reverse a position after my stop loss has been triggered. Please see the attached graphic showing how I tried to set this up when reversing long positions.
                    Attached Files

                    Comment


                      #25
                      George,

                      It looks pretty close and it may just be a matter of submitting the order on the wrong side of the market.

                      A sell stop order above the last traded price will be rejected.

                      Sell stop orders should be below where the market is currently trading.

                      If you want to place a sell order above the last traded price, this should be a limit order.
                      Ryan M.NinjaTrader Customer Service

                      Comment


                        #26
                        Ryan,

                        The value of StopLoss is 24 ticks, so the order should still be below the market. Should the plus (+) sign be changed to a minus (-) as in "Position.AvgPrice - StopLoss" I was not able to do that using the wizard. Also tried a limit order and that did not work either.

                        Comment


                          #27
                          Right - that was my first thought. You're submitting it 24 ticks above your entry price. This will typically be above the last traded price and then rejected.

                          To find out what's actually going with your strategy you'll need to view TraceOrders output.

                          You can type a minus sign in the offset field for 24 ticks below your entry price. Attached screenshot of this.
                          Attached Files
                          Ryan M.NinjaTrader Customer Service

                          Comment


                            #28
                            Didn't work. Is there a way to use the wizard to enter code "TraceOrders = true"

                            Comment


                              #29
                              Adding TraceOrders requires working with code. You'll need that to figure out what's happening exactly.
                              • What can you tell so far?
                              • How are you verifying it's not working?
                              • Is the strategy in a long position?
                              • Is the order submitted?
                              • Are there any other working orders at the same time?
                              Ryan M.NinjaTrader Customer Service

                              Comment


                                #30
                                I have inserted the code. I don't see any error messages on the log tab. I can see the historical orders on the chart when I attach the strategy but I don't see any reversal orders showing on the chart after my stops have been triggered.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                648 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                369 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                108 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                572 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                574 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X