2. Volume issue - volume increases and decreases during the same bar - see attached short video in zip file
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Couple Renko issues.
Collapse
X
-
Yes I did clean installOriginally posted by NinjaTrader_Josh View PostOdd. Have you tried removing your old data and loading in fresh data? Did you do a clean install? I am currently unable to reproduce on my end.
Hard to say what causes it, since it occurs in unpredictable places;
I just loaded new chart with es 2 tick brick size and it only occured once within last 3 days
Comment
-
Josh I quickly examinated your RenkoBarsType code.Originally posted by NinjaTrader_Josh View PostOdd. Have you tried removing your old data and loading in fresh data? Did you do a clean install? I am currently unable to reproduce on my end.
I believe the problem is when price jumps-gaps by more than box size,
if you open the chart with thinly traded instrument you will see quite few of those occurences. (make sure you have "small" brick size)
I am not 100 % sure but I think you should recheck code portion where 1 price tick might create more than 1 brick.
Comment
-
-
I have been looking at this today, and I think there are numerous issues with the RenkoBarsType code. After trying to fix it, I gave up and rewrote it to make sense. The code below seems to work with some caveats discussed below. Just replace the top portion of the RenkoBarsType class in @BarsTypes.cs with the code below and compile something and restart to try it.
First caveat, this is unsupported code, so there may be better ways to do some things. Hopefully, the NT Dev guys can use this as a base.
Second caveat, I think there may be a BUG in UpdateBar(), as I can not seem to get the bar open value to change. This is important in two cases. First, when a bar reverses you need to change the open. Second, I was trying to set the open value == close value while the lastBar is updating, so just a dash would display until the bar completes. The interesting thing is that the bars get displayed correctly, but if you pull up the data window, you can see that the open values are not right.
The code below also maintains the wick values in the high/low bar values. To display these, you can enable CandleStick ChartStyleTypes. When you do this, the wrong close I mentioned above gets displayed (thats how I stumbled onto it).
I would be happy to walk thru / explain this to NT Dev if they just PM me.
Code:public class RenkoBarsType : BarsType { private static bool registered = Data.BarsType.Register(new RenkoBarsType()); private double offset; private double renkoHigh; private double renkoLow; /// <summary> /// </summary> /// <param name="bars"></param> /// <param name="open"></param> /// <param name="high"></param> /// <param name="low"></param> /// <param name="close"></param> /// <param name="time"></param> /// <param name="volume"></param> /// <param name="isRealtime"></param> public override void Add(Data.Bars bars, double open, double high, double low, double close, DateTime time, long volume, bool isRealtime) { if (bars.Count == 0 || bars.IsNewSession(time)) { int BoxSize = bars.Period.Value; double TickSize = bars.Instrument.MasterInstrument.TickSize; offset = BoxSize * TickSize; renkoHigh = close + offset; renkoLow = close - offset; AddBar(bars, close , close , close , close , time, volume, isRealtime); bars.LastPrice = close; } else { Data.Bar bar = (Bar) bars.Get(bars.Count-1); if (close >= renkoHigh) { long barVolume = close == renkoHigh ? volume : 0; UpdateBar(bars, renkoHigh-offset, renkoHigh, bar.Low, renkoHigh, time, barVolume, isRealtime); renkoLow = renkoHigh - 2.0 * offset; renkoHigh = renkoHigh + offset; while (close >= renkoHigh) { // add empty bars to fill gap barVolume = close == renkoHigh ? volume : 0; AddBar(bars, renkoHigh-offset, renkoHigh, renkoHigh-offset, renkoHigh, time, barVolume, isRealtime); renkoLow = renkoHigh - 2.0 * offset; renkoHigh = renkoHigh + offset; } // add final partial bar AddBar(bars, renkoHigh-offset, close, renkoHigh-offset, close, time, barVolume == 0 ? volume : 0, isRealtime); } else if (close <= renkoLow) { long barVolume = close == renkoLow ? volume : 0; UpdateBar(bars, renkoLow+offset, bar.High, renkoLow, renkoLow, time, barVolume, isRealtime); renkoHigh = renkoLow + 2.0 * offset; renkoLow = renkoLow - offset; while (close <= renkoLow) { // add empty bars to fill gap barVolume = close == renkoLow ? volume : 0; AddBar(bars, renkoLow+offset, renkoLow+offset, renkoLow, renkoLow, time, barVolume, isRealtime); renkoHigh = renkoLow + 2.0 * offset; renkoLow = renkoLow - offset; } // add final partial bar AddBar(bars, renkoLow+offset, renkoLow+offset, close, close, time, barVolume == 0 ? volume : 0, isRealtime); } else { UpdateBar(bars, close, (close > bar.High ? close : bar.High), (close < bar.Low ? close : bar.Low), close, time, volume, isRealtime); } bars.LastPrice = close; } }
Comment
-
Ok, the reason the bars display correctly without the correct open is because NT works around this in the OpenClose Chart Style, by building in knowledge of the brick size in the chart style and recalculating the open if needed.
Seems like this belongs in the bar formation logic, not the display code.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
637 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
366 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
107 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
569 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
571 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment