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 bmarovets, Today, 06:33 PM
        0 responses
        6 views
        0 likes
        Last Post bmarovets  
        Started by ETFVoyageur, Yesterday, 07:05 PM
        4 responses
        33 views
        0 likes
        Last Post ETFVoyageur  
        Started by JGriff5646, Yesterday, 10:02 PM
        2 responses
        21 views
        0 likes
        Last Post JGriff5646  
        Started by DawnTreader, Today, 05:58 PM
        0 responses
        5 views
        0 likes
        Last Post DawnTreader  
        Started by ntram, Today, 05:39 PM
        0 responses
        5 views
        0 likes
        Last Post ntram
        by ntram
         
        Working...
        X