NexusFi: Find Your Edge


Home Menu

 





Multiple Time Frame Equidistant Bars


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 5 posts (10 thanks)
    2. looks_two TimeTrade with 4 posts (5 thanks)
    3. looks_3 KySt with 4 posts (0 thanks)
    4. looks_4 DavidHP with 3 posts (0 thanks)
    1. trending_up 11,514 views
    2. thumb_up 16 thanks given
    3. group 8 followers
    1. forum 21 posts
    2. attach_file 7 attachments




 
Search this Thread

Multiple Time Frame Equidistant Bars

  #1 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,609 since Aug 2009
Thanks Given: 11,328
Thanks Received: 2,743

NT7 will allow multiple time frame charts to overlay or in separate panels.
One of the problems with this is the x axis is hard coded to be in control by using 'Equidistant Bar Spacing" and setting it to FALSE.

The result of this is that all multiple time frame charts have gaps in the display of the charts.
(as in the image below)
Top image has two data series and the bottom a single series.
The top image has gaps in the display because of the equidistant = false on each series.

I know this question has been asked before:
Has anyone discovered a work-around via C# code to allow the charts to have one series dominant and the other as an 'overlay' on the chart.

Tks

Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Attached Thumbnails
Click image for larger version

Name:	MultitimeFrame.jpg
Views:	500
Size:	29.4 KB
ID:	54816  
Follow me on Twitter Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Online prop firm The Funded Trader (TFT) going under?
Traders Hideout
Futures True Range Report
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Are there any eval firms that allow you to sink to your …
Traders Hideout
Deepmoney LLM
Elite Quantitative GenAI/LLM
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
23 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #3 (permalink)
 
MWinfrey's Avatar
 MWinfrey 
Lubbock TX
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Stage 5 Trading
Trading: CL
Posts: 1,878 since Jul 2009
Thanks Given: 1,450
Thanks Received: 3,335



DavidHP View Post
NT7 will allow multiple time frame charts to overlay or in separate panels.
One of the problems with this is the x axis is hard coded to be in control by using 'Equidistant Bar Spacing" and setting it to FALSE.

The result of this is that all multiple time frame charts have gaps in the display of the charts.
(as in the image below)
Top image has two data series and the bottom a single series.
The top image has gaps in the display because of the equidistant = false on each series.

I know this question has been asked before:
Has anyone discovered a work-around via C# code to allow the charts to have one series dominant and the other as an 'overlay' on the chart.

Tks

Not in C# but is this what you're talking about?


Reply With Quote
  #4 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


DavidHP View Post
NT7 will allow multiple time frame charts to overlay or in separate panels.
One of the problems with this is the x axis is hard coded to be in control by using 'Equidistant Bar Spacing" and setting it to FALSE.

The result of this is that all multiple time frame charts have gaps in the display of the charts.
(as in the image below)
Top image has two data series and the bottom a single series.
The top image has gaps in the display because of the equidistant = false on each series.

I know this question has been asked before:
Has anyone discovered a work-around via C# code to allow the charts to have one series dominant and the other as an 'overlay' on the chart.

Tks

I think that this cannot be avoided. If you have two different Bar Series on your chart - say one built from ticks and the other one from time-based bars - at least one of them will be irregularly spaced.


Asking for the Impossible


However you still wish that indicators be drawn on your chart. This requires a drawing algorithm that uses either the bar count or the time stamp of each bar. Now assume that you select the tick chart as the dominant chart with equidistant bar spacing and adjust the minute chart to comply with the tick chart. What algorithm would you use to determine the correct spacing of the minute bars? And what algorithm would you use to display indicators on that minute chart? This a task that would be near impossible to accomplish.

For that reason NinjaTrader uses the time stamps of all bars to plot on multi-series charts. This information is availble for each bar, and indicators that are plotted on those bars can use a relatively simple algorithm for interpolating the data points by taking into account the time-interval between two consecutive time stamps.

So, if you think about it, you are asking for the impossible.


Multi-Series Charting with Equidistant Bars Restricted to Similar Bar Series

Some charting packages do have multi-timeseries charts with equidistant bar spacing, but this is only possible if you display a 5 minute against a 30 minute chart, or a 5-tick against a 30-tick chart. Even for two series of range bars this cannot be done, because a 30-range bar would not be composed of 6 5-range bars. And for mixed bar series, this is impossible, you will always get back to time to organize the incoming bars.


Indicator Values Can Be Projected on the Primary Bar Series

For indicators there is another option. You can code them in a way that the values are calculated from a secondary bar series, which is loaded by the indicator and then projected to the primary bar series. But then you will get the projection, which typically lags by a fraction of the last bar, and you will not get the original values displayed in line with the secondary bars where they were formed.

Reply With Quote
  #5 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,609 since Aug 2009
Thanks Given: 11,328
Thanks Received: 2,743


MWinfrey View Post
Not in C# but is this what you're talking about?


I saw that post and I've tried to use a similar method but still get the look shown in the image. I prefer Point O or Range bars and it seems as if they are a little stubborn about this similar to the reply Fat Tails made.

Thanks for the reply,
I expect that until NT changes this it will not be possible.
But I've found that the impossible just takes a bit longer.

No harm in checking to see if someone has found a work-a-round.

Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on Twitter Started this thread Reply With Quote
  #6 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,609 since Aug 2009
Thanks Given: 11,328
Thanks Received: 2,743

