NexusFi: Find Your Edge


Home Menu

 





Advanced Bollinger Band indicator - does it exist ?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 17 posts (42 thanks)
    2. looks_two wldman with 12 posts (3 thanks)
    3. looks_3 forrestang with 11 posts (22 thanks)
    4. looks_4 Overview with 7 posts (0 thanks)
      Best Posters
    1. looks_one Fat Tails with 2.5 thanks per post
    2. looks_two forrestang with 2 thanks per post
    3. looks_3 RedK with 1.5 thanks per post
    4. looks_4 wldman with 0.3 thanks per post
    1. trending_up 26,087 views
    2. thumb_up 74 thanks given
    3. group 11 followers
    1. forum 58 posts
    2. attach_file 12 attachments




 
Search this Thread

Advanced Bollinger Band indicator - does it exist ?

  #41 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


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

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Futures True Range Report
The Elite Circle
Deepmoney LLM
Elite Quantitative GenAI/LLM
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
Battlestations: Show us your trading desks!
26 thanks
NexusFi site changelog and issues/problem reporting
25 thanks
The Program
17 thanks
  #42 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


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
  #43 (permalink)
 dimitri 
Athens - Greece
 
Experience: Intermediate
Platform: Metastock
Posts: 76 since Jul 2010
Thanks Given: 202
Thanks Received: 36



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).


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
  #44 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


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
Thanked by:
  #45 (permalink)
 dimitri 
Athens - Greece
 
Experience: Intermediate
Platform: Metastock
Posts: 76 since Jul 2010
Thanks Given: 202
Thanks Received: 36


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
Thanked by:
  #46 (permalink)
 
wldman's Avatar
 wldman 
Chicago Illinois USA
Legendary Market Wizard
 
Experience: Advanced
Broker: IB, ToS
Trading: /ES, US Equities/Options
Frequency: Several times daily
Duration: Hours
Posts: 3,507 since Aug 2011
Thanks Given: 2,046
Thanks Received: 9,491

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.

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #47 (permalink)
 dimitri 
Athens - Greece
 
Experience: Intermediate
Platform: Metastock
Posts: 76 since Jul 2010
Thanks Given: 202
Thanks Received: 36


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
  #48 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


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%).


Reply With Quote
Thanked by:
  #49 (permalink)
 
RedK's Avatar
 RedK 
Dubai, UAE
 
Experience: Intermediate
Platform: TOS, TradeStation
Broker: OX, TradeStation
Trading: Stocks & Basic Options
Posts: 171 since May 2012
Thanks Given: 44
Thanks Received: 145

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 futures.io (formerly 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

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #50 (permalink)
 
wldman's Avatar
 wldman 
Chicago Illinois USA
Legendary Market Wizard
 
Experience: Advanced
Broker: IB, ToS
Trading: /ES, US Equities/Options
Frequency: Several times daily
Duration: Hours
Posts: 3,507 since Aug 2011
Thanks Given: 2,046
Thanks Received: 9,491


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.

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on June 11, 2013


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts