Interesting , thanks . Is this bar type only available for tradestation ? ATR is a logical approach to bar range sizing and this would be worth looking into further . Maybe we can get someone to develop these bars for ninja .
Yeah, would be interesting. I've never created a custom bar type before but I know it can be done. And the single parameter for the bar type would be the ATR lookback period. So if you, say, had a 200 KaseBar chart, it's using a median ATR over 200 time bars, but over what minute time frame? 5min, 15min, 60min? You'd need a 2nd parameter to determine the correct range bar size. Maybe you can keep the lookback period constant (100, 200, what?) and the parameter would be what minute bar size you want to computer ATR over.
She uses the ATR to pick a target range. The range is not auto-calculated on the fly, at least in Tradestation.
In TS, you specify a single parm called the "target range". You also specify whether the bar is built from ticks or 1-min bars.
When using tick bars, this effectively becomes the same as range bars, because each bar will be the target range except for gap cases perhaps. When using minute bars, most bars will be the target range size, except for when you have a fast move within a minute bar that exceeds the target range, in which case you will get a larger bar.
When I compare range and Kase bars in TS, they are very close to each other.
Given the above, you should be able to cobble together a Kase bar type for Ninja using the Range bar type as a template.
I don't understand/see the benefit of Kase vs Range bars.
Now, if you did dynamically figure out the ATR, that may be more interesting.
The following user says Thank You to aslan for this post:
"I don't understand/see the benefit of Kase vs Range bars."
Well, since my mom doesn't get onto forums, I will explain the difference between the two.
First off, the bars are equal true range which counts any gaps between the previous bar’s close and the current high or low into the bar’s range – as opposed to simple range bars, which only account for the high-low range and leave out any gaps. Secondly, Kase Bars use only real data to form bars. Thus, if there are any gaps on the chart as opposed to filling the gap by creating bars using counterfeit data. And, if the minimum range between two ticks exceeds the target range, the actual minimum range is shown. This is in opposition to range bar methods, which forces bars to the exact target by inserting fake data. So for example, if two sequential prices were $10.1 and $10.2, Kase’s method, using a 5-cent range, does not put in fake data but would generate a 10-cent bar, since that is as close to the target as one can get with real data. Other methods would insert a false tick at 10.15 to break up the 10-cent bar into two 5’s.
Got questions? Just email me directly daniel@kaseco.com
The following 15 users say Thank You to Dan Kase for this post:
Just a stupid question. Can you tell me how you exported a bar type (instead of an indicato) so that we can friendly import it ?
The custom bar types I cross usually need to drag and drop the file inside the Type folder then need to be compiled.
Nope, I implemented what is in Tradestation per the link I posted previously. It uses real data and looks at the true range of the bar, and closes the bar as soon as the range is met or exceeded.
There is one nuance for my version, and that is what happens at the beginning of a new session. I start a new bar at the beginning of a session, and do not use the last bar from the previous session to determine the true range of the first bar. Some people do not like this, but it is how NT does it, and it ensures that you always have the same bars regardless of the start date of the data that is loaded. I wont be changing that aspect, but it is easy to change if someone wants to change it.
Feel free to send me a copy of her book, and I would be happy to implement Universal bars as well.
Sorry, I don't even have 6.5 loaded anymore, but the code is fairly straight forward (does not use anything special from NT7) if someone wants to try to port it back. To my knowledge, only some of the secondary routines are different. The real meat of the code is the Add() method, which I think should work/port easily.
The following user says Thank You to aslan for this post:
I received the following comment on NT Kase Bars via PM:
The following is how the implementation works: when a tick arrives it is always included in the current bar. Once the bar is updated, the true range is checked, and if the target range is met or exceeded a new bar will be formed on the next tick. If that next tick is at the same price, then the open of the new bar would be equal to close of the previous bar. The next tick could be the same or a different price.
So, the question is once a target range is achieved for a bar, do you wait to start a new bar until the range of that bar is exceeded?
In looking closer at the output of TS, the next bar is always opened outside of the current bar. If that is what is desired, then technically the bar is not closed when the target range is met, but only when it would be exceeded, and the new tick that exceeded the target range is part of the next bar.
I can easily change this, but Dan, perhaps you could comment first on how it should work. Thanks.
The following user says Thank You to aslan for this post:
After playing around with TS, I went ahead and changed the NT Kase Bar implementation to only close the bar when the range is exceeded, and now it should match up with the TS version. There is a new version (V2) in the download section.
The following 7 users say Thank You to aslan for this post:
And thats why I hate Ninja, even something simple is not simple.
The problem is you have another bar type that is conflicting. In NT65, they use a routine called SortOrder() to return an integer that they use to arrange the sort order of all of the bar types. That is all and good, but nobody knows what other people use. Now, I used the next available even number, which in hindsight, was bad on my part because that is what everyone else does.
Try the following: Edit the KaseBarsType.cs file in the Type dir, and change the "14000" to "14123", and save the file, then edit any indicator, and compile it, then restart NT. That should fix your problem. If it does, I will update the file in the download section so others dont run into the issue.
Thanks for letting me know.
The following 2 users say Thank You to aslan for this post:
I tried editing the .cs file as suggested above, but the exact same error continues to come up - I am assuming that I did everything correct.
Until or if the Kase bar type file is "fixed" can someone tell me how to delete all related files so the error will not come up any more? I have attempted to delete all the files that I could find, but the error continues to pop up.
Thanks for a valiante effort and I look forward to the updated file.
Ok, I changed the default SortId for KaseBarsType, and I also added two new constants near the top of the file to make it easier for people to change the constants used for NT65/NT7 in the case that they are conflicting with other Custom Bar types.
If you were previously not having issues, the new version adds no new functionality.
The following 2 users say Thank You to aslan for this post:
I just changed mine to 14100 and it works without issue. Aslan, now that you have made a change let me know what the new number is so I can make mine match. For more info on SortOrder for existing custom bars, check the list below:
Median Renko = 13007
NoGap Range = 13400
PointO = 14000 <== this was the conflict
RangeAlt = 3200
Renko = 13000
SbSRenko = 13008
These are the NT6.5 types I checked out.
Dan
The following 2 users say Thank You to eDanny for this post:
Yes, same issue here. no historical data on Kase or any other custom bars like RangeAlt, NoGapRange, etc. . . . unfortunately I don't have the older version to overwrite the new one. Can someone please post the older version of KasebarsV4 please.
Not sure what NT is doing, as this bar type should not be affecting other types. Did you try reloading historical data? The only diff between the previous version and V4 is changing the SortId, which you can manually change using the previous instructions.
A few other changes were made also. Not sure why they would have this effect but the previous version works ok. ALSO, now that I think of it, when I was having problems with the Kase bars I also had no historical bars on any charts and had to remove all the custom bar types, not load my workspace and had to rebuild my charts/workspace. Now I'm wondering if it was related somehow. I didn't think about it at the time. Here is the NT forums link. https://www.ninjatrader.com/support/forum/showthread.php?t=31715
Dan
The following user says Thank You to eDanny for this post:
Well if you compare the files, there was exactly one functional change made (3 lines of code and changing the SortId to 14123). The SortId and PeriodType were brought out to make it easier to change in case of collisions with other types.
I can not control what f-ing NT does under the covers, but can only try to give you some ideas.
My best guess is NT is using that sortid as more than a sorting id, and uses it somehow when it requests historical bars, and when it changed they got confused due to a bug (yes I know, an NT bug - shocking). In true NT form, I can tell you I did not see the problem here Perhaps, I didn't see it because I don't use the NT history server (notice, how I am still typing after making that last statement, as opposed to NT support).
I also suspect the only people seeing the issue are people that have used the bars with two different ids (loaded V3 then V4 due to a collision)? I would not expect this to be an issue, but I guess NT can not handle it.
In terms of the workspace, that is another place where that id could get stored by NT, so I would also try removing the offending chart, and if that did not work, the workspace itself. Before blowing things away, I would create another blank workspace with a single chart to see if that flushed things out.
I can not offer much more than that. If you need the V3 file, PM me, and I will send it, if you are an elite member.
The following user says Thank You to aslan for this post:
Hey Aslan, When I look at Kase bars in this implementation they look like plain range bars with the occasional exception of situations like I have circled. Is this correct?
Yes, they are VERY similar to range bars. The main diff is not having phantom bars when there are gaps. If your target range size is large enough, you should not see much diff at all.
The following user says Thank You to aslan for this post:
Over the long haul, not sure they would be much better, but there are some reasons they seem better to me. The first is the removal of the phantom bars inserted when range bars are built. The Kase bars use only real data, so if there is a gap outside the target range, the gapping tick is part of the next bar, while range bars would insert phantom bars until you get to the bar that would contain the gapping tick. The phantom bars have no volume.
This behavior is both good and bad depending what you are looking at. For backtesting, this is a very good thing because you do not want to get phantom fills in the middle of gap. For observing price, it is also a good thing because you can see that something happened, instead of seeing a nice smooth transition of price. For indicators that are gap sensitive (i.e. MA), this may not be as good, as it takes time for the indicator to settle out, and the phantom bars actually help them catch up faster.
It also depends what market and target range you are using. On the ES, they are range bars for the most part. On the CL/TF though, they tend to be different with smaller ranges as the price can really jump around. That might mean you don't have a large enough target range, but again, I can see the price action better with Kase vs range in those cases.
Are they better? I guess it depends what you care about, but I have been tending to use them over range bars even if they are only subtly different.
The following 2 users say Thank You to aslan for this post:
When listening to the interview, it just kind of bothers me that they are being presented as a new and innovative concept. I am thinking that there are more than a few people who use or who have experimented with an atr calculation to set their range bars, myself included, yet have you ever heard of the Foster Bar?
Yes, the bars are presented as wonderful thing (of course they are selling stuff), but I look at them as what they really are: a tweaked range bar. There are other bars out there (i.e. no gap range bars, alt range bars, etc), each trying to address some weakness of some bar type. It is possible that one of those is the same as Kase, but I have not gone looking at all possible bar types out there. I implemented these, as I was curious, and I already knew how to do custom bars in NT.
It all comes down to what is important to you as you are looking at price. Do you care about time? Are you looking for pivots? Do you care about volume? Lots of variables, and no bar type can do them all (that will be the AslanBarType )
A fix is coming, waiting for download file to get updated.
I really don't know what is going on in NT65, but I was able to reproduce the issue, though I did not originally understand what people were describing. In the process, I managed to trash my system as I broke a rule of mine to not install unneeded software on "the" system. After recovering from NT65, there is something about the V4 file that NT and .net do not like. Basically, the file is overriding the "tick" bar type for an unknown reason. Changing the way the id is set, back to the V3 method, fixes it.
Sorry for any inconvenience I have caused any NT65 users. I will post back when the file gets updated. If anyone needs the file pronto, just PM me.
The following 2 users say Thank You to aslan for this post:
I wasn't trying to say they can't be useful or demean your efforts. I am going to run some replays with them this weekend and if I don't see any bugs, then I plan to use them myself. I think it would be better to see the gaps and I appreciate the time you have spent to program them. Like I said, I was just a little bothered by her tact.
I have seen the video. The 2 attachments are from it.
As was said in the video, if you had a single long bar of X minutes,
now you have several short ones. If you normally had several short
bars of the same periodicity, now you will have one, or just a few.
There no concern that one sometimes has about using a 10 minute
chart, for example, and seeing a HUGE move that triggers your
indicator after the move is done. You would have to adjust your indicator
or course, but HUGE moves will never exist in a Kase chart.
Contrary wise, a large number of 10 minute bars that go no where
are reduced to one or just a few.
Also of some interest, is that about the same number of bars exist
in the X minute chart (always on the right) as do on the Kase in the
two images posted here.
I checked out the Kase website. Some links are below if anyone has interest.
{I have no opinion on this company.}
=============================================================
This proprietary, state-of-the-art, market-timing software condenses its signals into a simplified, color-coded display system to fine tune entries and exits. Traders value StatWare because it combines high accuracy with ease of use. Developed using statistically based AI technology, StatWare is compatible with all liquid and active markets including stocks, commodities, bonds, futures, options and indices.
-----------------------------------------------------------------------------------------------------------------
If anyone has an idea about this that would be great.
As I understand it, Kase bars are much like range bars but Kase use only data that is real.
Is it mathematically possible/valid to take a Kase bar of 3,
which would have a short time period, and apply a moving
average to it? Let's say SMA of 8. Then using NT take that
SMA=8 and overlay it onto the same instrument with a Kase
of 6. {I'd be looking for a single chart of Kase=6 with a
single moving average visible.}
The idea is to have a Kase=6 with what would seem to be
a smooth moving average on it. Instead of using a Kase=6
with a SMA of 4 on it. (A SMA of 4, is a bit jerky.)
I don't know if doing this would cause the newly created
moving average to go out of sync with the bars. Since the
moving average is not being created from those exact bars.
Since my last and favorable post on Kase bars with ATS, I now report they are no better or worse than other tick based bars. As far as NT is concerned, if you seek accurate backtest results, nothing compares to time based charts. The others cannot be trusted.
I use Interactive Brokers with NT7 and Interactive Brokers does not supply historical tick data. Therefore, I cannot backfill the data on my charts when using Range or Kase bars.
I'm curious if there is a way to have these Kase bars based on 1 minute data so that I have access to historical Kase or Range bars? I understand that this type of historical bar would not be completely accurate, however, it would allow me to backfill my chart with Range/Kase bar data even if it is not as accurate as historical tick data.
As a workaround, I'm also thinking of whether the Kase/Range bars can be used as an indicator instead of a bar type. Possibly this would work for those of use who don't have access to historical tick data. We could simply use the Kase/Range bars as an indicator based on 1 minute data instead, which would allow us to have the necessary historical data to backfill the chart.
I'm not a programmer, so any thoughts would be appreciated.
Yes, this can be done. The NT bar generation code can be written to look at ticks or other bars types as input. The code is currently written to only look at ticks though, as that is what I have experience with.
To make this change, you would have to change the Add() method to look at the open, high, low, and close instead of just the close as is done today. There are a few other items that need to change, like the BuiltFrom property, and somehow you need to pass in the config for what bars you want to build off of. There are other bar types in NT that do allow bars to be built based on other bars, so I would use those as an example of what needs to be done.
Note, when you base the bars on minute bars (or any bar type), you should be using a larger Kase bar if you want to see anything useful.
Edit: I should have mentioned that Kagi, LineBreak, and PointAndFigure types are good examples that use multiple bar input types.
The following 2 users say Thank You to aslan for this post:
You can connect to more than one connection. So you should be able to connect to IB connection as the primary connection, and then (and here's the caveat) connect to a secondary connection. the caveat is that you'll need another live feed such as Zenfire. So if you really want to trade through IB, but have Tick and Range charts capability, you'll need to either pay for another feed, or open up another account that will give the data to you for free.
Excite,
also in your "iB" connection set up you can choose for historical data choose external servers -- i believe that is what i did as that is what i use and i have all the historical data for kase bars that i need --- and that will fill in all the historical data you need for using nt7-- dont think that works for nt6.5 ... ninja trader has servers that has all that tick data backed up for you so it doesnt matter if you use iB or not ---
hope that helps or at least get you hunting in the right direction
i would tell you my exact set up if i was back at my trading computer --- unfortunately wont be home for a few weeks --- i have pulled up gold/ES/NQ only in nt7 and all the historical data needed and connected to iB --- you might have to contact them for the other questions --- but i know i was surprised they offered the historical data --- so maybe it is just for the 3 i happened to choose ... but a good question ...
zenfires is limited back data if i remember correctly -- not sure how far back it goes --- kinetic which is a paid service might do a bit better --- but thats about all i know at the moment
Site Administrator Swing Trader Data Scientist & DevOps
Manta, Ecuador
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
Posts: 49,781 since Jun 2009
Thanks: 32,308 given,
97,568
received
Zen has no historical data. But, if you are a NinjaTrader user you can use NT's historical server, which last time I checked was keeping nearly one year of tick data, quite impressive. IQFeed has been growing their tick data as well, I believe they only advertise 30 days but I recently pulled over six months worth.
Hello:
I use Kase bars using the ATR of my tick bar chart from 9:45 to 3:45 and leave out any news spikes or FOMC days. I take the low from the high and divide it by 2 and add it to the low to get my kase bar setting. I take that number and use the day before to average a new setting. I have found it don't have to be that close but I measured in millionths of inches for a living for 34 years so I like to be precise.
First off, I don't think a Kase 200 bar chart would be practical. I don't know of a symbol that may move that much.
The highest I use on the ES is 16 on TS.
As to your problem, have you tried highest high and lowest low for the time frame you had in mind. With that you should be able to compute your ATR.
Good luck
Kase Bars are proprietary to Kase and Company, Inc. and the methodology and display for plotting Kase Bars is copyrighted intellectual property of Kase. Kase Bars are available at no charge on TradeStation and BLOOMBERG PROFESSIONAL . Any other charting vendor (NinjaTrader or others) interested in Kase Bars may contact Cynthia Kase at kase@kaseco.com.
Why is this guy not marked as a vendor on futures.io (formerly BMT)?
Also, anyone looking for this bar type should know that it is available free of charge for Ninja and Sierra as well, just search the site.
The bar type is not rocket science, as it is just a tweak on Range bars. That said though, I DO use them because they are better than range bars (again, the reasons are all here on the site).
The following user says Thank You to aslan for this post:
Foster Bars are proprietary to vegasfoster, Inc. and the methodology and display for plotting Foster Bars is copyrighted intellectual property of Foster. Foster Bars are available at no charge on TradeStation and BLOOMBERG PROFESSIONAL . Any other charting vendor (NinjaTrader or others) interested in Foster Bars may contact vegasfoster at vegasfoster@fosterbarsaremineyoubett...offbitches.com
The following 4 users say Thank You to vegasfoster for this post:
Site Administrator Swing Trader Data Scientist & DevOps
Manta, Ecuador
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
Posts: 49,781 since Jun 2009
Thanks: 32,308 given,
97,568
received
Most likely you have a conflict with the special bartype number, the way Ninja assigns bar types. You've probably got another add-on bar type using the same number.
I haven't used Ninja in forever and a day, so can't remember exactly how to fix this. Open the .cs inside your bin/custom/type folder for this bar type and near the top should be a fairly obvious definition for the 'number' for this bar type.
Or just wait for someone else to tell you more precisely how to do it.
I just "discovered" Kase bars on TS and I think it's largely a song of unrealized potential.
For larger range bars, the differences between Kase and simple Range bars is negligible. I usually have to conduct a sanity check when backtesting to ensure that I had no fills in gaps, but that's easy enough to do on larger range bars because the gaps almost exclusively ocurr between electronic close and open.
The "potential" of these bars is considerable given the ability to make the target input a variable.
Imagine if you could construct a range bar based off some variable (ATR, volitility, oscillators, etc).
"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Thx.
That's where we're supposed to find it, (under "type"), but (for me at least) it's not listed there.
Thx Mike.
I follow you, trouble is there isn't a cs file listed for the Kase bars via Tools/EditNinjascript.
Nor via Docs/NT7/bin/Indicators.
So there's no way to check the "number" you mentioned.
It's really odd.
I imported Kase zip in exact same way I've done for all other bar types which all work fine.
It imported ok (and I closed down and re-opend up NT) and via Windows Explorer/Documents/NT7/bin/Custom, I can see the Kase zip file, and it's sub folder with a cs file in it (which opens in notepad).
But Kase doesn't appear under "type" via Data series.
Thx for the feedback and hopefully someone who has these working ok will post what they did ?
Thx
"Every moment I wake up I realize I know nothing, and then I smile..." zt379
Honestly, I'm not trying to be a dick but I understand that.. hence the name "range" bar. My purpose is to generate multiple time frames as was performed in the webinar. If i take a 45 minute chart and stretch it across 5 days, then take the ATR of the 5 days on that chart... and do that at the end of every week my problem is solved.
hm, i do not see significant differences between the two types of bars (Kase and Range)
* If investing gets too difficult for a seventh grader to understand, the system is needlessly complex
* Markets produce an enormous volume of information, much of which is redundant
* In every game and con there's always an opponent, and there's always a victim. The trick is to know when you're the latter, so you can become the former
Thanks for the explanation Dan and thanks to your Mom and your firm for daring to "think outside the box". Too few individuals venture there any longer and usually get chastised for it if they do.
I like the looks of the Kase Bars but find having to calculate them each day a bit of a problem. You will always be working on "yesterdays" ATR. Why not just use a bar that is perfectly consistent based on the real time price action of each chart?