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

Histogram Question

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

    Histogram Question

    This is probably a stupid question, but how do I set a histogram to have a "center value" of 50 (originating the drawing of the historgram at 50 instead of 0 - which appears to be the default).

    This of plotting a Stochastic %K indicator as a histogram with a center level at 50%. So anything below 50% would be plotted from 50% to ??. And anything above 50% would be plotted from 50% to ??

    Thanks in advance.

    NinjaScript is really cool. Should have started with it earlier.

    #2
    Hi Bmatheny,

    Thank you for posting.

    While I do not know how to calculate for a histogram, there are plenty of histogram indicators available to look at and use as a resource from our support forum.

    One that stood out when I looked was the CCI Histogram.
    http://www.ninjatrader.com/support/forum/local_links.php?action=ratelink&linkid=78&catid=-1&lpage=1


    I will also leave this thread open for any of other members would be able to assist you in this matter.

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your quick reply, but this code does not address the root issue of my post. This clearly shows how to custom color any histogram level beyond certain levels. But I'm looking to change the "Base Level" of a histogram from ZERO to some other value (like 50).

      Is there any way to accomplish this?

      Thanks

      Comment


        #4
        Hi Bmathenym,

        Could you please provide examples of what you are trying to accomplish, such as picture, links or code from some indicator that you are looking at.

        Thank you for your patience.
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by Bmatheny View Post
          This is probably a stupid question, but how do I set a histogram to have a "center value" of 50 (originating the drawing of the historgram at 50 instead of 0 - which appears to be the default).

          This of plotting a Stochastic %K indicator as a histogram with a center level at 50%. So anything below 50% would be plotted from 50% to ??. And anything above 50% would be plotted from 50% to ??

          Thanks in advance.

          NinjaScript is really cool. Should have started with it earlier.
          A histogram, by statistical definition, can only be based on zero as the y-origin.

          What you can do for any oscillator, however, is shift the reference values. So, for example, you can make the oscillator plot from -50 to +50, or -100 to +100 instead of from 0 to 100. Then your histogram will plot on both sides from zero. If you shifted your plot from 0 to 100 to be -50 to 50 for example, then the original 50 will be 0, original 0 will be -50 and original 100 will be 50. All relative information is, therefore, retained; but absolute values will, of course shift.

          Comment


            #6
            Here is an example of what I'm trying to accomplish.
            Attached Files

            Comment


              #7
              Hi Bmatheny,

              Thank you for the example.

              The best method I can think of to accomplish this task would be to use the DrawLine() function to create your own kind of bar for graphing it. You can set your conditions for when the RSI is greater than and plot that way.

              http://www.ninjatrader.com/support/h...l?drawline.htm
              Cal H.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by Bmatheny View Post
                Here is an example of what I'm trying to accomplish.
                You would probably need to use a custom Plot to do that.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by timko, Today, 06:45 AM
                2 responses
                12 views
                0 likes
                Last Post NinjaTrader_ChristopherJ  
                Started by habeebft, Today, 07:27 AM
                0 responses
                4 views
                0 likes
                Last Post habeebft  
                Started by Tim-c, Today, 03:54 AM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by rocketman7, Today, 01:00 AM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by wzgy0920, 04-23-2024, 09:53 PM
                3 responses
                76 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Working...
                X