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.
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!
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
NinjaTrader
Possible to plot histogram-like between two values (instead of grounding from 0 )?
Collapse
X
-
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.
1 PhotoTags: None
-
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
- Likes 1
-
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
by mattbsea
Today, 05:44 PM
|
||
Started by RideMe, 04-07-2024, 04:54 PM
|
6 responses
31 views
0 likes
|
Last Post
by RideMe
Today, 05:31 PM
|
||
Started by tkaboris, Today, 05:13 PM
|
0 responses
2 views
0 likes
|
Last Post
by tkaboris
Today, 05:13 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
16 responses
3,281 views
0 likes
|
Last Post
by Leafcutter
Today, 04:14 PM
|
||
Started by WHICKED, Today, 12:45 PM
|
2 responses
19 views
0 likes
|
Last Post
by WHICKED
Today, 03:36 PM
|
Comment