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 color and input series

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

    Histogram color and input series

    Hi,
    I did a few searches and couldn't come up with anything related. So can the colors in a histogram be coded in such a way that instead of using the width of bars to color it, the histogram can be smoothly color filled?

    How can I code the histogram or any indicator so when in the same panel as the input series, it will be in the background without covering the price plot?

    Thanks

    #2
    Hello,

    Thank you for the question.

    I wanted to ask to get some clarification on this. Are you asking how to prevent the plots or lines you draw in an indicator from appearing "Above" or on top of the chart bars?

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse,

      That is correct. I do not want the candles or price bars to be covered by the indicators.

      Comment


        #4
        Hello,

        Thank you for the clarification.

        This is known as the Z order when referring to a chart and the items that are plotted on it.

        The Z order can be managed manually using the mouse, you would click on a indicators plot and hold the Shift key while scrolling with the mouse.

        At this time there is currently not a way to control the Z ordering through NinjaScript unfortunately so the only way to change this would be using the above method.

        Please let me know if I may be of additional assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Thanks for explaining the z order.
          Do you have any suggestions about my other question related to the coloring of a histogram?

          Comment


            #6
            Hello,

            Yes I wanted to clarify that as well.

            I see that you asked if the color could be made to be smooth rather than with the bar width, are you asking rather than the color stopping at the end of the bar it would be gradient?

            So instead of Color1 | Color2 | Color3 | etc...
            It would be Color1 blends into Color2 blends into Color3 etc..

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              That is correct. That one color will blend into the following one.
              Sort of the way BackColorAll works, depending on the background color it will smoothly blend into the following background color if there's one.

              Comment


                #8
                Hello,

                Thank you for the clarification.

                This is not possible using the PlotColors or any of the built in methods because they are associated with the Bar that is being referenced.

                You could do this using C# and the Plot override, this is much more complicated though and there is really no documentation on this.

                There are a couple of indicators that show how to use the PlotOverride such as the CustomPlotSample and the Pivots indicator.

                Essentially you would need to create a LinearGradientBrush and also create your own line based on calculated points and dispose of the resources you use during this process.

                I do not have a example of this as it is quite complicated, if you do want to pursue this I would recommend doing some research on how to use Graphics and Drawing and LinearGradientBruses in C# as these are not NinjaScript items but general C# topics.

                Please let me know if I may be of additional assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Jesse, thanks again for the detailed explanation. Seems to be a lot more work for what I want to accomplish.

                  Back to the Z order, does that mean that regardless of the order of the indicators, the chart bars will always be in the background behind any and all indicators that are in the same panel?

                  Comment


                    #10
                    Hello,

                    This is not always true depending on the set of indicators you apply, in certain cases the bars will be pushed to the back but then certain cases the bars will be on top of indicators.

                    In all cases the easiest fix is to select your chart bars by clicking a bar, then hold shift and scroll down. This would place the bars in level 1 or the top level above the indicators.

                    I look forward to being of further assistance.
                    JesseNinjaTrader Customer Service

                    Comment


                      #11
                      Got it! Thanks for your time and patience in explaining all this.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by r68cervera, Today, 05:29 AM
                      0 responses
                      2 views
                      0 likes
                      Last Post r68cervera  
                      Started by geddyisodin, Today, 05:20 AM
                      0 responses
                      3 views
                      0 likes
                      Last Post geddyisodin  
                      Started by JonesJoker, 04-22-2024, 12:23 PM
                      6 responses
                      34 views
                      0 likes
                      Last Post JonesJoker  
                      Started by GussJ, 03-04-2020, 03:11 PM
                      12 responses
                      3,239 views
                      0 likes
                      Last Post Leafcutter  
                      Started by AveryFlynn, Today, 04:57 AM
                      0 responses
                      6 views
                      0 likes
                      Last Post AveryFlynn  
                      Working...
                      X