As the name suggests my goal is to build a new bar type a time (traditional) and range bar hybrid. The basic premise of this bar type is the X axis responds to two variables, price action (range bar) and time (traditional candles). It works using the OR operator. Each bar would have an internal timer that prints a new bar after a selected period of time OR after the selected range value has been exceeded.
I've researched the ninjatrader ecosystem for potentially helpful projects and this bar timer indicator could be of use in crafting this new bar type, particularly for building the internal timer.
https://ninjatraderecosystem.com/use.../nt8-bartimes/
The goal of this hybrid bar type is to be able to keep up with the market when it moves fast in high volatility environments and reduce chop in low volatility environments.
One of the main features of the bar type is that the thickness of each bar varies depending on what percent of the selected time threshold it took up. For example if the time threshold is set to 1 hour but the candle exceeds its set range in 30 minutes that bar will only be 50% the thickness of a bar that met the time threshold. The user should be able to select how wide 100% thickness is in order to tune the chart to their liking.
Another feature is that at the end of RTH the current bar will be forced to print regardless of whether or not time or range has been met. The purpose of this is to reset the chart for the next day. The bars should also have no spacing between them and here's why. Due to how the width of each range bar dynamically adjusts by what percent of the time threshold it took up all bars printed for a day will take up the same amount of space on the X axis. By keeping the linearity of the time axis the trader will be able to get a very intuitive sense of the volatility of the market.
This futures settlement lines indicator should contain some useful code for being able to build out this feature
https://ninjatraderecosystem.com/use...ement-lines-2/
This feature would limit the maximum useful time threshold to one day but is more than worth it in my opinion. An example would be a time threshold set to one day that prints a single a bar at 100% width. Then, the next day, 5 bars get printed each at only 20% width. The length along the X axis (time) for each full day remains constant as the bars whose range condition triggered automatically adjust their widths to fit within the specified width of a time threshold print. This same principle can be applied to any time threshold the trader desires (5 min 30min 1hr). The total length along the X axis (time) taken up by the hybrid bars will always be the same for each trading day even though a vastly different number of bars could print day to day.
To create this feature bar width would need to be tied to time. I believe code from this equivolume bar type could be useful as here volume gets tied to bar width (just replace that with time)
https://ninjatraderecosystem.com/use...e-chart-style/
The idea for this Time/Range Hybrid bar type was born out of the fact that when using traditional time based bars, short time spans display excessive chop and noise. Meanwhile, longer time frames fail to capture the volatility of a fast moving market. Range/renko bars that completely ignore time do not allow for periods of accumulation to be displayed and do a poor job of putting volatility into perspective with regard to time. Basically, I realized that an X axis that only responds to price action or time will always be putting you at some sort of massive disadvantage. Especially if you like to use indicators to aid in your trading. The superior bar type would need to respond to both.
An error correcting method to help avoid tiny end of session bars could be employed as well. It would be a statement something along these lines; if there is less than X amount of time left before the end of the session (value of which is determined by the user) do not print current bar until the end of the session, even if the range threshold is exceeded.
A tool I've already theorized using this new bar type is a volatility trigger that will go off if the time taken for that bar to close is is less than X percent of the time threshold. That volatility trigger condition will remain true until the time taken for a bar to close is greater than Y percent of that threshold (unless it's the final bar of the day as that close is artificial. The volatility trigger would reset at the end of each trading day if it was active going into the close) This simple condition would allow for the creation of dynamic strategies that are Volatility dependent in a way exclusive to this bar type.
Comment