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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
43 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
20 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
29 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
46 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
38 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment