Again, this is a major rewrite. Backup your old copy first, this one will overwrite it. If you don't like the new one you can go back to the old one this way.
There are two parameter options.
Multiplier - 1.0 is normal. If you feel the bands are too tight, you can raise this value, but it will no longer represent the real retracement levels of the daily ATR.
ATR Length - 7 is default. Lower will adapt more quickly to a changing market (like the recent huge fluctuations on CL). Higher will adapt slower.
I've added two extra bands to show the 100% and 161.8% levels. I've set the default colors the way I like them, which is different than the last version so take note. I also like the bands to blend into the chart, so the Alpha opacity is set for each plot.
You'll need to redo your template as the Plot names and settings have changed.
The histogram has been removed.
As far as I can tell, I've solved the math bugs. Please report any problems.
Mike
COMPATIBILITY:
NinjaTrader 6.5: YES
NinjaTrader 7.0: YES prior to beta 23 only
V2.0 - Automated drawing of Blue rectangle on the chart
You can access the plot value be using BBKCDelta[0] (for the current bar) in your trading strategies...
Message me with questions..
Thanks.
=======================
I wrote this indicator recently to help identify possible consolidation in the market. It detects times when Bollinger Band squeezes within the Keltner Channel (implies consolidation) and plots as a histogram below the chart.
Bollinger Band and Keltner Channel Period may be customized. Default 20
Keltner Channel Offset default is 1.5
I have provided for an additional offset parameter to adjust the Squeeze threshold. This helps lead the beginning of consolidation. Default is 0.5; I usually set it to 1.5. Works for me. More picky about trade signals...
I use it towards confirming my trend based trades.
Please post your questions, comments and/or feedback.
May 15th, 2019
Size: 8.42 KB
Downloaded: 1131 times
2067
srshanta
Exported using NT Version 7.0.1000.11
This is a simple Bollinger Band Squeeze. The Bollinger Band Squeeze compares directional volatility as measured by the standard deviation to non-directional volatility as measured by the average range.
The squeeze is a situation, where Bollinger Bands are inside a Keltner Channel. This indicator does not plot the Bollinger Bands and the Keltner Channels, but plots the distance of the Bollinger Band from the Keltner Channel and displays it as a histogram.
When the histogram has a positive value: This means that the Bollinger Bands are outside the Keltner Channel. Directional volatility is high or normal.
When the histogram has a negative value: This shows low directional volatility, which is called "the squeeze". For better visibility, the squeeze is reinforced with dots. When activated, sound alerts will inform you that the squeeze is on.
A squeeze is a good opportunity to enter a position, as it reflects a temporary period of balancing or indecision. To determine the direction of the expected breakout from the squeeze, other indicators should be used. In his book "Mastering the Trade", John F. Carter suggests a momentum indicator do determine the direction of the trade, but I do not think that this is sufficient to create a profitable system. You will need further indicators.
If you enter a trade during a squeeze, this usually leads to a good reward-to-risk ratio, as you will typically be able to use narrower stops during low volatility periods.
The Bollinger Bandwidth study is a technical indicator based upon Bollinger BandsŪ study, expressing the distance between upper and lower bands as percentage of the middle band value (SMA/EMA around which the bands are plotted). The main plot is accompanied with two additional ones: Bulge and Squeeze. Bulge plot displays the highest bandwidth value reached on the specified period, and, similarly, Squeeze plot shows the lowest bandwidth value.
This indicator was modeled after the first class Think or Swim Trading Platform.
The Bollinger BandsŪ Percentage B is a technical indicator based upon the Bollinger BandsŪ study; it plots a histogram showing position of price relative to the bands. It is calculated as percentage ratio of two differences: first one is the difference between the price and the lower band value, second one is the difference between values of upper and lower bands.
Adopted from the BollingerPercentB indicator on the highly recommended Think or Swim Platform.
NinjaTrader v7 indicator
Indicator is shown on the lower panel of the attached image.
This simple indie uses 'added data' in the code.. Just input the 'data series' you want to
study in relation to the 30min BB's and it will plot values (estimates) of where the 30 min
BB 'Upper' and 'Lower' will plot on the hour and half-hour that is coming up..
These bands will also show you the median value of the current 30minute study which I
find very useful to form a "bias"..
In general : if price is below the 'Lower' plotted 30min BB (30 min chart) AND below the
'Lower' (already plotted 'fulcrum') 10 min BollingerPro (10 min data on any tick or volume
series chart) then price is in oversold territory ... at least its below the number of SD's you're
studying AND what's projected..
**Important : This indicator will stop working on Rollover.. .. The 'added data' in the code
needs to be updated to the current Sept, Dec, Mar, June series AND underlying !.. i.e. if you
want to study ES, the code has to be changed to use ES as 'added data'.. It's very simple to
do - the 'added data' lines are 70 and 71.. (try changing them yourself - you'll feel like a coder)
Note: I've updated the code to a 'Source Code' version (I hope).. I also hope it works as a
version everyone can access and change as needed, as I had hoped to share originally..
** I'd like to include the link for a new 'source code' version of BollingerPro now 'BollingerProChof'
I wasn't aware I had uploaded a .dll version. I apologize and bear responsibility for what got
posted/shared.. …
I attached a couple more pics to explain 'Ellipse #'s 1 & 2' in the pic attached here..
I've penned specifics on data series and some tips you 'May' use.. "Only trade with money
you can afford to lose" haha - seriously I hope it all helps.. Chof
Description:
This algorithm is a custom performance index for the Default or Genetic optimization methods in NinjaTrader 7. Optimization with this index maximizes the 20th percentile of noise-injected bootstrapped expectancy. This metric is designed for robustness against worst case conditions. Note that due to the mathematics, the solution is not deterministic (run it multiple times, and you will get slightly different solutions each time).
Installation:
Add this file to your ...\NinjaTrader 7\bin\Custom\Type\ directory, open any indicator or strategy, and compile.
Details (this math is in here):
1. For a given series of trades of length N, the top 10% are removed, creating a modified series of trades of length N*0.9.
2. This modified series of trades is sampled *with replacement* for 10*N*0.9 samples. This series becomes the bootstrapped trade series.
3. Gaussian noise is a given mean and standard deviation is added to each bootstrapped sample.
4. Expectancy for this bootstrapped + noise series is calculated.
5. Steps 2 through 4 are done 5000 times, with different sampling from the Gaussian noise. This creates a distribution of expectancy.
6. Finally, the performance index returns the 20th percentile of these 5000 runs (so, the 1000th worst expectancy) to the NT optimizer.
Discussion:
Removal of the 10% best performing trades is an attempt to be pessimistic by assuming that the best 10% trades observed in the past will never repeat. We do not want total system performance to hang a few high-yielding trades.
Injecting noise to the bootstrapped sample accomplishes two things. First, it adds uncertainty to each bootstrapped series, thereby simulating diversity in the bootstrapped series (hopefully the diversity we would measure in a much larger sample). Secondly, it makes each bootstrap series unique. This means that we way calculate a distribution from the ensemble of bootstrapped series.
Any percentile may be returned. We could return the mean. By returning a value to the left of the mean, the 20th percentile, we are maximizing 80% of the distribution.
Note: Because we are injecting randomly sampled noise to the bootstrapped series, the solution from this performance index is not deterministic!
Suggestions:
If you use this, you should be comfortable changing the parameters found at the top of the algorithm. Adjusting the value of the standard deviation of the noise may make or break the robustness and success of this algorithm.
This version functionally replaces the previous version(s) described and available here but does not replace it when this version is installed. The previous version can be removed manually when and if desired.
Enhancements/Changes in Version 2
1. User can select from several MA types for the Moving Average plots, some of which are from Lizard Indicators made available by the GNU license. Credits to Lizard Indicators for both their indicators and the MA selection code.
2. When MA smoothing is selected the type can be an SMA, EMA, or the selected MA type. The smoothing period for each MA (fast, mid, and slow) can be set individually. A MA period of 0 eliminates the smoothing for that MA. Note: The Mid MA can be used as an intermediate period by specifying a value between the fast and slow periods. When the mid MA is requested with zero value for the period (default) will result in the mid period being calculated. If a period is specified and it is not between the fast and the slow the midpoint is calculated and used. No warning message is displayed.
3. The ability to apply volume filters (1-4) against the Net volume thereby limiting the Net volume histogram display a net bar only for the volume specified in the filter(s).
4. More control over how plots are displayed.
5. The divergence marker has been moved from the Total histogram to the Net histogram. This was done because the Total histogram can be turned off. The Net and/or Net filters must be active for the divergence marker to be displayed. If the Filter option is chosen without the Net plots being display the marker will only be display when there is a divergence on a filter value.|
6. The plot for the in-progress bar has its own color and can be user set. This plot is always displayed regardless of the display option selected.
7. This is not a change but a clarification as it also existed in the previous version. The position of the total line (above the line if a buy total and below the line if a sell total) is not based upon the last Close price but on the value (positive or negative) of the Net volume.
Similar to the previous version at times setting the Indicators region Type property to Logarithm is easier to read. The 2 instances of the indicator in the screen shot have the same operation modes set but the bottom one shows some of the ability to control what is displayed. without needing to independently setting each to transparent. If a particular display is turned off the values are still calculated and can be viewed in the Data Box.
Change Log
Date Description
April 12, 2019........Initial release
Improvement:
-zones are in square shape.
-set value for buy zone, sell zone separately
-if you set buy zone color to transparent, both buy zone and buy bracket turn transparent.
Note: I set the buy/sell hash line to transparent to show the square zone better, all you have to do is set them to some color.
February 29th, 2016 03:45 PM no3putts Many thanks, again and again and....
December 20th, 2015 09:40 PM romus
August 13th, 2014 10:00 AM tang
February 9th, 2014 06:15 PM bundwidower Fat Tails. You do not know what it means for beginners like me to have something to follow. Sorry I am unable to recipro
May 24th, 2020 01:44 PM FuturesBen tnx for the squeeze filter
March 13th, 2020 02:49 PM Zondor Incompetently coded using unacceptable beginner techniques. Tremendously inefficient.
October 4th, 2019 02:48 AM saikodi I cant seem to import this into Ninja Trader 7. Can you please confirm which version this is for?
September 27th, 2019 10:15 AM topdogtony This is great my first day in simNQ 1 contract 377 tick chart 2 trades made $670 and $760 on the 1 minute --tha
nk you thank you i will provide another update on this later on as I am keeping a record of how this does
May 27th, 2019 01:26 PM Ratdog Hello,
Would it be possible to add "rays" or "lines" from the top and bottoms of the boxes extending left or right horizontally
until touched / broken? (The "Swing indicator when set to lines could be a good example of this)..
Would it be possible to add multiple colors (preferably four) to the histogram? (Bright green, dark green, bright red da
rk red) for example?
Would it be possible to add volume profiles to the inside of these boxes?