Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Painting a indicator panel region

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

    Painting a indicator panel region

    Hello

    I am wondering how I could paint an indicator ( which value is between 0 and 1 ) region from 75 to 100 and 0 to 25 based on certain conditions.

    Should I use AddPlot PlotStyle.Bar ?

    if so how can I draw a bar from 75 to 100 ?
    I think that 0 to 25 could be done easily because the start line starts at 0.

    Thank you very much.



    #2
    Hello bar58,

    Thanks for your post.

    I'm not exactly understanding what you are trying to do. Do you mean that under some conditions, your 0-1 value will be translated to 75-100 and under other conditions translate it from 0-25?

    This could be done by normalizing your indicator's plot value to the intended range. A publicly available resource on normalization can be found below.

    https://stackoverflow.com/questions/...-to-3/51161208

    Choosing a different Plot Style will change the appearance of your plot, which I am not sure is the ultimate goal here.

    If you need additional help, could you attach a screenshot with some drawings depicting what you are trying to do?

    We look forward to assisting.

    Comment


      #3
      I would like to paint on certain conditions region 0-25 and 75-100. See the attachment
      Attached Files

      Comment


        #4
        I am almost done.
        My only problem is that I would like the red painted area to start at 75 level instead of 0.

        Attached Files

        Comment


          #5
          Hello blar58,

          Thanks for clarifying.

          You could consider using Draw objects to draw where you would like in the indicator panel, with DrawOnPricePanel set to false, but it may be expensive to use drawing objects excessively.

          Outside of this there would not be a quick way to accomplish with Plots. You could accomplish this with custom SharpDX rendering however. For example, you can use ChartScale.GetYByValue and provide your normalized values for the upper range there, and you will get the pixel Y coordinate for where you would want to make that drawing. For the X coordinate, you can use ChartControl.GetXByBarIndex.

          You could consider using RenderTarget.DrawRectangle or RenderTarget.DrawLine to draw in this area after you have gotten your coordinates.

          ChartScale.GetYByValue - https://ninjatrader.com/support/help...etybyvalue.htm

          ChartControl.GetXByBarIndex - https://ninjatrader.com/support/help...bybarindex.htm

          To get more acquainted with SharpDX rendering, please see the Help Guide article below, and please see the SampleCustomRender indicator that comes with NinjaTrader.
          https://ninjatrader.com/support/help..._rendering.htm

          We look forward to assisting.

          Comment


            #6
            Very well understood

            Many thanks Jim

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            571 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            331 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            549 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            549 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X