Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Yes I understand that renko is a "different animal". I'm starting my quest using volume, time, and range. We'll see how that goes before I attempt to do anything with the "different animal". This may turn out to be an academic exercise but it sure looks awesome in my head along with all those other wonderful ideas just dying to get out.
I've been working with the MinuteBarType and ran across something right at the outset that I'm not sure how to handle. I copied the code for the Minute Bar type into an indicator so I could replicate the MinuteBarType as MikesMinuteBarType. I changed all references to MinuteBarType to MikesMinuteBarType and changed the SortOrder.
I compiled and restarted NT6.5. Loaded a chart with MikesMinuteBarType and it looks perfect on historical data but live data doesn't build a bar. It displays every individual tick. I don't understand this as my code is copied directly from NT's with only those changes I mentioned.
You are dealing with some kind of Ninja bug. For some reason, NT is calling Add() with a time == current bar time (which is in the future for min bars, as the timestamp is the end of the bar) for each tick.
I went thru the same exercise you did, and copied the Ninja code as is, and only changed the sortid and period type, and got the same behavior. I added some debug statements to see the incoming timestamps. As each tick is coming in, NT is incrementing the timestamp by 1 min, causing a new bar to be generated. If you really want minute based bars, you will have to talk with NT support.
As you move forward, most bar types are generated from ticks, not minute bars. You change that in the BuiltFrom() method.
P.S. You should also change the value of the DisplayName() routine to return a different string, as yours is returning "Custom8". This routine sets the value shown in the intervals menu items.
P.S.S. Here is a quick and dirty routine to add a Debug statement:
The using block will close the file for you. You can then do something like the following to see the timestamp issues:
This is an old thread, but here is how I use Visual Studio to debug a custom BarsType (in addition to writing debyg output to a file):
1. Compile an indicator in NT, in Debug mode (this also compiles the BarsType).
2. Exit and restart NT (this loads the new BarsType into memory).
3. Compile an indicator in NT, in Debug mode (yes, again. Seems necessary for NT to "know" we're really debugging).
4. In Visual Studio, do Tools Attach to NinjaTrader.
5. In NT, apply your custom indicator. Now your VS breakpoints will be hit.