Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reversing a position

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

    Reversing a position

    Hello,
    I'm new here. I've read almost all the posts available on the subject and I can't figure out how to program a reverse in the Wizard. Any suggestions?
    sd

    #2
    Hello sdgardiner,

    Welcome to our forums.

    By default entries will reverse a position. You would have to add a condtion to your entries to verify that you're flat if you wanted to change this behaviour.

    For a reversal strategy you just need at least one long entry and one short entry.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Are you refering to a simple cross over strategy? What I am trying to do is trigger a reversing entry off a stop loss trigger. For example, if I were to be long from a price and get stopped out. I want to enter the market short from that level. I can do this manually, but would like to be able to program it into a strategy. Thank you
      SG

      Comment


        #4
        Hello sdgardiner,

        No, I'm not referring to a CrossOver strategy.

        All entries will reverse a position unless told to do otherwise. You could have:

        Code:
         
        if (Condition1)
          EnterLong();
         
        if (Condition2)
          EnterShort();
        These entries will reverse.

        When working with stop losses as reversal, there are at least a couple different approaches.

        1) Submit an EnterShortStop() order at your long entry price - some ticks
        Code:
        EnterShortStop(DefaultQuantity, Position.AvgPrice + -10 * TickSize, "");
        2) Work with GetProfitLoss() and submit an order based on that value.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          How can I stop this reversal behaviour using the Wizzard?

          I built a strategy using the CCI indicator, with a set of conditions to enter long when CCI crosses above the zero line and a 2nd set of conditions to enter short when it crosses below. I also included a target and a stop loss. Now, when it hits the stop loss, it reverses automatically, which I do not want to.

          I tryed to include a condition to enter if position quantity is zero, but it still reverses, probably because it gets flat first when it hits the stop, then it enters the other direction because the position quantity was zero after hitting the stop loss.

          Thx.

          Comment


            #6
            Hello BBzDan,

            I have attached an image showing these settings in the strategy wizard.

            Strategy -> Current Market Position == Strategy -> Flat
            Attached Files
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              OK, thank you.

              Dan

              Comment


                #8
                If I am using a strategy that gets stopped out, why does the strategy get right back in the same direction? The initial conditions are still met, but I don't want to continue entering after getting stopped out.

                Comment


                  #9
                  Hello sdgardiner,

                  One way to solve this is add a bool condition for your entry, and then set this bool condition as false when the condition is true. Sample pseudocode below.

                  Code:
                   
                  if (yourCondition && yourBoolFlag)
                      {
                      EnterLong();
                      yourboolFlag = false;
                      }
                  Ryan M.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

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