Big Mike's Trading Forum
 

Go Back   Big Mike's Trading Forum

> Trading Forums > Platforms and Indicators > NinjaTrader


Notices
     

Advanced Bollinger Band indicator - does it exist ?
Started:September 20th, 2011 (10:03 PM) by Overview Views / Replies:6,690 / 58
Last Reply:June 11th, 2013 (02:55 AM) Attachments:12

Welcome to Big Mike's Trading Forum.

Welcome, Guest!

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

BMT is 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
     

Reply
 12  
 
Thread Tools Search this Thread

Advanced Bollinger Band indicator - does it exist ?

Old September 14th, 2012, 12:20 AM   #41 (permalink)
Market Wizard
Berlin, Europe
 
Trading Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Instrument: Keyboard
 
Fat Tails's Avatar
 
Posts: 8,377 since Mar 2010
Thanks: 3,940 given, 19,579 received
Forum Reputation: Legendary


wldman View Post
I have not updated to V.4 yet. Do you reccomend that I do that?

I understand what you have provided and I think that will be very useful.

How am I to interpret a numerical setting for "Neutral Threshold"? A larger number creates a larger neutral colored region. I see slope as a percentage of atr but I am not sure what that means. Could you describe that for me please?

Thanks Harry.

I always recommend to update to the latest version. Attention here, in case that there is a version conflict, you would need to first remove and then update all

- HeikinAshi
- Keltner Universal
- Bollinger Universal
- SuperTrend U11

Only applicable if you have them installed.

Neutral Threshold

I need to come back to the concept of slope. If you have a 10 tick move on a 5 min chart and you consider that steep, what would you consider steep on a 60 min chart? Certainly not a 10 tick move. The theoretical answer tells you that the equivalent would be close to a 10 * sqrt(12) = 35 tick move. The practical approach is to compare that move to the average bar size of the last xxx bars. The average true range just stands for average bar size.

Also it is important to understand that the slope of the moving average is a proxy for momentum. If you calculate the slope of a SMA it is the current value of the SMA minus the prior value, divided by a scale factor. The difference current value - prior value of a N-period SMA is identical with the N-period momentum divided by N. Slope therefore means N-period momentum divided by (N * scale factor).

The neutral threshold allows you to define what you consider flat. If you move that threshold up to 1000 the whole world will be flat. If you move it to zero, no slope is small enough to be considered flat. By selecting an appropriate number you can define a range for what is considered "weak momentum". This is experimental, you could for example set that value to 100.

The yellow areas cannot be described as a squeeze. Zero momentum can be created by too large moves that cancel out. A squeeze means that price has been sitting in a narrow range for some time, where narrow range is defined in terms of barsize.

Reply With Quote
     
The following 3 users say Thank You to Fat Tails for this post:
     

Old September 14th, 2012, 12:29 AM   #42 (permalink)
Market Wizard
Berlin, Europe
 
Trading Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Instrument: Keyboard
 
Fat Tails's Avatar
 
Posts: 8,377 since Mar 2010
Thanks: 3,940 given, 19,579 received
Forum Reputation: Legendary


wldman View Post
out loud on this. A bollinger band that was color coded based on the relative width between or the convergence/divergence of the bands would be a measure of short term relative volatility. That could also be used like the squeeze is to refine out periods of non-entry?

The squeeze compares N-bar volatility to intrabar volatility. It detects a situation where N-bar volatility is unusually low compared to intrabar volatility.

If you color code a Bollinger Band depending on the bandwidth (which is just the standard deviation), then you look at absolute levels of volatility, without comparing them to intra-bar volatility.

Low levels of absolute volatility mostly conincide with low levels of volatility relative to intra-bar volatility. A Bollinger Band indicator color coded on bandwidth would be something similar as the squeeze. If you compare the bandwidth to barsize, that is exactly the formula for the squeeze.

Reply With Quote
     
The following 4 users say Thank You to Fat Tails for this post:
     

Old September 14th, 2012, 01:53 AM   #43 (permalink)
Elite Member
Athens - Greece
 
Trading Experience: Intermediate
Platform: Metastock
 
Posts: 68 since Jul 2010
Thanks: 191 given, 28 received

Clarifying Slope ....



Fat Tails View Post
The neutral color just refers to the slope of the lines. I had been annoyed by all these false slope and angle indicators, which do not correctly show momentum relative to the chart scales. I have therefore coded an indicator which shows a neutral zone (slope close to zero) across all instruments and timeframes. The steepness measured by this indicator is normalized. You can apply it to a daily chart of YM or a 1-min chart of 6E and will always get a correct result for the relative slope of the lines. Try to do that with anyone of the many angle indicators and compare the results.

The Bollinger Universal has the option to measure a neutral zone for each of the three bands, or you can set it to midbandslope. In that case it will measure the slope of the moving average, which is used as a midband.

