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 argusthome, 03-08-2026, 10:06 AM
|
0 responses
65 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
41 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
23 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
26 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
52 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment