Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Bar Spacing Property
Collapse
X
-
Hello cutzpr,
Thanks for your post.
You can read the bar spacing type here: https://ninjatrader.com/support/help...pacingtype.htm
Other properties of interest might be:
https://ninjatrader.com/support/help...properties.htm
Note: see BarDistance in ChartControl properties.
-
Paul,
Thank you. I thought it was ChartProperties.BarDistance but it didn't add up but now I see why. BarDistance is calculated from the center of the candle to the center of another candle. Not the from the outer body of the candle which is why the numbers did not add up.
Just posting this "fyi" for others. To get the colors to perfectly line up when rendering you dont need to incorporate the bar-width/outer body.
Code:barSpace = chartProperties.BarDistance; barWidth = (float)chartControl.BarWidth; barStartX = chartControl.GetXByBarIndex(ChartBars, index); barStartX = barStartX - barSpace/2; barEndX = chartControl.GetXByBarIndex(ChartBars, index) + barSpace/2;Last edited by cutzpr; 07-28-2020, 08:22 AM.
- Likes 1
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
177 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
332 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
254 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
356 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
184 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|

Comment