A yellow midband means that there is no strong trend but indecision. Now when there is a squeeze, that means that the directional movement has come to a halt, so you may expect a yellow area. This is like an unstable equilibrium. The color that follows indecision will then show the direction of the short term momentum, which would be the direction to enter your trade.

The chart attached gives an example, I have set the Bollinger Universal to MidBandSlope. The indicator below is the standard Bollinger Squeeze (Bollinger Bands inside the Keltner Channels).

Please register to view the post attachment(s), image(s), or screenshot(s) - it's simple and free.

Dear Fat,
Thank you again for your continuous contribution .... I would very much like to have your detailed "Slope Calculation" description .... As i have no programming knowledge, it is not possible to understand and interpret the code .... Please also make a reference to "neutral zone" ....
Waiting for your kind and detailed answer .... Thank you in advance.....
Best Regards
Dimitri

Reply With Quote
     

Old September 14th, 2012, 02:25 AM   #44 (permalink)
Market Wizard
Berlin, Europe
 
Trading Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Instrument: Keyboard
 
Fat Tails's Avatar
 
Posts: 8,377 since Mar 2010
Thanks: 3,940 given, 19,579 received
Forum Reputation: Legendary


dimitri View Post
Dear Fat,
Thank you again for your continuous contribution .... I would very much like to have your detailed "Slope Calculation" description .... As i have no programming knowledge, it is not possible to understand and interpret the code .... Please also make a reference to "neutral zone" ....
Waiting for your kind and detailed answer .... Thank you in advance.....
Best Regards
Dimitri

Slope is a geometrical concept which was used as a proxy for momentum. The geometrical slope depends on the vertical and horizontal scales used. The original idea was to look at momentum and to divide it by the number of bars (rise over run). If you use the slope of a moving average, you just need to compare the values of two consecutive bars, as the lookback period of the moving average is already taken into account.


Vertical scale value (not normalized): Price difference between the current bar's and the prior bar's value
Vertical scale value (normalized): Price difference between the current bar's and the prior bar's value divided by average bar true size over a longer lookback period
Horizontal scale value : 1 bar

A normalized formula for the slope would therefore be

slope = (current value of MA - prior value of MA) / average true range

I have seen concepts that use the ticksize instead of the average true range, but this is not very helpful. If you use ticksize, YM will always show steeper moves than ES, because its relative TickSize is smaller.

The indicator uses a variation of that definition of slope. Instead of the difference between current value and prior value of the MA it uses the difference between the current value and the average value of the two preceding bars. This also means that a correctional factor of 1.5 must be applied.

slope = (MA[0] - 0.5* MA[1] - 0.5* MA [2])/(average true range * 1.5)

which is a smoother version of slope. You can think of this as an artificial slope which applies to all instruments and timeframes.

The neutral threshold just measures that slope against a percentage. A value of 30 means 3%. This means that all slope value between -3% and + 3% are considered as insignificant (flat), which translates into a yellow color.

Reply With Quote
     
The following 3 users say Thank You to Fat Tails for this post:
     

Old September 14th, 2012, 02:37 AM   #45 (permalink)
Elite Member
Athens - Greece
 
Trading Experience: Intermediate
Platform: Metastock
 
Posts: 68 since Jul 2010
Thanks: 191 given, 28 received


Fat Tails View Post
Slope is a geometrical concept which was used as a proxy for momentum. The geometrical slope depends on the vertical and horizontal scales used. The original idea was to look at momentum and to divide it by the number of bars (rise over run). If you use the slope of a moving average, you just need to compare the values of two consecutive bars, as the lookback period of the moving average is already taken into account.


Vertical scale value (not normalized): Price difference between the current bar's and the prior bar's value
Vertical scale value (normalized): Price difference between the current bar's and the prior bar's value divided by average bar true size over a longer lookback period
Horizontal scale value : 1 bar

A normalized formula for the slope would therefore be

slope = (current value of MA - prior value of MA) / average true range

I have seen concepts that use the ticksize instead of the average true range, but this is not very helpful. If you use ticksize, YM will always show steeper moves than ES, because its relative TickSize is smaller.

The indicator uses a variation of that definition of slope. Instead of the difference between current value and prior value of the MA it uses the difference between the current value and the average value of the two preceding bars. This also means that a correctional factor of 1.5 must be applied.

slope = (MA[0] - 0.5* MA[1] - 0.5* MA [2])/(average true range * 1.5)

which is a smoother version of slope. You can think of this as an artificial slope which applies to all instruments and timeframes.

The neutral threshold just measures that slope against a percentage. A value of 30 means 3%. This means that all slope value between -3% and + 3% are considered as insignificant (flat), which translates into a yellow color.

