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


Hybrid Custom BarType
Updated: Views / Replies:4,410 / 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

  #11 (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

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.

Thanks again,

Mike

Reply With Quote
The following user says Thank You to MWinfrey for this post:
 
  #12 (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

aslan and RJay,

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.

Any ideas why this is happening.

Thanks for your help...

Mike

Reply With Quote
 
  #13 (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


It would help if you can you post your cs file. Thanks.

Reply With Quote
 
  #14 (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

here you go.

Thanks for looking at this.

Mike

Attached Files
Register to download File Type: zip MikesMinuteBarsType.zip (1.7 KB, 74 views)
Reply With Quote
 
  #15 (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
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.

Any ideas why this is happening.

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:
 
Code
private void Debug(string msg) 
{
	using (System.IO.StreamWriter sw = System.IO.File.AppendText("C:\\debug.txt")) 
	{
		sw.WriteLine(msg);
	}
}
The using block will close the file for you. You can then do something like the following to see the timestamp issues:
 
Code
if (isRealtime)
	Debug(bars.Count+" time="+time+" lbTime="+lastBar.Time);

Reply With Quote
The following 3 users say Thank You to aslan for this post:
 
  #16 (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 for you effort and your much better way to debug than what I've been doing.

I wish you had seen something stupid that I'd done but guess not. I guess this will have to sit because nt won't support custom bartypes.

Thanks again,
Mike

Reply With Quote
 
  #17 (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

Just for grins, the same exercise works fine in NT7.

Reply With Quote
The following user says Thank You to aslan for this post:
 
  #18 (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

That's funny. I'll work in NT7 on this little project. Just want to prove a concept anyway. I'll let you know how it turns out.

Reply With Quote
 
  #19 (permalink)
DabbaDo
Indianapolis/IN
 
Futures Experience: Intermediate
Platform: SC, NT, ToS, my own
Broker/Data: Stage5, InteractiveBrokers
Favorite Futures: ES
 
Posts: 57 since Jan 2013
Thanks: 961 given, 93 received

Debugging a BarsType in Visual Studio

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.

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 02:07 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-12 in 0.11 seconds with 20 queries on phoenix via your IP 54.163.209.109