Hybrid Custom BarType - NinjaTrader Programming | futures io social day trading
futures io futures trading


Hybrid Custom BarType
Updated: Views / Replies:4,406 / 18
Created: by MWinfrey Attachments:1

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 1  
 
Thread Tools Search this Thread
 

Hybrid Custom BarType

  #1 (permalink)
Elite Member
Lubbock TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Stage 5 Trading
Favorite Futures: CL
 
MWinfrey's Avatar
 
Posts: 1,879 since Jul 2009
Thanks: 1,449 given, 3,306 received

Hybrid Custom BarType

I've done a lot of NT 6.5 programming of indicators and strategies but am running into a challenge that I haven't been able to solve. I am trying to create a hybrid custom bartype that consists of time, volume, and the open to close range. For example, I want to set the time to 1 minute, open to close range of the bar to 4 ticks, and the volume to 400v. This combines the value of all 3 types of bars. A new bar will be started when either of those parameters is met. this prevents huge bars when you are using 1 minute or 400v charts. However, it also prevents a single bar taking forever to close when you are using 400v or 4 tick range bars or 4 tick renko bars. My belief is that by combining all 3 factors, you have a more accurate representation of volatility than either of the conventional bars provide.

Any thoughts on the value of this type of bar and also is there anyone interested in helping me code this as a custom bar type?

Also, I'm curious how to output or print somthing to the output window from within a custom bartype. Print() doesn't work. I get an error saying Print() isn't found within this context.

Mike Winfrey

Reply With Quote
The following 2 users say Thank You to MWinfrey for this post:
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
Madison, WI
 
Futures Experience: Advanced
Platform: Sierra Charts, ALT
Favorite Futures: ES
 
aslan's Avatar
 
Posts: 614 since Jan 2010
Thanks: 342 given, 1,077 received



JoeBlow View Post
Also, I'm curious how to output or print somthing to the output window from within a custom bartype. Print() doesn't work. I get an error saying Print() isn't found within this context.