Dear Fat,
Thank you for your detailed description ..... I am trying to find a solution into "calculating slope" ... the obtained results are not satisfactory ..... I will try your logic and calculations ....... I will let you know ....
Thank you again for all ....
Best Regards
Dimitri

Reply With Quote
     
The following 2 users say Thank You to dimitri for this post:
     

Old September 14th, 2012, 07:44 AM   #46 (permalink)
Market Wizard
Chicago Illinois USA
 
Trading Experience: Advanced
Platform: Ninja Trader
Broker/Data: IB
Favorite Instrument: duh hammer!
 
wldman's Avatar
 
Posts: 1,571 since Aug 2011
Thanks: 736 given, 1,438 received
Forum Reputation: Legendary

Great detailed description...

Thank you @Fat Tails for those great descriptions. I have a late start today and will enthusiastically focus on those posts after the coffee kicks in. On the most basic level I was looking for an improved typical squeeze type indicator with less lag that could be placed on the price field as I already have a good tenant in the sub-graph. Two sub graphs and IMO you start to queer up price action, which of course is and should always be king. I do enjoy the bpfsqueeze and the view I get from the Gaussian filter drawn histogram. I'm still trying to figure out what draws the signal/zero line though.

Be well Fat Tails and trade well.

Reply With Quote
     
The following 2 users say Thank You to wldman for this post:
     

Old September 15th, 2012, 03:20 AM   #47 (permalink)
Elite Member
Athens - Greece
 
Trading Experience: Intermediate
Platform: Metastock
 
Posts: 68 since Jul 2010
Thanks: 191 given, 28 received


Fat Tails View Post
Slope is a geometrical concept which was used as a proxy for momentum. The geometrical slope depends on the vertical and horizontal scales used. The original idea was to look at momentum and to divide it by the number of bars (rise over run). If you use the slope of a moving average, you just need to compare the values of two consecutive bars, as the lookback period of the moving average is already taken into account.


Vertical scale value (not normalized): Price difference between the current bar's and the prior bar's value
Vertical scale value (normalized): Price difference between the current bar's and the prior bar's value divided by average bar true size over a longer lookback period
Horizontal scale value : 1 bar

A normalized formula for the slope would therefore be

slope = (current value of MA - prior value of MA) / average true range

I have seen concepts that use the ticksize instead of the average true range, but this is not very helpful. If you use ticksize, YM will always show steeper moves than ES, because its relative TickSize is smaller.

The indicator uses a variation of that definition of slope. Instead of the difference between current value and prior value of the MA it uses the difference between the current value and the average value of the two preceding bars. This also means that a correctional factor of 1.5 must be applied.

slope = (MA[0] - 0.5* MA[1] - 0.5* MA [2])/(average true range * 1.5)

which is a smoother version of slope. You can think of this as an artificial slope which applies to all instruments and timeframes.

The neutral threshold just measures that slope against a percentage. A value of 30 means 3%. This means that all slope value between -3% and + 3% are considered as insignificant (flat), which translates into a yellow color.

Dear Fat,
Is that possible to describe the calculation to "measure the slope against a percentage", in order to understand your approach ....

Thank you in advance for your cooperation ....
Best Regards
Dimitri

P.S. : i am working with your "slope calculation" and it is very interesting ....

Reply With Quote
     

Old September 15th, 2012, 08:16 AM   #48 (permalink)
Market Wizard
Berlin, Europe
 
Trading Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Instrument: Keyboard
 
Fat Tails's Avatar
 
Posts: 8,377 since Mar 2010
Thanks: 3,940 given, 19,579 received
Forum Reputation: Legendary


dimitri View Post
Dear Fat,
Is that possible to describe the calculation to "measure the slope against a percentage", in order to understand your approach ....

Thank you in advance for your cooperation ....
Best Regards
Dimitri

P.S. : i am working with your "slope calculation" and it is very interesting ....

@dimitri: My indicator is open source, you can simply copy the code and analyze it.

If you look at my definition of slope I take the vertical distance of two consecutive points of the moving average. This distance represents something like the average per bar momentum over the lookback period. I then divide that value by the average true range. This is the simple version.

The indicator basically does the same thing, but uses two prior points P1 and P0 to calculate the slope. This gets you a slightly smoother variation of slope.

The chart below shows a delta of 0.05 against an average true range of 0.134. Division gets me a slope of 37%. If the absolute amount of that slope is smaller than 3%, the moving average will be displayed as yellow if the threshold is set to 30 ‰ (which is 3%).

Please register to view the post attachment(s), image(s), or screenshot(s) - it's simple and free.

Reply With Quote
     
The following 2 users say Thank You to Fat Tails for this post:
     

Old September 15th, 2012, 09:21 AM   #49 (permalink)
Knowledge Seeker
Dubai, UAE
 
