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,110 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 ?

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

@RedK

The distinction that interests me is the relationship between two non co-linears, perhaps relative to price. I'n that context I'd seek a pattern that can be anticipated or duplicated. So unlike MACD where the "CD" is between two MA's, this idea would look at the relationship between say volatility and volume, or between two timeframes, and then be overlaid on price.

Not to digress too much but I think the situational evaluation for the trade entry/exit metric should be based on relationships between readings, not just readings. In that, I think, you gain some insight especially in determining the risk/reward of a potential entry.

DB

Visit my NexusFi Trade Journal Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Futures True Range Report
The Elite Circle
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
Are there any eval firms that allow you to sink to your …
Traders Hideout
 
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
NexusFi site changelog and issues/problem reporting
26 thanks
The Program
18 thanks
GFIs1 1 DAX trade per day journal
18 thanks
  #52 (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


RedK View Post
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..

The relative/ log-based approach is necessary for longer timeframes. As long as you apply indicators to intraday charts the linear approximation is good enough. I do not use logarithmic scales on an intraday chart, but would definitely use it on a monthly chart.

When trading stocks the absolute percentage reflects the amount invested and is proportional to the downside risk. When trading futures you would use leverage to adjust your position to the volatility of the underlying. In this case it is better to adjust slope to volatility.

In the end when coloring an indicator, what I really want to achieve is to get alerted to a situation where price moves sideways. If I was to use a correct mathematical approach I would calculate all deltas of the moving average over a lookback period of a year, then show the (near-Gaussian) distribution of those slopes and just take out 5 percentiles ot each side of the zero-slope and consider this as flat. This is because I do not use slope as proxy for value but for a sideways market condition.


RedK View Post
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.

Thank you for pointing to this problem. Originally I had used an approach which calculates an average true range over the entire chart period. In that case the value is less arbitrary and less fluctuating than the ATR(20), which I have used in this indicator. The only problem with the ATR is that it evolves slowly, and that the final values will then depend on the lookback period of the chart. I know that ATR(20) is not a perfect solution, but that some improvement is possible here.

One problem is that with intraday charts volatility is low prior to the session start, so the ATR(20) used for the first bar of the session is not really relevant. What I should do is either

-> calculate the average true range over 5 consecutive trading days
-> or produce an estimation of the average true range by calculating it from the daily range

The second option is not so difficult. I would load the last year of daily data, then calculate the average range per day, and then divide it by the square root of the average number of bars per day. For example, if I have a 5 minute chart of ES, then the number of bars per day are 267(Monday), 279(other days), which results in an average of 276.6 bars, I would therefore divide the average daily range by sqrt(276.6) = 16.63 to obtain my normalization factor for slope.

If I was to use an adaptive approach - as I do now for simplicity's sake - I would rather opt for using implicit volatility than historical volatility. Implicit volatility could be calculated by studying intraday seasonality and use a volatility function calculated from the DayOfWeek/TimeOfDay.


RedK View Post
- 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..

A tangent is only available for continuous functions. Approximating a tangent with a secant is not a crime.


RedK View Post
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

Does your script also achieve the prupose for which I have produced the code that is

-> to produce a practical solution for ALL instruments and ALL timeframes to identify the middle percentiels in the distribution of slope,

-> if it achieves the purpose the yellow (neutral) zones should be as frequent on a daily chart of YM as they are on a 1-minute chart of EURUSD ?

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


@FatTails, i don't think it does or it attempts to come close to what you're doing.. it is a very basic calc of slope that i worked on for a while.. with focus on stocks, and i would rarely look at 1min or 5min charts ..

i was just sharing how I approached the methematica problem of calculating slope on a price chart.. and the key 2 thoughts i had to work around.. your approach is mouch more comprehensive and i admire the amount of effort you put into it.. this is really valuable to all of us,

cheers,
RedK

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #54 (permalink)
 lblanks 
South Carolina
 
Experience: Intermediate
Platform: Ninjatrader
Broker: Zen Fire
Trading: 6E, ES
Posts: 51 since Jun 2011
Thanks Given: 126
Thanks Received: 15


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


lblanks View Post

Could you please provide a link to the indicator that retrieves the signals. I have no clue what it is doing.

The Bollinger Universal indicator has an additional smoothing feature. Also it allows to use different moving averages. I do not know how that other indicator calls it.

