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

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.
    JimNinjaTrader Customer Service

    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.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by mattbsea, Today, 05:44 PM
        0 responses
        2 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        31 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        2 views
        0 likes
        Last Post tkaboris  
        Started by GussJ, 03-04-2020, 03:11 PM
        16 responses
        3,281 views
        0 likes
        Last Post Leafcutter  
        Started by WHICKED, Today, 12:45 PM
        2 responses
        19 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Working...
        X