Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Possible to plot histogram-like between two values (instead of grounding from 0 )?

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

    Possible to plot histogram-like between two values (instead of grounding from 0 )?

    PlotStyle.Bar has one side onto zero, and it is being ploted like a regular histogram.
    Is it possible with builtin (not using OnRender method, but the default plots) to plot "bar"-style plot, bot from not 0-to-Y value, but between two values.


    #2
    Hello TazoTodua,

    Thanks for your post.

    Plots will be used to display 1 data point per bar. Drawing a line or bar drawn between two data points would have to be done with 2 Series objects for both data points and would have to be rendered with custom rendering. Drawing Tools would also work to draw these lines/bars, but would not be performant for per-bar rendering.

    Please let us know if you have any additional questions.

    Comment


      #3
      Originally posted by NinjaTrader_Jim View Post
      ..
      And how to draw bar between 2 data points ? (i want from indicator, so i dont want to create custom-chart/barstyles ).

      Comment


        #4
        Hello TazoTodua,

        Drawing between two points can be done easily with Draw.Line() or Draw.Rectangle(). You would have to specify the values and indexes for your Series'/Plot's data points to describe how the line/rectangle should be drawn.

        Draw.Line() - https://ninjatrader.com/support/help.../draw_line.htm

        Draw.Rect() - https://ninjatrader.com/support/help..._rectangle.htm

        If you intend on drawing objects once per bar, we would suggest using SharpDX code in OnRender so the script is more performant. When using SharpDX, for custom rendering, you will want to use the helper functions below to convert prices and bar indexes to coordinates. Sample code for using SharpDX rendering can be found in the SampleCustomRender indicator example that comes with NinjaTrader.

        ChartControl.GetXByBayIndex() - https://ninjatrader.com/support/help...bybarindex.htm

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

        Please let us know if you have any questions.
        Last edited by NinjaTrader_Jim; 02-05-2019, 12:01 PM.

        Comment

        Latest Posts

        Collapse

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