Perhaps this will develop into a solution.
I have a 'virtual bars' indicator that will create simulated bars/candles over an existing chart.
I will look into creating one that emulates the secondary timeframe bars for the types I'm using.

Thanks


Fat Tails View Post

Asking for the Impossible


For indicators there is another option. You can code them in a way that the values are calculated from a secondary bar series, which is loaded by the indicator and then projected to the primary bar series. But then you will get the projection, which typically lags by a fraction of the last bar, and you will not get the original values displayed in line with the secondary bars where they were formed.


Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on Twitter Started this thread Reply With Quote
  #7 (permalink)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731

Unless the secondary series consists of bars of variable duration whose life spans correspond to those of the primary series. But why would anyone want to do this?

Well, from these charts I can think of a few reasons.

Attached Thumbnails
Click image for larger version

Name:	YM 12-11 ( RJay's RangeNoGap  9 Tick)  11_14_2011.jpg
Views:	292
Size:	89.8 KB
ID:	54832   Click image for larger version

Name:	YM 12-11 (121 Tick)  11_14_2011.jpg
Views:	277
Size:	86.6 KB
ID:	54834  
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #8 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


DavidHP View Post
Perhaps this will develop into a solution.
I have a 'virtual bars' indicator that will create simulated bars/candles over an existing chart.
I will look into creating one that emulates the secondary timeframe bars for the types I'm using.

Thanks

I think, given the architecture of NinjaTrader, two differnt approaches are possible:


MultiPeriod Candles

You take the primary bar series from the chart, which is the smaller timeframe and then combine N candles into a larger teimframe candle. This is not difficult to code, but has some limitations.

-> the primary and secondary (painted) bar types need to be identical, that it you can only combine tick with tick bars, volume bars with volume bars, etc.
-> the higher timeframe needs to be an integer multiple of the lower timeframe
-> you can only apply this to tick and volume charts, but not to range charts, as unfortunately higher timeframe range
bars cannot be built from lower timeframe range bars
-> it is not needed for minute bars, because for minute bars equidistant and non-equidistant spacing gives (mostly) identical results


Multi-TimeFrame Indicator which loads a secondary bar series

I tihnk that it is possible to code a multi-timeframe indicator, which loads a secondary bar series, computes the candles for those bars and draws them onto the panel, where they belong. It would be sort of a challenge to determine the appropriate size for those secondary candles and make that size adjustable.

Reply With Quote
  #9 (permalink)
 KySt 
Accokeek, USA
 
Experience: Intermediate
Platform: NT & TOS
Trading: ES RUT
Posts: 92 since Mar 2011
Thanks Given: 17
Thanks Received: 24


Fat Tails View Post
I think, given the architecture of NinjaTrader, two differnt approaches are possible:


MultiPeriod Candles

You take the primary bar series from the chart, which is the smaller timeframe and then combine N candles into a larger teimframe candle. This is not difficult to code, but has some limitations.

-> the primary and secondary (painted) bar types need to be identical, that it you can only combine tick with tick bars, volume bars with volume bars, etc.
-> the higher timeframe needs to be an integer multiple of the lower timeframe
-> you can only apply this to tick and volume charts, but not to range charts, as unfortunately higher timeframe range
bars cannot be built from lower timeframe range bars
-> it is not needed for minute bars, because for minute bars equidistant and non-equidistant spacing gives (mostly) identical results


Multi-TimeFrame Indicator which loads a secondary bar series

I tihnk that it is possible to code a multi-timeframe indicator, which loads a secondary bar series, computes the candles for those bars and draws them onto the panel, where they belong. It would be sort of a challenge to determine the appropriate size for those secondary candles and make that size adjustable.

Hello Fat Tails and group,
Ninja's limitation of place 2 or more instrument tick/time frames on a single chart is most frustrating.

1) is there a way to unlock the equidistant option when more than one instrument is on the chart
2) is there a simple way to allow an indicator to read another tick/time frame, while being on a chart of a different tick/time?


I have been looking at some things from MicroTrends, but nothing similar to this.


Thanks, Ky

ps: a thx to "TMFT" for assistance a few weeks ago!!

Reply With Quote
  #10 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102



KySt View Post
Hello Fat Tails and group,
Ninja's limitation of place 2 or more instrument tick/time frames on a single chart is most frustrating.

1) is there a way to unlock the equidistant option when more than one instrument is on the chart
2) is there a simple way to allow an indicator to read another tick/time frame, while being on a chart of a different tick/time?


I have been looking at some things from MicroTrends, but nothing similar to this.


Thanks, Ky

ps: a thx to "TMFT" for assistance a few weeks ago!!

1) Non-equidistant bars are simply bars that are aligned along a linear time axis. Equidistant bars distort time in order to achieve equidistant bar spacing. If you want to place several bar series on one chart, you have to settle for one specific timescale. NinjaTrader does not have the option to let you select the timescale, but settles for a linear time scale. This will make appear session breaks on your charts, and all bars that do not have fixed periods will be shown as non-equidistant bars.

I have you have a minute bar series and a tick bar series, at least one of those series will be always unevenly spaced, because they are not being plotted synchronously.

2) This is possible. It would be a multi-timeframe indicator. If you apply a multi-timeframe indicator to a chart, you can get around non-equidistant bar spacing, as long as only a single bar series is shown on the chart. However, multi-timeframe indicators are not really simple.

Reply With Quote
Thanked by:




Last Updated on April 25, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts