Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

How to say 'If candlestick pattern found within last X candles'?

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

    How to say 'If candlestick pattern found within last X candles'?

    Thanks in advance

    #2
    This is with reference to the Strategy Builder

    Comment


      #3
      Hello demo166130,
      Thanks for your post.

      You would need to set the "Trend strength" on the Candlestick pattern indicator to change the number of required bars to the left and right of the swing point used to determine trend.

      https://ninjatrader.com/support/help...ickpattern.htm

      Josh G.NinjaTrader Customer Service

      Comment


        #4
        Im actually using th Strategy Builder so info based around using C# isn't all that helpful, unless I've missed something in the link you provided which is entirely possible. I would like the Builder to say 'IF candlestick pattern X has occured within the last X bars'

        Comment


          #5
          I tried saying 'If Candle stick pattern X Equals True' but thats not compatible with the Builder. Is it supposed to be If candlestick pattern X is candlestick pattern x, so both sides of the condition builder show the same indicator?

          Can you also confirm that the trend strength means, let's say in the case of an engulfing candle, if the strength was set to 4, it would only trigger if the engulfig candle was greater in size than the previous 4 candles? Is that the meaning of this?

          Comment


            #6
            demo166130,

            No you didn't miss anything. Just giving you a reference to see what parameters can actually be set for that indicator.

            Does setting TrendStrength to X not give you the desired results?

            If not, there likely will not be a way through the Strategy Builder.

            Josh G.NinjaTrader Customer Service

            Comment


              #7
              demo166130,

              TrendStrength is going to relate to how far back or how far forward the indicator is looking for the signal from the barsAgo value.
              Josh G.NinjaTrader Customer Service

              Comment


                #8
                I think your missing what I'm unable to do because it is so simple. The Trend Strength helps determine the strength of the candletick, but some candlesticks aren't determined by the trend strength indicator, such as the 'evening star', so I'm looking for a way to say 'if candlestick pattern X has shown itself in the last X bars'. Even if you confirm that isn't possible using the builder, can you explain how you write into the builder the way to say 'If candlestick X occurs', because at present saying 'If Candlestsick X == True' isn't a valid input

                Comment


                  #9
                  demo166130,

                  I am not talking about a trend strength indicator here. In this context TrendStrength is referring to the parameter for the CandlestickPattern Indicator.

                  As seen in the example from the help guide, you would need to compare the candlestick pattern to "1" or "0" instead of true/false.

                  Josh G.NinjaTrader Customer Service

                  Comment


                    #10
                    Im with you, I wasn't referring to a trend strength indicator despite using the phrase. Im trying to understand if it is possible to say 'if candlestick pattern X has ben observed within the last X number of candles' in the same way there exists a lookback period with some indicators to see whether the indicator signal has occurred in the last X number of bars. Adjusting the trend strength only filters out the strength of the candle signal.

                    Even if there isn't a way to do what I'm asking, which seems a little odd because on the surface it isn't that complicated, how would I say to the builder 'If candlestick pattern X occurs'? Would I use Equals and then write the exact same candlestick pattern on the right side of the equation in the Strategy Builder?

                    Comment


                      #11
                      demo166130,

                      In this screenshot I am checking to see if the MorningStar pattern has occurred by comparing its value to "1"

                      Josh G.NinjaTrader Customer Service

                      Comment


                        #12
                        What is meant by comparing it's value to 1. Is this one bar?

                        Comment


                          #13
                          I recently dealt with the same question, so I can probably chime in.

                          comparing it's value to 1 -- that means you are asigning condition "true" -- so if defined candlestick appears, it will register it.

                          Comment


                            #14
                            ExNihilon,

                            That is correct. Comparing this specific indicator to a value of "1" is essentially comparing it to "true"
                            Josh G.NinjaTrader Customer Service

                            Comment


                              #15
                              Good to know, thanks chaps. So negative 1 would be false?

                              But still no way to say 'If pattern has occured with the last 5 bars'?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by ZenCortexCLICK, Today, 04:58 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post ZenCortexCLICK  
                              Started by sidlercom80, 10-28-2023, 08:49 AM
                              172 responses
                              2,280 views
                              0 likes
                              Last Post sidlercom80  
                              Started by Irukandji, Yesterday, 02:53 AM
                              2 responses
                              17 views
                              0 likes
                              Last Post Irukandji  
                              Started by adeelshahzad, Today, 03:54 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post adeelshahzad  
                              Started by Barry Milan, Yesterday, 10:35 PM
                              3 responses
                              13 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Working...
                              X