Yes, Print() is not available when building bars. I assume you are trying to debug your code, in which case I usually just open a text file and write to that instead of the output window (search for StreamWriter in C#). There is a thread around here on debugging indicators in Visual Studio, not sure if that would work for bar building code, but it may be worth looking into.

I dont use 6.5 anymore, but can try to answer some questions on bar building. Most of your code will be in the Add() method. Use the NT Range, Volume, and Minute Bar code as a base to see how they close bars (don't take their code as gospel though, as their is a lot of stupid stuff in there). Pick one of those types as the base and save it with the name of your bar type. I usually save the code in the indicator directory, so you can edit and compile the code as if it were an indicator (just remember, you need to restart NT to reload the bar type code after you compile it).

Reply With Quote
The following user says Thank You to aslan for this post:
 
  #4 (permalink)
 Vendor: www.innovative-trading-solutions-online.com 
Hartford, CT. USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: AMP/CQG, Kinetick
Favorite Futures: TF
 
RJay's Avatar
 
Posts: 677 since Jun 2009
Thanks: 726 given, 740 received


JoeBlow View Post
I've done a lot of NT 6.5 programming of indicators and strategies but am running into a challenge that I haven't been able to solve. I am trying to create a hybrid custom bartype that consists of time, volume, and the open to close range. For example, I want to set the time to 1 minute, open to close range of the bar to 4 ticks, and the volume to 400v. This combines the value of all 3 types of bars. A new bar will be started when either of those parameters is met. this prevents huge bars when you are using 1 minute or 400v charts. However, it also prevents a single bar taking forever to close when you are using 400v or 4 tick range bars or 4 tick renko bars. My belief is that by combining all 3 factors, you have a more accurate representation of volatility than either of the conventional bars provide.

Any thoughts on the value of this type of bar and also is there anyone interested in helping me code this as a custom bar type?

Also, I'm curious how to output or print somthing to the output window from within a custom bartype. Print() doesn't work. I get an error saying Print() isn't found within this context.

Mike Winfrey

Hi Mike,

Not having the output window when working on custom bartype files really sucks!!!

Aslan has a workaround. I just had to settle for brain damage from banging my head against the wall.

I agree with the outline Aslan has provided in his post on initial steps for the new bartype.

I did try to visualize what the chart would look like. Is this something new or are you trying to duplicate something you have seen?

If you are interested in a tutorial from my experiences in chart type development, contact me.

RJay

Reply With Quote
 
  #5 (permalink)
Elite Member
Lubbock TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Stage 5 Trading
Favorite Futures: CL
 
MWinfrey's Avatar
 
Posts: 1,879 since Jul 2009
Thanks: 1,449 given, 3,306 received

Thanks aslan...I've done some custom bar building before as well and worked out the outline for that in the same fashion you describe. I started with the volume bartype and have MikesVolume working just fine. I save to the indicator directory as well. Just easier to get to. And yes I restart NT each time. Took a bit to figure that out.

Regarding Print()...yes I'm trying to debug my code. I thought of streamwriter yesterday after posting my message but figured I'd wait to see what kind of responses I get. Now I think I'll get back on that after I get back from seeing the doctor.

Now I can attempt to figure out why my code isn't working like I think it should.

Thanks again aslan...have a great day.

Reply With Quote
 
  #6 (permalink)
Elite Member
Lubbock TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Stage 5 Trading
Favorite Futures: CL
 
MWinfrey's Avatar
 
Posts: 1,879 since Jul 2009
Thanks: 1,449 given, 3,306 received

Hello RJay and thanks for your reply. Let me answer your question like this. I've never seen anything like what I describe so from my limited point of view, it's new. My challenge prior to entering a trade is to identify when the conditions are right. How's that for an statement of the obvious. I know there are other ways to look at it but anyway. For the purposes of my task, that's the way I see it. I see the market as having 3 aspects that need to be evaluated; time, volume, and range. I have 3 charts to help me with that, a 1 minute chart, 400v chart, and 4 tick renko brick chart. I actually trade on the renko chart. Really love those little fellas. However, each of those chart only account for one of the aspects in an obvious way. Time can be evaluated on each of those but it requires brain cells and I don't have many left at this stage of life. Using the 1 minute and 400v charts can get you to the party very late because of the big bars that can happen. Anyway, I've thought for some time now that it would be nice if I had a bar that was constructed accounting for all 3 aspects. I've visualized what that chart will look like and I think it might be useful but like all things I do, I don't really know until I actually see it.

I think that about covers it.

Thanks again for your post.

Mike

Reply With Quote
 
  #7 (permalink)
Elite Member
Madison, WI
 
Futures Experience: Advanced
Platform: Sierra Charts, ALT
Favorite Futures: ES
 
aslan's Avatar
 
Posts: 614 since Jan 2010
Thanks: 342 given, 1,077 received

I know you are using 6.5, but I thought I would mention one thing for NT7. In NT7, they added bar caching to try to improve performance (which they do), but they make writing custom bars difficult for several reasons. First, once they are cached, you can not depend on getting Add() called for Bar zero, so there is no good place to do time zero initialization. Second, when debugging, you will get strange inputs and bars will not be rebuilt, but loaded from the cache. The only way around this is to blow away the cached bars on disk. Just something to remember if/when you do make the jump.

Reply With Quote
 
  #8 (permalink)
 Vendor: www.innovative-trading-solutions-online.com 
Hartford, CT. USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: AMP/CQG, Kinetick
Favorite Futures: TF
 
RJay's Avatar
 
Posts: 677 since Jun 2009
Thanks: 726 given, 740 received

Hi Mike,

You said:

"I have 3 charts to help me with that, a 1 minute chart, 400v chart, and 4 tick renko brick chart."


I believe:

Range, time, and volume charts can be compatible because of the way they are constructed.

Renko is a completely different animal. Trying to merge it with other chart types would be "difficult".
Good Luck,

RJay

Reply With Quote
 
  #9 (permalink)
Elite Member
Madison, WI
 
Futures Experience: Advanced
Platform: Sierra Charts, ALT
Favorite Futures: ES
 
aslan's Avatar
 
Posts: 614 since Jan 2010
Thanks: 342 given, 1,077 received


RJay View Post
Renko is a completely different animal. Trying to merge it with other chart types would be "difficult".

I agree. I saw a new Renko indicator in the downloads section: RBI

See if that may be of help.

Reply With Quote
 
  #10 (permalink)
Elite Member
Lubbock TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Stage 5 Trading
Favorite Futures: CL
 
MWinfrey's Avatar
 
Posts: 1,879 since Jul 2009
Thanks: 1,449 given, 3,306 received


oh gee...I've run into that. I do have nt7 up on a third computer for testing and see that my version of the renko bar has some issues. probably related to your comment. I'll take a look with your comments in mind.

Thanks again.

Reply With Quote

Reply



futures io > > > > > Hybrid Custom BarType

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Instruments sysot1t Investor/RT 5 June 14th, 2011 04:49 PM
Custom Futures Mondrakete TradeStation 3 May 8th, 2011 05:41 AM
Hybrid Trading - Multicharts(algo)/NT7 Manual Management Bondi9999 MultiCharts 5 March 26th, 2011 01:07 PM
help with bartype for strategy in EL JVentura EasyLanguage Programming 4 December 4th, 2010 12:57 PM
Custom BarType - PropertyDescriptor bukkan NinjaTrader Programming 5 August 14th, 2010 02:52 PM


All times are GMT -4. The time now is 10:30 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-10 in 0.13 seconds with 20 queries on phoenix via your IP 54.221.73.186