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

Better Volume Indicator HELP

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

    Better Volume Indicator HELP

    I am using the Better Volume indicator and I am try to create a new indicator based on information from Better Volume indicator. I am try to look at the LowChurnBar and make it so that if LowChurnBar > 0 then painbar. However it does not work.

    LowChrunBar > 0 still shows all the volume bars

    LowChrunBar < 0 Shows nothing at all

    So I check to see if I can reference it at all. I chose a bar that according to the Data Output windows LowChurnBar volume was 788 contracts. I then entered:

    LowChurnBar = 788 only shows that bar. So it works.

    However I need it to paint those bars where LowCHurnBar > 0. Can anyone help?

    #2
    What is the Better Volume indicator? This is not a NinjaTrader default indicator. We would not be able to provide support for how a 3rd party indicator should work.
    RayNinjaTrader Customer Service

    Comment


      #3
      Suburban: You may be using that "beta" version. I posted a new Better Volume Indicator to the file sharing area a few weeks ago. It paints the price bars the same color as the volume bars are painted. This may do what you want.

      I'm not clear whether you are trying to paint price bars or volume bars. Individual price bar colors can be controlled. Individual indicator colors can't unless you create more plots to use with different colors.

      In the code I uploaded, a LowChurnBar happens when the variable bc==5. When this happens, you can compare Values[bc][0] (which is the same as LowChurBar[0]) to something, and then maybe plot something else according to some condition you set.

      -Alex
      Last edited by anachronist; 09-28-2008, 07:07 PM.

      Comment


        #4
        Hello,

        Generally you are correct regarding the coloring of the price and histogram bars.

        Can you please post the code that you are referring to specifically?
        DenNinjaTrader Customer Service

        Comment


          #5
          Here is a partial code piece....

          if (CODE && BetterVolume(5,false,true).LowChurnBar[0] >0)
          BackColor = Color.Cyan;

          The above is what I was trying but does not work as stated in my earlier post. My goal is to create an indicator which references the state of the Better Volume Indicator. I tried as you suggested as below.

          if (CODE && BetterVolume(5,false,true).Values[bc][0] > 0)
          BackColor = Color.Cyan;

          I get an error during compiling which states the name "bc" does not exist in the current context.

          So the untimate question is how do I reference the current state of the Better Volume Indicator in my custom indicator.

          Thanks for all your help.

          PS. I am using the new Better Volume Indicator (Not Beta)

          Comment


            #6
            Hello,


            That compiling error means you have not declared the variable bc in the proper scope, if at all.

            Here are some examples on how to declare a variable using an indicator variable:

            double swing_high = Swing(5).SwingHigh[0];

            double my_sma = SMA(Close, 14)[0];

            Note the Swing indicator has two Plots so I have do designate which one I want with .SwingHigh[0]. You can find the names of the plots/DataSeries you need to use by double clicking the Properties within the bottom part of the indicator code you are referencing.

            Also, note that custom indicators work in the same manner as default indicator in this regard.
            DenNinjaTrader Customer Service

            Comment


              #7
              Originally posted by suburban View Post
              if (CODE && BetterVolume(5,false,true).LowChurnBar[0] >0)
              BackColor = Color.Cyan;

              The above is what I was trying but does not work as stated in my earlier post. My goal is to create an indicator which references the state of the Better Volume Indicator. I tried as you suggested as below.
              OK, I thought you were trying to modify the BetterVolume indicator itself.

              if (CODE && BetterVolume(5,false,true).Values[bc][0] > 0)
              BackColor = Color.Cyan;

              I get an error during compiling which states the name "bc" does not exist in the current context.
              That's because 'bc' is a local variable in BetterVolume, not externally visible. Use 5 instead of bc to get LowChurnBar value.

              If you look at the code for BetterVolume, you'll see a variable 'bc' (meaning 'bar color') is set to 0, 1, 2, 3, 4, or 5, depending on what will be painted: normal volume bar, low bar, climax bar, churn bar, climax churn bar, or low churn bar, respectively. So use those numbers for the values you want.

              So the untimate question is how do I reference the current state of the Better Volume Indicator in my custom indicator.
              You could also try referencing LowChurnBar as BetterVolume(5,false,true).LowChurnBar.Get()

              (Unfortunately I'm not in front of my NinjaTrader computer or I could test this).
              -Alex

              Comment


                #8
                Not There Yet........

                Thanks everyone for your input on this. I tried the get as typed below and still got an error. Not sure about that you ment by using 5 instead of bc. Perhaps when you get back to your computer you can post after checking or futher clarify. Again I appreciate your help on this, and everyone else too.


                Suburban

                Comment


                  #9
                  Hello,


                  Please post the code that you have now and I will assist you with it.
                  DenNinjaTrader Customer Service

                  Comment


                    #10
                    Here is the code

                    Here is the code I am using but is not working.

                    if (CODE && BetterVolume(5,false,true).LowChurnBar[0] >0)
                    BackColor = Color.Cyan;

                    this code is referencing the Better Volume Indicator and its current state. Here is the code for the Better Volume Indicator. I am trying to get the state of the bar. According to this code it is a local variable called "bc" whose state can be 1,2,3,4, or 5. However i cant access this variable in my indicator since it is only a local variable. How can I access it or what do I need to do to the original Better Volume Indicator to create a global variable which contains the same information that I can access through my indicator?

                    Comment


                      #11
                      Code is too mong to post

                      The Better Volume Code was too long to copy and paste. So here is the indicator itself.
                      Attached Files

                      Comment


                        #12
                        Hello,

                        You are trying to determine whether the LowChurnBar is being called or not, correct? Your condition would do that.

                        Maybe there is something wrong with the CODE part.

                        To test this just use the LowChurnBar part and see if the condition works then.
                        DenNinjaTrader Customer Service

                        Comment


                          #13
                          Tried that

                          Ben

                          Then CODE before is additional code which is functional. But for the purposes of testing I did remove it and still got the same result.

                          Comment


                            #14
                            Hello,


                            I suggest putting your chart on a very small timeframe and use Print() to deteremine when the LowChurnBar is greater than zero or not. Sorry, I am not that familiar with the indicator.
                            DenNinjaTrader Customer Service

                            Comment


                              #15
                              Lets try from this approach

                              Ben

                              I know the data I need sits in a local variable called bc. How can I make that variable global or create a global variable which would have the information contained in local variable bc. This new global variable would have to be accessable by another indicator.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by jclose, Today, 09:37 PM
                              0 responses
                              4 views
                              0 likes
                              Last Post jclose
                              by jclose
                               
                              Started by WeyldFalcon, 08-07-2020, 06:13 AM
                              10 responses
                              1,413 views
                              0 likes
                              Last Post Traderontheroad  
                              Started by firefoxforum12, Today, 08:53 PM
                              0 responses
                              10 views
                              0 likes
                              Last Post firefoxforum12  
                              Started by stafe, Today, 08:34 PM
                              0 responses
                              10 views
                              0 likes
                              Last Post stafe
                              by stafe
                               
                              Started by sastrades, 01-31-2024, 10:19 PM
                              11 responses
                              169 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Working...
                              X