Custom bar type - built based on filtered block size (Page 2) - NinjaTrader Programming | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming

Custom bar type - built based on filtered block size
Started:August 5th, 2010 (09:22 PM) by Big Mike Views / Replies:4,514 / 12
Last Reply:March 10th, 2014 (11:18 PM) Attachments:2

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • 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, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Custom bar type - built based on filtered block size

Old April 16th, 2011, 09:39 AM   #11 (permalink)
Hartford, CT. USA
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: AMP/CQG, Kinetick
Favorite Futures: TF
RJay's Avatar
Posts: 672 since Jun 2009
Thanks: 716 given, 726 received

devdas View Post
@ bukkan or any other bar type coder,

I had some time in mind that a custom bar type would be possible to code say with OR or AND conditions on other basic bar type. Most common i dreamed it of like

1) A new bar initiated if "specified Range completed" OR "specified time elapsed". ( e.g 7Range OR 5Min )

2) A new bar initiated only if "specified Range completed AND "specified time elapsed" ( e.g 3Range AND 2Min)

other variants like "50Ticks OR 4Range", etc etc....would be interesting.


A vendor did something similar with renko bars back in 6.5 where the chart updated at fixed time intervals in addition to each bar close. It was a dll so no code to share.

Your idea sound entirely doable. Just add a second criteria for new bar creation.


Reply With Quote

Old April 17th, 2011, 02:13 AM   #12 (permalink)
Elite Member
Ann Arbor, Michigan USA
Futures Experience: Advanced
Platform: TradeStation, Biocomp
Favorite Futures: TF
Posts: 19 since Aug 2010
Thanks: 60 given, 20 received

Personally, I would want to see a "normalized" COMPARISON by volume size.
That means "decomposing" each of the bars into partial bars which if added together would "perfectly reconstruct" the "normal" original total volume bar. This method would show the effect of large versus small size trades in each bar with zero lag time of the comparison, and without error caused by fluctuation of overall trade sizes distorting the view of the relationship of largest versus smallest trades regardless of how big or small the average trade size is.

For example, you could make one set of bars from "VolumeA completed", and another from "VolumeB completed".

To make the bars comparable (normalized) , make VolumeA + VolumeB be total "Volume" to complete the bars, but VolumeA be the smallest blocksize HALF of the total volume, and VolumeB the largest blocksize HALF. Accumulate the price "deltas" ATTRIBUTABLE to each equal "tile" of the volume in each volume bar to generate the open-to close changes, save the excursions from open-to high and open to low attributable to their own volume tile, and you will get two synchronized charts with different shapes representing the activity of the two "tiles" of volume size. Both will add up to give the total-volume bars' open-to-close price change exactly, while the tick movements belonging with their own tile of the trade sizes will be allocated to their own special bars or candlesticks. Trade both charts, and call it trade size diversification. Or just see if the differences make a useful indicator.

Since I do not use Ninja, I hope someone can try this soon and post the result. I'm curious what the result would show!

Reply With Quote

Old March 10th, 2014, 11:18 PM   #13 (permalink)
Banned: trolling
Futures Experience: Beginner
Platform: NT
Favorite Futures: Gold
Cachevary's Avatar
Posts: 407 since Feb 2014
Thanks: 138 given, 77 received

bukkan View Post
heres one i created on the fly. set the FilterValue to filter the ticks in the parameter box.

how to install,

make sure NT is closed

download and copy the cs file (attached) in the Type folder (<My Documents>\NinjaTrader 7\bin\Custom\Type\)

start NT and compile any custom indicator or strategy.

restart NT.

havent tested much. so let me know if things are ok or not.


p.s. - have used the Custom 8 to create the bartype. if you have already some custom bartype which uses the same then edit the code accordingly.


Hey guys,how do i upload the bar type indicator?I put it in the Type folde but it doesnt appear in the Type drop box.

Thanks a lot in advance!

Reply With Quote

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming > Custom bar type - built based on filtered block size

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reversal Bar Type monolisa NinjaTrader 18 August 2nd, 2012 10:02 AM
Bar Counter For Line Break Bar Type Eagle01 NinjaTrader Programming 8 April 1st, 2012 11:29 PM
Wicked Renko custom bar type for NT7 aslan NinjaTrader Programming 25 March 10th, 2012 10:13 AM
add custom bar type to chart selection SARdynamite NinjaTrader Programming 15 July 8th, 2010 10:53 AM
range bar size jb004 Traders Hideout 5 May 10th, 2010 10:25 AM

All times are GMT -4. The time now is 12:54 AM.

Copyright © 2016 by 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 2016-10-28 in 0.08 seconds with 20 queries on phoenix via your IP