Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Builder - enter after 3 bars have closed up

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

    Strategy Builder - enter after 3 bars have closed up

    My brain is fried after trying to get rich with the perfect strategy -- not that I could figure this out, anyway -- but how would I use Strategy Builder to enter long after 3 bars in a row have closed up?

    Thanks a ton!

    #2
    Hello Indy73,

    Thanks for your post.

    When you create the condition of Close > Open you can set the "Bars ago" value. So for 1 pair (Close>Open) the bars ago would be 0 (for the current bar), the next pair would be set to 1 for the previous bar and the last pair would be set to 2 for 2 bars ago. When all three conditions are true, the "Do the following" would be actioned.

    Here is a screenshot of what the conditions would look like. Note that "Close" is replaced by "Default input" and this is expected when using the "Close" price.

    Click image for larger version

Name:	indy73-1.PNG
Views:	977
Size:	27.0 KB
ID:	1048147
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks, Paul -- you NT support folks are f'n AWESOME!!!

      Comment


        #4
        Is it possible to also tell the strategy NOT to enter after 4 bars? I have a similar issue, but I don't want to enter the trade after 4 bars, as that is too late of an entry for my strategy.

        Comment


          #5
          Hello Fness2020,

          Thanks for your post and welcome to the NinjaTrader forums!

          Can you clarify or expand your example?

          4 bars after what? a previous exit? a previous condition?


          Paul H.NinjaTrader Customer Service

          Comment


            #6
            I just mean I want my strategy to enter on the 3rd up bar that meets my criteria, but if it doesn’t meet my criteria by then, I don’t want to enter the trade.

            For example, if I want to enter long on the 3rd bullish candle in a row when the MACD is above 0, I don’t want to enter if the MACD crosses 0 on the 4th green candle. That’s too late and I would rather wait for a pullback. I hope that makes sense

            Comment


              #7
              Hello Fness2020,

              Thanks for your reply.

              Then your entry condition would need to include your MACD requirements of the MACD line being greater than zero.
              Paul H.NinjaTrader Customer Service

              Comment


                #8
                I understand that the MACD must be included, that's not my question though. However I think I figured it out.
                See I'm using renko bars in my strategy and I wanted to make sure it was a maximum of 3 bullish bricks in a row for a long entry and a maximum of 3 bearish bricks for a short entry.
                Hopefully this helps somebody in the future:

                High[0} > High[1]
                High[1] > High[2]
                High[2] > High[3]
                High[3] < High[4]

                This ensures that I only enter on a specific pattern of 3 green bars after 1 red bar for a long entry and vice versa for a short entry when all other conditions are met.

                Comment


                  #9
                  Originally posted by NinjaTrader_PaulH View Post
                  Hello Indy73,

                  Thanks for your post.

                  When you create the condition of Close > Open you can set the "Bars ago" value. So for 1 pair (Close>Open) the bars ago would be 0 (for the current bar), the next pair would be set to 1 for the previous bar and the last pair would be set to 2 for 2 bars ago. When all three conditions are true, the "Do the following" would be actioned.

                  Here is a screenshot of what the conditions would look like. Note that "Close" is replaced by "Default input" and this is expected when using the "Close" price.

                  Click image for larger version  Name:	indy73-1.PNG Views:	862 Size:	27.0 KB ID:	1048147


                  Hello,
                  I am trying to use NinzaRenko and program the reversal entry, so far I was able to use the Bars in a Row following the Close/Open pattern you provided. Is there a way to make it stop trading after it takes 1 trade in the same direction? For example, using your example it will wait up to 8 bars for the first entry but then after that it is repeatedly entering longs until the direction changes. I have tried to get it to trigger off EMA/SMA cross but it wont execute the trade.

                  Comment


                    #10
                    Hello Chaos05,

                    Thank you for your post.

                    Can you clarify, when you say "stop trading in the same direction" - do you mean for the strategy to stop trading entirely, or prevent the strategy from entering in the same direction more than once? (i.e. only allow for flipping between long, short, long, short etc.)
                    Gaby V.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_Gaby View Post
                      Hello Chaos05,

                      Thank you for your post.

                      Can you clarify, when you say "stop trading in the same direction" - do you mean for the strategy to stop trading entirely, or prevent the strategy from entering in the same direction more than once? (i.e. only allow for flipping between long, short, long, short etc.)
                      Hi, I have currently fixed half the problem with a Group Condition to make it so that it won't take a 2nd long until after a short is taken, but what I really want is to have it so that if there are 8 bars in a row long, it takes 1 trade, then if there are say 4bars in a row short, it will reset back to being able to take a long after 8 bars long again. I have made some attempts to get it to reset after a small reversal then reverse back to long again.
                      Click image for larger version

Name:	image.png
Views:	122
Size:	7.3 KB
ID:	1319463
                      In this scenario, it could have be a losing long trade, then change to short for 3 bars which is not enough to trigger a short trade but then go back to 8 long bars so I want it to not take Longs immediately after a winning long, but make it wait until the direction changes then changes back and restarts the counter of 8 bars without having to have a short trade in between.

                      Comment


                        #12
                        Click image for larger version

Name:	image.png
Views:	106
Size:	47.3 KB
ID:	1319466
                        Here is an example, it had a long winning trade, it went short 2 bars, so id like it to enter on the 2nd blue circle again​

                        Comment


                          #13
                          Ok I actually figured it out to work how i want it, but my last question is how can I make it so the bars in a row can be adjusted in the properties instead of having to change them using the strategy builder by adding or deleting x number of close/Open

                          Comment


                            #14
                            Hello Chaos,

                            This would not be possible in the Strategy Builder as it would require using a for loop, and this logic can only be done in an unlocked script.
                            Gaby V.NinjaTrader Customer Service

                            Comment


                              #15
                              Originally posted by NinjaTrader_PaulH View Post
                              Hello Indy73,

                              Thanks for your post.

                              When you create the condition of Close > Open you can set the "Bars ago" value. So for 1 pair (Close>Open) the bars ago would be 0 (for the current bar), the next pair would be set to 1 for the previous bar and the last pair would be set to 2 for 2 bars ago. When all three conditions are true, the "Do the following" would be actioned.

                              Here is a screenshot of what the conditions would look like. Note that "Close" is replaced by "Default input" and this is expected when using the "Close" price.

                              Click image for larger version

Name:	indy73-1.PNG
Views:	977
Size:	27.0 KB
ID:	1048147
                              How would you add a print in Strategy Builder that prints the relevant information for all of the Close>Opens ?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by michelz, 02-18-2025, 08:30 AM
                              18 responses
                              364 views
                              0 likes
                              Last Post neveral0n3  
                              Started by laketrader, 03-10-2025, 07:20 AM
                              4 responses
                              33 views
                              0 likes
                              Last Post laketrader  
                              Started by owensd, 04-21-2024, 11:34 PM
                              19 responses
                              188 views
                              0 likes
                              Last Post Leeroy_Jenkins  
                              Started by bokorb, Yesterday, 02:45 PM
                              2 responses
                              24 views
                              0 likes
                              Last Post bokorb
                              by bokorb
                               
                              Started by Schools, Yesterday, 03:32 PM
                              1 response
                              26 views
                              0 likes
                              Last Post Schools
                              by Schools
                               
                              Working...
                              X