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 create multiple Histograms Stacked in 1 indicator

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

    How to create multiple Histograms Stacked in 1 indicator

    Hi,

    Currently I have 5 indicators on my charts, each with a different setting, is it possible to put all 5 histograms on one indicator? where they are "stacked"?

    That means there would be 5 "baselines" , which is no problem making the lines at 5 different levels as long as there is room for histograms on each of the baselines. BUT if i use plots with BAR, the bars start from the value of 0, and I dont know how i can make it start from whichever of the 5 baselines I wish.

    Is there a way to have a StartValue of the Bar?

    BTW, I also thought of using DrawRegion, but I figure that since the bars are multicolored, I would have to put a unique tag for every bar, and since there are 5 histograms each with positive and negative values at the same time, that would mean I would need 10 tags for each bar, which I believe would be significantly memory intensive. Is that right? If I had 1000 bars on the chart?

    So I am hoping to find a way to use plots.

    Thanks in advance.

    #2
    Hello KhaosTrader,

    Yes, you can add multiple plots to a single indicator with AddPlot().

    The plots will have the z-order of the order they are added.

    As an example, the Buy sell volume indicator included with NinjaTrader has two bar style plots added.

    However, when using the Bar plot style, the bar will always be from 0.

    To have these start from an arbitrary value instead of a measurement from 0 up to the plot value, you would instead need to custom render this instead of using a plot.


    There is not a start value for plots. Plots have a single value per bar and this is what is plotted.

    Using individual calls to Draw.Rectangle() would cause these drawing objects to accumulate in memory. (These would need unique tag names)

    It would be more efficient to render all of the visible bars in OnRender().
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      Thank you for your response, So where can I learn and read up on how to custom render my plots?

      Thanks in advance.

      Comment


        #4
        Hello KhaosTrader,

        I have an example that's great for getting familiar with SharpDX rendering.


        There is also a sample included with NinjaTrader 8 that goes further in depth named 'Sample custom render'.

        I'm also including a publicly available link to the help guide on RenderTarget which is a good place to start reading about SharpDX.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cls71, Today, 04:45 AM
        0 responses
        1 view
        0 likes
        Last Post cls71
        by cls71
         
        Started by mjairg, 07-20-2023, 11:57 PM
        3 responses
        213 views
        1 like
        Last Post PaulMohn  
        Started by TheWhiteDragon, 01-21-2019, 12:44 PM
        4 responses
        544 views
        0 likes
        Last Post PaulMohn  
        Started by GLFX005, Today, 03:23 AM
        0 responses
        3 views
        0 likes
        Last Post GLFX005
        by GLFX005
         
        Started by XXtrader, Yesterday, 11:30 PM
        2 responses
        12 views
        0 likes
        Last Post XXtrader  
        Working...
        X