Reply With Quote
  #56 (permalink)
 lblanks 
South Carolina
 
Experience: Intermediate
Platform: Ninjatrader
Broker: Zen Fire
Trading: 6E, ES
Posts: 51 since Jun 2011
Thanks Given: 126
Thanks Received: 15

Sorry User error I somehow got median instead of SMA you would not think it makes that much difference but it does thanks for all your work on the forum.

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


Fat Tails View Post
@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%).


@Fat Tails
Dear Fat, using your logical approach to calculate the slope .... we can go on, by using Trigonometry ....
So we can now "calculate the X axis" (which in charts is "time series") .... using the "slope value" and the "Delta (which is the Y axis or price...)". Now by using the Tangent formula = X/Y or X=Tan*Y ....
Having now the "new conventional value" of X, we can start a very serious research with this value ....
At this point, i have to declare that i am using Metastock and i am not a programmer ... Manually (it is very hard ....with all PC's and technology around ...) i have tried to see how the "X" value is performing in following logic ....
It seems to have an interesting result ....
The Logic is : Starting from a ZERO point which can be a Highest High or a Lowest Low .... we add the "X" with the "X of previous bar" ... when it is applied ....

If anybody can spend his precious time to code it and show the chart results ..... (as explained i have no any programming skill ...) it will be very very much appreciated ...

Best Regards
Dimitri

Reply With Quote
  #58 (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
@Fat Tails
Dear Fat, using your logical approach to calculate the slope .... we can go on, by using Trigonometry ....
So we can now "calculate the X axis" (which in charts is "time series") .... using the "slope value" and the "Delta (which is the Y axis or price...)". Now by using the Tangent formula = X/Y or X=Tan*Y ....
Having now the "new conventional value" of X, we can start a very serious research with this value ....
At this point, i have to declare that i am using Metastock and i am not a programmer ... Manually (it is very hard ....with all PC's and technology around ...) i have tried to see how the "X" value is performing in following logic ....
It seems to have an interesting result ....
The Logic is : Starting from a ZERO point which can be a Highest High or a Lowest Low .... we add the "X" with the "X of previous bar" ... when it is applied ....

If anybody can spend his precious time to code it and show the chart results ..... (as explained i have no any programming skill ...) it will be very very much appreciated ...

Best Regards
Dimitri

Any geometrical approach will not help you but lead you directly to a bunch of problems. Let me repeat the basics.

Slope is a visual proxy for momentum, which works if scales are invariant and if you use it for a single time frame. When chart books for daily charts were printed, with always the same horizontal scale and the same vertical scale, this was possible.

We are not interested in slope, but we are interested in the relative change of the value of the moving average between two consecutive bars.

"steep" means that it is changing faster than usual
"flat" means that it is not changing or that the changes are very small compared to average change

Steepness on a 5 minute chart is not the same as steepness on a 60 min chart. On a 60 min chart the change of the MA value should be sqrt(12) times larger than on a 5 min chart. This means that we need to take into account the timeframe of the chart, if we wish to continue to use the concept of steep and flat. Taking into account the timeframe is achieved by comparing the change in the values of the MA to the average bar size. If the change is a full bar, it is very steep. If it is a small fraction of that bar it is flat.


Rise-over-run

The concept of "rise-over-run" replaces the geometrical concept of the slope. Rise-over-run is the change of a linear regression slope or a moving average over 1 bar. Rise-over-run is not normalized over instruments and timeframes, so with similar settings rise-over-run will not identify flat periods. Normalization can be achieved

- via dividing by average volatility
- by populating a large array with all available MA differences over the chart lookback period and calculating percentiles (this is similar to the approach for market profile)

You cannot achieve this with any trigonometric approach.

Reply With Quote
Thanked by:
  #59 (permalink)
 
echoeversky's Avatar
 echoeversky 
Puyallup, Washington State
 
Experience: Intermediate
Platform: NinjaTrader
Broker: NINJATRADER/CQG
Trading: NQ, CL, ES, YM
Posts: 115 since Sep 2009
Thanks Given: 113
Thanks Received: 48

Any thoughts as to using the Eito (sp) Calculus that helped the Black Scholes formula with its continuous time contribution?

Follow me on Twitter Reply With Quote




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