Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Volume bar color coding
Collapse
X
-
Volume bar color coding
How can I get the volume bars painted different colors based on the volume of the bar? I would like say 3 values, where the lowest value would paint a green candle, in between the lowest and middle yellow, between the last 2 values orange and above the 3rd value red candle. Is that possible?Tags: None
-
Hello axjurado,
For bars you can color them using an indicator.
An indicator could process the bar information and color the bars based on your condition. To check the volume in a condition you can do that like the following:
That would check for a range of volume between 0 and 100 You could repeat this type of condition to make the lowest/middle values you wanted. For the upper end value you can just use a greater than condition.Code:if(Volume[0] > 0 && Volume[0] < 100) { }
Code:if(Volume[0] > 500) { }
-
I need to create an indicator based on the current bar volume compared to the previous bar volume. Basically paint Bar 0 if volume Bar1 < 50% of volume Bar 0.
Thank You, Jamie Stephens
Comment
-
Hello JamieHendrix,
Please open a new thread for any new questions you have about your own script. If you are having difficulty making that type of condition please ensure to include that so we know what specifically you needed help with.
To make a condition comparing volume between bars you would need to use BarsAgo. Every series has brackets at the end [0] which indicates the BarsAgo, 0 meaning the most recent bar. You would need a condition that compares the 0 bars ago volume against the 1 bars ago volume. Because you want to know 50% you also need to use some math there to divide the volume by 2 to get half its value.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
581 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
337 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
552 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment