Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit in Strategy without PT (Woodies Exit)

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

    Exit in Strategy without PT (Woodies Exit)

    Good Day,

    I'm looking for a solution how to program (set up) exits from strategy in section Edit NinjaScript-Strategy. I want to exit on the second consecutive bar against position (price candle color change). That means for long position two consecutive red bars and vice versa.

    #2
    Hello,

    You can use a combaiton of the MarketPositon and the Price Data in order to accomplish this.

    To compare that last two bars, you'd use barsAgo 0 for the current bar, and barsAgo 1 for the previous bar.

    I've attached some screen shots that should help
    Attached Files
    MatthewNinjaTrader Product Management

    Comment


      #3
      Thank you very much for your flawless customer service.

      One more question: How to combine your solution with my strategy entries?

      Let me describe: To go long enter if CCI 50 crosses above -100 and CCI 14 crosses above 0 line
      To exit the position: the second consecutive bar against position (price candle color change).

      Please have a look at the attached



      Both don't work properly. Entry is carried out on the very second bar after "SET 1 condition" bar and Exit occurs randomly... I don't understand and most likely I loose something in there.

      Comment


        #4
        Hello ZdenaVyzila,

        Thank you for your response.

        I have created a short video detailing this item at the following link: http://screencast.com/t/ZefEU43z

        Please let me know if you have any questions.

        Comment


          #5
          Hi,
          your solution doesn't work for my strategy... Please have a look at the picture below and you see what I mean. Thank you.

          Comment


            #6
            Hello ZdenaVyzila,

            Thank you for your response.

            What does Set 1 and Set 2 look like now on the Conditions and Actions tab of the Strategy Wizard?

            If possible please provide screenshots of these two Sets.

            Comment


              #7

              Comment


                #8
                Hello ZdenaVyzila,

                Thank you for your response.

                Please try only what is listed in the attached image for Set 2 and you can remove Set 3's conditions and actions.
                Attached Files

                Comment


                  #9
                  Great Solution!

                  But with one tiny problem: Strategy sells one bar after demanded bar to exit...And don't you know how to set entering a position on close instead of open or how to set enters generally? Strategy enters on a bar after one where strategy signalling...have a look at the attached and you'll see what I mean..

                  Comment


                    #10
                    Hello ZdenaVyzila,

                    Thank you for your response.

                    You will then wish to use the same conditions as Matthew had detailed where Close[0] < Open[1] and Close[1] < Open[2] (see attached screenshot #1).

                    For the order entries, if you would like to them to enter intra-bar you may wish to use CalculateOnBarClose = false, which can be set by unchecking the CalculateOnBarClose option on the General tab (see attached screenshot #2).

                    Please let me know if you have any questions.
                    Attached Files

                    Comment

                    Latest Posts

                    Collapse

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