Trading Experience: Intermediate
Platform: TOS, TradeStation
Broker/Data: OX, TradeStation
Favorite Instrument: Stocks & Basic Options
 
RedK's Avatar
 
Posts: 167 since May 2012
Thanks: 44 given, 127 received

Slope Calc .. a different view

don't mean to confuse things, and i follow the slope discussion with interest.. very interesting thought to use ATR to arrive at a "relative" slope that can be used between different instruments and still provide a usable reading..

here's my mathematical view - as i did give this a shot few weeks back before i saw the discusion on BMT - hoping this approach may give some thoughts to fellow scripters. will try to avoid complex pure math stuff,

- we are not living in a linear world when looking at a chart of a future or stock price as it goes up & down, but rather in a relative/log-based .. where i'm more interested in a 1% decreasse or increase rather than the $$ value. while the absolute dollar value of that 1% will change depending on what the current price range is, the 1% itself remains the same. for me that means slope "rise" need to be based on percentatges change and not absolute $ value change..

calculating price change relative to ATR(length) is a very practical approach to work around things & convert rise to a relative/percentage, my worry is, ATR(length) is not a constant and will slightly change with volatility, but maybe then, i may want that factor being built into the result. just need to be aware of it.

- the MA is not a line, but a curve.. so in slope calc we need to use the "slope of a tangent of a curve" version and not the "line slope" version..

considering these 2 points in calculating slope produces an angle, and regardless of scale of chart, underlying price range, or change of ATR(length) due to price fluctuating during certain periods, the angle of slope will continue to be a usable metric.. then you can say, between +15 and -15 i'm not interested as it shows a weak move ..

i can share the script for ToS .. reason i don't use it, it was almost the same curve as the momentum study i use.. so went back to Momentum.

hope this helps add another perspective,
cheers, RedK


Last edited by RedK; September 15th, 2012 at 09:29 AM.
Reply With Quote
     
The following 2 users say Thank You to RedK for this post:
     

Old September 15th, 2012, 09:33 AM   #50 (permalink)
Market Wizard
Chicago Illinois USA
 
Trading Experience: Advanced
Platform: Ninja Trader
Broker/Data: IB
Favorite Instrument: duh hammer!
 
wldman's Avatar
 
Posts: 1,571 since Aug 2011
Thanks: 736 given, 1,438 received
Forum Reputation: Legendary

Good Morning


So @Fat Tails maybe square scaled charts would create a more perfect visual on this?

Thanks so much for the feature and for the explanation here. The preset setting of 30 represents 3% slope or something just less than 1:3 where there is 1 unit of "rise" to every 3 units of "run"?

I'm thinking that a squeeze like indicator could be created measuring the relationship between the slopes of two lines, in this case the bollinger and the keltner. Those are not totally non colinear, but I wonder if the same relationship could be viewed with value between two non colinears.

Hate to be so nerdy, but I do sit and ponder this type of thing all the time.

Reply With Quote
     
The following user says Thank You to wldman for this post:
     

Reply



Tags
account, ai, atr, axis, bars, big mike, bollinger, calls, change, chart, charts, choice, close, code, coding, color, courses, create, custom, daily, daily range, data, data series, day, day session, discretionary, dow, downloads, el, ema, enter, equilibrium, error, es, exit, filters, fix, formula, functions, future, hold, horizontal, index, indicator, indicators, instrument, instruments, keltner, line, live, living, load, lot, macd, market, market analyzer, median, mind, ml, mode, modify, momentum, moves, moving average, multiple, ninja, ninjatrader, nt, nt7, offset, open, option, options, oscillator, pat, performance, period, plot, price, price action, profile, programming, purpose, question, range, research, review, rsi, scale in, series, session, settings, short term, slopes, sma, small, standard deviation, start, stochastics, swing, ta, thank you, tick, time, time series, type, update, values, volatility, zone
     

Big Mike's Trading Forum > Trading Forums > Platforms and Indicators > NinjaTrader > Advanced Bollinger Band indicator - does it exist ?

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads
Thread Thread Starter Forum Replies Last Post
Average range of each BAR indicator - exist already ? For ex Eric j NinjaTrader Programming 3 April 5th, 2013 03:34 PM
Bollinger Band Width Indicator perryg NinjaTrader Programming 24 April 22nd, 2011 09:38 PM
Delta band indicator PowerM Traders Hideout 5 September 28th, 2010 08:49 AM
Delta band indicator PowerM The Elite Circle 4 September 28th, 2010 02:53 AM
Bollinger Band Pinch Expansion zeller4 NinjaTrader 5 September 4th, 2009 04:08 AM


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

Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
Copyright © 2014 by Big Mike Trading. 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 2014-04-19 in 0.20 seconds with 20 queries on atlantis via your IP 54.237.95.6