Since one of my creations is involved here, I have an interest. Post some side by side images for discussion. Better yet, post a link to the RangeAlt code. My RangeNoGap is already available in the download area.
Here is the RangeAlt bar type that I downloaded here on futures.io (formerly BMT) a couple of days ago, can't recall the link.
Just a word of caution; although this bar type has been around quite awhile and the code is fine, somehow it replaced another bar type that I had in the drop-down menu (Seem like it is using the same bar type number as LineBreakWicked in my case, which is missing now)
RangeAlt Appears to be a simpler, possibly earlier version of range bar. RangeNoGap has all the Updates that are in NT7's current Range bars. See attached code.
ALT Range
if (bars.Instrument.MasterInstrument.Compare(close, bar.Low + rangeValue) > 0)
{
double newClose = bar.Low + rangeValue; // every bar closes either with high or low
UpdateBar(bars, bar.Open, newClose, bar.Low, newClose, time, 0, isRealtime);
AddBar(bars, close, close, close, close, time, volume, isRealtime);
}
else if (bars.Instrument.MasterInstrument.Compare(bar.High - rangeValue, close) > 0)
{
double newClose = bar.High - rangeValue; // every bar closes either with high or low
UpdateBar(bars, bar.Open, bar.High, newClose, newClose, time, 0, isRealtime);
AddBar(bars, close, close, close, close, time, volume, isRealtime);
}
else
UpdateBar(bars, open, (close > bar.High ? close : bar.High), (close < bar.Low ? close : bar.Low), close, time, volume, isRealtime);
I think the difference on these bars may be how the deal with the trading open. They may both do the same thing but I think range alt was an alternative bar from the regular range bar that controlled how bars printed on opening gap. Don't quote me on this as I may be wrong.
"The day I became a winning trader was the day it became boring. Daily losses no longer bother me and daily wins no longer excited me. Took years of pain and busting a few accounts before finally got my mind right. I survived the darkness within and now just chillax and let my black box do the work."
RJay has realized a nice NoGap variant with using the "right" RangeSize for switch to th next bar.
While i well only using standard (with possible Gaps) variants, i use a simple logic to realize a variant for switch to the next bar to the next tick when the current tick is on the range border.
The advantage of this is:
- its use only real traded prices and give nearly the same optical look comperable with the NoGap variant (its only need 4 ticks, when a Range 4 is selected)
- ~90% its give more as one price on the same level-> the next rangebar open exact and optical nice on the Close of bar before
- ~10% have Gaps, smaller Bars or dont close on the RangeBorder (optical is this not very nice, its shows exact the real live)
- with this logic its give only real traded prices, no zero volumes and/or additional ticks
- if needed its is simple to extend this "NextNewBarFlag" concept with a line for to check the HiLo size and add if not equal the range add one virtual price for realize a dummy tick that give the warranty any range nar has the same size (equal the range)...
I think with the simple NT7 variant, with RJay's 2 variants and this as 4. variant, we have its all combinations with a symetric fixed range period bars defined and differences between all this variants described