// bc = bar color = index number of plot created in Initialize()
bool sameday = eod ? true : (Time[0].Day == Time[1].Day);
bc = 0; // default 0 (normal volume bar)
if (cond1 || (cond11 && sameday))
{
bc = 1; //LowVol
}
if (cond2 || cond3 || cond8 || cond9 || ((cond12 || cond13 || cond18 || cond19) && sameday))
{
bc = 2; //ClimaxUp
}
if (cond4 || cond5 || cond6 || cond7 || ((cond14 || cond15 || cond16 || cond17) && sameday))
{
bc = 3; //ClimaxDown
}
if (cond10 || (cond20 && sameday))
{
bc = 4; //Churn
}
if (bc == 4 && (cond2 || cond3 || cond4 || cond5 || cond6 || cond7 || cond8 || cond9 || (cond12 || cond13
|| cond14 || cond15 || cond16 || cond17 || cond18 || cond19) && sameday))
{
bc = 5; //ClimaxChurn
}
// plot stuff
Values[bc][0] = Volume[0]; //draw the volume bar we found
if (PaintBars && bc > 0)
{
BarBrush = Plots[bc].Brush; // paint the price bar
}
VolEMA[0] = (vwt * (Volume[0] - VolEMA[1]) + VolEMA[1]); // plot average; faster than SMA
} // End OnBarUpdate()
#region Properties
[Browsable(false)]
[XmlIgnore]
public double SendVolumeBarType
{
get { return bc; }
}
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
bc Value for Better Volume 3 Indicator is One Bar Late
Collapse
X
-
bc Value for Better Volume 3 Indicator is One Bar Late
Hello, I created a buffer to call the bc value in the BetterVolume3 indicator in a strategy. The bc value from 0 to 5 determines the volume bar color. My strategy is set for OnBarClose, and this value is always one bar late. bc value should indicate the volume color for Close[0] in the strategy, but it indicates the volume color for Close[1]. I tried enabling and disabling Use2Bars and it didn't make any difference.
Code:Tags: None
-
Hello ronaldgreene828,
Calculate OnBarClose would mean the logic is evaluated when the bar is fully closed. If you were to color a bar, this would be the most recently fully closed bar, not the currently building bar.
If you want to color the currently building bar, check the logic OnPriceChange or OnEachTick.
Use TickReplay if this needs to work historically.Chelsea B.NinjaTrader Customer Service
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
171 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
88 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
128 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
208 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
185 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment