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

Create paintbar of Key reversal bar

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

    Create paintbar of Key reversal bar

    There are 2 indicators that show Key Reversal Bars but they show them in separate indicator windows. How can I show them as a paint bar on the price chart when they occur. If there is a Key reversal bar down say it would paint that bar orange and for a Key reversal bar up say it would paint purple. With the paintbar I would not need the seperate indicator windows.
    Thanks

    #2
    Originally posted by petvett View Post
    There are 2 indicators that show Key Reversal Bars but they show them in separate indicator windows. How can I show them as a paint bar on the price chart when they occur. If there is a Key reversal bar down say it would paint that bar orange and for a Key reversal bar up say it would paint purple. With the paintbar I would not need the seperate indicator windows.
    Thanks
    A key reversal alone will not tell you a lot. The key reversal gets interesting

    - if you eliminate all key reversals with an active trading range
    - if you use a second indicator to determine overbought and oversold conditions based on the price volume distribution of the current day

    What is your definition of a key reversal?

    Comment


      #3
      Hello petvett,

      Thanks for your post.

      You can change the color of a bar based on conditions by setting the BarColor variable.

      For example:

      if (SMA(19)[0] < SMA(20)[0])
      {
      BarColor = Color.Green;
      }

      Below is a link to the help guide on BarColor.
      http://www.ninjatrader.com/support/h...7/barcolor.htm

      If you would like assistance getting the values from the indicators, please let me know the names of the indicators you are working with.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Do I do this by setting up a new indicator called bar color? I could not find where to choose a variable bar color. I am looking at the indicator called Key Reversal bar up and Key reversal bar down. If those conditions are met I would like that bar to be a different color. Thanks for your help.

        Comment


          #5
          Harry there is an indicator listed in the package called Key reversal Bar. It is when price makes a new high (or low) and then reverses and closes in the bottom 25% of that bar (closes in the top 25%).
          Thanks
          Ron

          Comment


            #6
            Hello,

            Try adding a line similar to this to the end of the OnBarUpdate() method.

            if (/* conditions here */)
            {
            BarColor = Color.Green;
            }

            Where it says /* conditions here */ replace this with the conditions of your choosing.

            To do this you will need to make a copy of the indicator with a different name. The original indicator will be locked from editing.

            To copy the script:
            • Click Tools -> Edit NinjaScript -> select KeyReversalUp -> click OK
            • Right-click the code in the code editor window -> select Save As...
            • Give the new script a unique name such as KeyReversalUpModified -> click OK
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by petvett View Post
              Harry there is an indicator listed in the package called Key reversal Bar. It is when price makes a new high (or low) and then reverses and closes in the bottom 25% of that bar (closes in the top 25%).
              Thanks
              Ron
              I don'T know which indicator you talk about. NinjaTrader comes with two indicators called KeyReversalUp and KeyReversalDown, and there is no 25% rule that can be derived from the code.

              Below is a sample chart, arbitrarily chosen. I do not think that this is really a good selection of key reversals. Out of 9 identified reversal bars, a single one is valid, 6 lack any significance, because they are narrow range bars and 2 just show the resumption of an existing trend, which is not a reversal.
              Attached Files

              Comment


                #8
                Here is a litte chart with a few filtered key reversals. The reversals are shown as paintbars. There is no additional plot. The R is only plotted, once the high (key reversal up) or the low (key reversal down) has been taken out, which is used to confirm the reversal.

                A 2-bar-reversal, which is also known as a railway (one track down, another track up), is a reversal pattern derived from two bars. If you paint the composite candle built from two bars, you will see the one bar pattern. Therefore the railway is just a reversal pattern on a higher timeframe, that is a 30 min timeframe for a 15 minute chart.
                Attached Files
                Last edited by Harry; 09-04-2013, 02:23 PM.

                Comment


                  #9
                  Hi Harry,

                  I wanted to let you know I helped petvett with his code directly.

                  Thank you for your insights here.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    Me too

                    Hello Chelsea, I too have been trying to color a bar based on the Key Reversal Indicator. Is it possible for you to pass on the code you helped Pet With. Thanks

                    Comment


                      #11
                      Hello 123tangerine,

                      The script we worked on was directly on petvett's computer.

                      However, I will request that he share his code with you in this forum thread.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Key reversal paintbar

                        Here is the script Chelsea helped me with for key reversal paint bar down:
                        Last edited by petvett; 01-29-2014, 10:17 AM.

                        Comment


                          #13
                          Key reversal paintbars

                          Sorry. I did not know how to export the scripts. Here they are. Thanks
                          Attached Files

                          Comment


                            #14
                            Thank you very much Sir!

                            Comment


                              #15
                              I’m also trying to show key reversal bars. I like to use:-

                              Sell reversal bar: (H>=H[-1],C<(L+(H-L)/2.5)
                              Buy reversal bar: (L<=L[-1],C>(H-(H-L)/2.5))

                              I thought I would find this as an option in the candlestick pattern indicator, but not that I can see.

                              How can I paint the bars in this way?

                              Thanks

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by f.saeidi, Yesterday, 12:14 PM
                              9 responses
                              23 views
                              0 likes
                              Last Post f.saeidi  
                              Started by Tim-c, Today, 03:54 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post Tim-c
                              by Tim-c
                               
                              Started by FrancisMorro, Today, 03:24 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post FrancisMorro  
                              Started by Segwin, 05-07-2018, 02:15 PM
                              10 responses
                              1,772 views
                              0 likes
                              Last Post Leafcutter  
                              Started by Rapine Heihei, 04-23-2024, 07:51 PM
                              2 responses
                              31 views
                              0 likes
                              Last Post Max238
                              by Max238
                               
                              Working...
                              X