Gap between Keltner Channels/Bollinger Bands in scanner

JMath3

New member
VIP
Would it be possible to add how much % gap I want between Keltner Channels and Bollinger Bands for scanner? Would appreciate any insight, thank you!

DwRg1YO.png
 

rad14733

Well-known member
VIP
Yes, that would be possible... You just need to do the math to get the values you desire... The trick is that you need both studies combined or reference each study in order to do the comparisons...
 

JMath3

New member
VIP
Yes, that would be possible... You just need to do the math to get the values you desire... The trick is that you need both studies combined or reference each study in order to do the comparisons...
Yes, Ive looked at the % manually. I just want to add that to a scanner. What i would like to do is find stocks with Kelt upper or lower outside of BB with a percentage difference of 6% and under.
 
Last edited:

XeoNoX

Well-known member
VIP
can you post a screenshot of what the studies and what they are exactly called in thinkorswim or alternativly you can post the code to the studies you are reffering to as your screenshot doesnt show it.
 

JMath3

New member
VIP
can you post a screenshot of what the studies and what they are exactly called in thinkorswim or alternativly you can post the code to the studies you are reffering to as your screenshot doesnt show it.
These are studies in thinkorswim "Bollinger Bands" and "Keltner Channels". Im not a coder, thats why I'm if I can get some help in setting it up for the scanner.
 

rad14733

Well-known member
VIP
@JMath3 What you are actually looking for is the "squeeze"... The TTM_Squeeze indicator is actually an indicator that monitors the gap created when the Bollinger Bands "squeeze" inside the Keltner Channels... Researching TTM_Squeeze, as well as other scripts promoted by John Carter should yield you some valuable information...
 

XeoNoX

Well-known member
VIP
you stated "how much % gap I want between Keltner Channels and Bollinger Bands" unfortunately there are many bands and you didnt specify what bands you wanted to compare for the gap percent. you will have to pick 2 bands to compare. let me know what you are trying to compare.
 

rad14733

Well-known member
VIP
I was tinkering with Bollinger Bands, Keltner Channels, and TTM_Squeeze today as I considering a visual representation of what a Squeeze actually is and remembered this topic... I believe what @JMath3 is looking for is a percentage measurement of the amount of Squeeze but the problem is in the length of the Squeeze... Taking the length into consideration one would have to sum the values of each band during the Squeeze, average each bangs Squeeze value, find the difference between the Keltner Channels and Bollinger Bands, and then divide the difference by the sum of the Keltner Channels upper and lower band averages... The following is a mathematical example for a single candle... The calculation is based off of a random Squeeze on TLT from yesterday...

Upper KC Price: 157.57
Lower KC Price: 157.28
KC Price Diff: 00.29

Upper BB Price: 157.53
Lower BB Price: 157.32
BB Price Diff: 00.21

KC Price Diff: 00.29
BB Price Diff: 00.21
KC - BB Diff: 00.08

Percent = KC - BB Diff / KC Price Diff = 00.08 / 00.29 = 27.58% GAP

Average of Gap: 00.08 / 00.29 = 27.58% Gap

If someone wants to take the logic and extend it to the entire length of squeezes, go for it... If only the gap between the upper or lower band is desired, it should end up being somewhat close unless there is a great disparity between the upper and lower gaps...
 

XeoNoX

Well-known member
VIP
For the KeltnerChannels there is
KeltnerChannels Avg Band
KeltnerChannels Upper_Band
KeltnerChannels Lower_Band



For the Bollinger Bands there is
Bollinger Bands MidLine
Bollinger Bands LowerBand
Bollinger Bands UpperBand

he didnt state in detail what two data points he was trying to compare for the GAP% ... OP will have to give more details on what he is trying to accomplish.
 

Similar threads

Top