Repaints B4 Balanced BB Breakout For ThinkOrSwim

Repaints
Status
Not open for further replies.
# B4 Scanner # # Free for use. Header credits must be included when any form of the code included in this package is used. # User assumes all risk. Author not responsible for errors or use of tool. # Copyright (c) 2021 B4 Signals # # Get support at: https://b4signals.com # Join us at: https://discord.gg/kD3pKE2CQd # # # v3.0 - barbros / chuck - official release ### MACDBB input MACDBB_FastLength = 12; input MACDBB_SlowLength = 26; input MACDBB_BandLength = 15; input MACDBB_NumDev = 1.0; def MACDBB_Data = MACD(fastLength = MACDBB_FastLength, slowLength = MACDBB_SlowLength, MACDLength = 5); def MACDBB_Upper = reference BollingerBands(price = MACDBB_Data, length = MACDBB_BandLength, Num_Dev_Dn = -MACDBB_NumDev, Num_Dev_Up = MACDBB_NumDev).UpperBand;; def MACDBB_Lower = reference BollingerBands(price = MACDBB_Data, length = MACDBB_BandLength, Num_Dev_Dn = -MACDBB_NumDev, Num_Dev_Up = MACDBB_NumDev).Lowerband; def MACDBB_Buy = MACDBB_Data > MACDBB_Upper; def MACDBB_Sell = MACDBB_Data <= MACDBB_Lower; ### RSI/STOCASTIC/MACD CONFLUENCE COMBO def RSM_MACD_Diff = reference MACD(fastLength = 12, slowLength = 26, MACDLength = 9).Diff; def RSM_MACD_ZeroLine = 0; def RSM_RSI = reference RSI(length = 7).RSI; def RSM_Stoch_Val = 100 * (close - lowest(low, 14)) / (highest(high, 14) - lowest(low, 14)); def RSM_StochSlowK = SimpleMovingAvg(SimpleMovingAvg(RSM_Stoch_Val,3),3); def RSM_rsiGreen = RSM_RSI >= 50; def RSM_rsiRed = RSM_RSI < 50; def RSM_stochGreen = RSM_StochSlowK >= 50; def RSM_stochRed = RSM_StochSlowK < 50; def RSM_macdGreen = RSM_MACD_Diff >= 0; def RSM_macdRed = RSM_MACD_Diff < 0; def RSM_Buy = RSM_rsiGreen and RSM_stochGreen and RSM_macdGreen; def RSM_Sell = RSM_rsiRed and RSM_stochRed and RSM_macdRed; ### RSI IFT def RSI_IFT_R = reference RSI(5, close) - 50; def RSI_IFT_AvgRSI = MovingAverage(AverageType.Exponential,RSI_IFT_R,9); def RSI_IFT_InverseRSI = (Power(Double.E, 2 * RSI_IFT_AvgRSI) - 1) / (Power(Double.E, 2 * RSI_IFT_AvgRSI) + 1); def RSI_IFT_Direction = if BarNumber() == 0 then 0 else if (RSI_IFT_InverseRSI[1] > 0) and (RSI_IFT_InverseRSI < 0) then -1 else if (RSI_IFT_InverseRSI > 0) and (RSI_IFT_InverseRSI[1] < 0) then 1 else RSI_IFT_Direction[1]; ### Fibonacci SuperTrend input FST_Length = 11; input FST_Retrace = 23.6; input FST_UseHighLow = yes; def FST_h = if FST_UseHighLow then high else close; def FST_l = if FST_UseHighLow then low else close; def FST_minL = Lowest(FST_l, FST_Length); def FST_maxH = Highest(FST_h, FST_Length); def FST_hh = if FST_h > FST_maxH[1] then FST_h else FST_hh[1]; def FST_ll = if FST_l < FST_minL[1] then FST_l else FST_ll[1]; def FST_trend = if FST_h > FST_maxH[1] then 1 else if FST_l < FST_minL[1] then -1 else FST_trend[1]; def FST_Direction = if BarNumber() == 0 then 0 else if FST_trend != 1 then -1 else if FST_trend == 1 then 1 else FST_Direction[1]; ### Strategy input BullBear_Include_FST = yes; #hint BullBear_Include_FST: Include Fibonacci SuperTrend in the vertical line strategy input BullBear_Include_RSI_IFT = yes; #hint BullBear_Include_RSI_IFT: Include RSI IFT in the vertical line strategy def BullBear_Buy = (!BullBear_Include_FST or FST_Direction == 1) and (!BullBear_Include_RSI_IFT or RSI_IFT_Direction == 1); def BullBear_Sell = (!BullBear_Include_FST or FST_Direction == -1) and (!BullBear_Include_RSI_IFT or RSI_IFT_Direction == -1); def Strategy_Buy = BullBear_Buy and MACDBB_Buy and RSM_Buy; def Strategy_Sell = BullBear_Sell and MACDBB_Sell and RSM_Sell; plot StrategyArrow = if Strategy_Buy and !Strategy_Buy[1] then 1 else if Strategy_Sell and !Strategy_Sell[1] then -1 else 0; plot TrendDirection = if MACDBB_Data > MACDBB_Data[1] and MACDBB_Data >= MACDBB_Upper then 2 else if MACDBB_Data < MACDBB_Data[1] and MACDBB_Data >= MACDBB_Upper then 1 else if MACDBB_Data < MACDBB_Data[1] and MACDBB_Data <= MACDBB_Lower then -2 else if MACDBB_Data > MACDBB_Data[1] and MACDBB_Data <= MACDBB_Lower then -1 else 0;
Hi Chuck, thank u for sharing this study. After i copy & paste the code onto the tos study scan, i kept getting the message "Exactly one plot expected" & i could not seem to save the study. any idea what could possibly be the reason?
 
Hi Chuck, thank u for sharing this study. After i copy & paste the code onto the tos study scan, i kept getting the message "Exactly one plot expected" & i could not seem to save the study. any idea what could possibly be the reason?
Hi Vicky,

When I copy and paste the scanner code from the 1st post in the thread, it works as expected. You are adding it to your studies and not as a custom watchlist column correct (Edit Studies -> Create)? If I recall, the one plot error is usually a watchlist message.
 
Hi Vicky,

When I copy and paste the scanner code from the 1st post in the thread, it works as expected. You are adding it to your studies and not as a custom watchlist column correct (Edit Studies -> Create)? If I recall, the one plot error is usually a watchlist message.
B4_Scan Setup Instructions:
1. Click Create (Create New Study).
2. Remove the default plot statement and paste the code block from B4_SCAN.
3. Save the study with name "B4_SCAN", make sure it is not loaded in your studies on the right, if it is loaded by default when you saved it, please remove we don't need this on chart study.
4. Go to Scan, remove all the filters and add a new filter, select "Study" as a filter, Default study selected will be "ADXCrossOver", Delete it and “Add condition: select study and choose “B4_SCAN” from the list.
5. Once the study is loaded select “StrategyArrow”.
6. The select “is equal to”.
7. Then select “Value” from the pulldown.
8. Select 1, for bullish, and -1 for bearish scan results.
9. If you would like to see bullish and bearish scan results, return to step 6 and select “is not equal to” and select 0.
10. To filter for better scan results, select a default narrowed down list as "Weeklys" under "Scan In, on the scan tab itself.
11. Then, you can save the scan query with a name.
12. Repeat Step 4 to 7, for other scan queries.
13. For best results, please match the chart timeframe to your Scanner Settings for review.
 
Hi Vicky,

When I copy and paste the scanner code from the 1st post in the thread, it works as expected. You are adding it to your studies and not as a custom watchlist column correct (Edit Studies -> Create)? If I recall, the one plot error is usually a watchlist message.
Thank u vhawkx & Chuck for your advice. I know where i got it wrong. All good now. :) cant wait to try.
 
The signals repaint. Watch it live and you'll see what I mean.

You talking about the strategy signals (vertical lines) or the arrows? I've been plotting the strat signals for quite a while and have never seen them repaint. I stopped plotting the arrows, but don't recall them repainting after the close of the current candle.
 
You talking about the strategy signals (vertical lines) or the arrows? I've been plotting the strat signals for quite a while and have never seen them repaint. I stopped plotting the arrows, but don't recall them repainting after the close of the current candle.
Right, I think in all the 40 plus pages of posts, someone would have already mentioned that it repaints. That's usually one of the first things that is commented on with repainting indicators.
 
Right, I think in all the 40 plus pages of posts, someone would have already mentioned that it repaints. That's usually one of the first things that is commented on with repainting indicators.
This actually does not repaint but what it does when you are watching it live is it throws a signal if it doesnt go the same direction in the next bar it does erase that signal n replaces it with either a Red bar etc. Its not necessarily repainting but because you are using this on a 1min chart it is the behavior of the script reacting to the actions on the market. I would recommend using this on a 3m or 5min chart or even a 10min chart it is far more accurate. I am really not sure of many people who can trade on the 1min n be succesful but there might be some. Repainting is when it goes back and erases a signal or when it spits out a signal and another signal comes it removes the first n keeps the latest. This script does not do that.
 
New addition to the B4 family. This was requested by a B4 user. It shows the squeeze in a watchlist column.

Code:
# B4 Watchlist Column for Squeeze
#
# Free for use. Header credits must be included when any form of the code included in this package is used.
# User assumes all risk. Author not responsible for errors or use of tool.
# Copyright (c) 2021 B4 Signals
#
# Get support at: https://b4signals.com
# Join us at: https://discord.gg/kD3pKE2CQd
#
#
# v1.0 - barbros / chuck - official release

def STOCHSCALPER_oSS = (open[1] + close[1]) / 2;
def STOCHSCALPER_hSS = Max(high, close[1]);
def STOCHSCALPER_lSS = Min(low, close[1]);
def STOCHSCALPER_cSS = (STOCHSCALPER_oSS + STOCHSCALPER_hSS + STOCHSCALPER_lSS + close) / 4;

def STOCHSCALPER_mean = Average(STOCHSCALPER_cSS, 20);
def STOCHSCALPER_sd = StDev(STOCHSCALPER_cSS, 20);
def STOCHSCALPER_atr = Average(TrueRange(STOCHSCALPER_cSS, STOCHSCALPER_hSS, STOCHSCALPER_lSS), 20);
def STOCHSCALPER_squeeze = if (STOCHSCALPER_mean + (2 * STOCHSCALPER_sd)) < (STOCHSCALPER_mean + (1.5 * STOCHSCALPER_atr)) then yes else no;

AddLabel(yes, if STOCHSCALPER_squeeze then "SQZ" else "", if STOCHSCALPER_squeeze then Color.WHITE else Color.CURRENT);
 
A lot of new things on the horizon!!!! The B4 is improving day by day, potentialy have some tried and tested improvements about to be released as well as collaboration. Thank you all for all the tremendus Support. Dont worry, you guys acting as Resistance play a part too, we see both with B4, It's all part of navigating the waters. Happy trading, be on the lookout!!! We truly appreciate you all.
 
A lot of new things on the horizon!!!! The B4 is improving day by day, potentialy have some tried and tested improvements about to be released as well as collaboration. Thank you all for all the tremendus Support. Dont worry, you guys acting as Resistance play a part too, we see both with B4, It's all part of navigating the waters. Happy trading, be on the lookout!!! We truly appreciate you all.
Hey Chuck, great work on the B4, thank you for sharing, I'm looking forward to future releases... This indicator is now part of my everyday trading adventure... :)

Quick question, I like the MACDBB line a little faster so I changed the settings to 6,13,5 in the "settings" section... is there any way to have the "histogram" also change to these settings? I had to go into the code to change this line to reflect the new settings....

plot RSM_MACD_Diff = reference MACD("fast length" = 12, "slow length" = 26, "macd length" = 9).Diff;

Thanks again for all your hard work.... and I'm still just a "lurker" on your Discord channel.... :)
 
Hey Chuck, great work on the B4, thank you for sharing, I'm looking forward to future releases... This indicator is now part of my everyday trading adventure... :)

Quick question, I like the MACDBB line a little faster so I changed the settings to 6,13,5 in the "settings" section... is there any way to have the "histogram" also change to these settings? I had to go into the code to change this line to reflect the new settings....

plot RSM_MACD_Diff = reference MACD("fast length" = 12, "slow length" = 26, "macd length" = 9).Diff;

Thanks again for all your hard work.... and I'm still just a "lurker" on your Discord channel.... :)

Thanks for using B4!!! We truly hope you are benefitting from using it. I have adjusted the settings myself while tweaking B4's performance, in relation to that we also are testing different types of histograms, as we constantly test and strive to make more improvements. But just to be on the safe side I will let @barbaros, (the resident genius) comment on your modifications. Maybe he can give you better insight than this country bumpkin can....LOL.......Give him a little time, he's on a tight schedule.
 
Hey Chuck, thanks for getting back to me so quickly... :) I'll just continue with the way I'm doing it, which isn't a problem.... I'm excited about future releases.... Great work!!!!
 
@Chuck Thank you for so much for such a fascinating indicator, I am currently doing some backtesting combining the B4 indicator with the Consensus candles created by @Christopher84 and its incredible how accurate both of them are when used in tandem for entries and exits

I did have a question and I was hoping you could perhaps help me clarify some questions I had about the labels (I apologize if this was answered in the thread before, I did skim through all the pages of the thread but chances are I might have missed it).

Coming to the question and taking yesterday's TSLA's chart

qc8VRsx.png


The market forecast is bearish but the trend is Bullish and there is a bullish divergence. The Dotted MACDBB is also above the top BB band and green, is this supposed to imply there might be a potential reversal here. I also noticed a yellow cloud between the BB bands and going by one of your points in your first post

  • The MACDBB Cloud in the original version incorporated the use of Keltner Channel to determine a squeeze, the newer versions employ a stocastic squeeze. A yellow (default) cloud will appear on the bands when this condition is meet. Price has a tendency to breakout after a squeeze. This is where I like to be set up waiting for an entry.


I also noticed that the bands are kind of narrow and with the Dotted MACDBB line above the BB lines, this also ties in with another point in the first post in this thread


  • The Bollinger Bands when contracted show an area of consolidation or a point of equilibrium. These levels are often areas of supply and demand or support and resistance. When the band is tight and the MACDBB Dotted Line crosses over the top band It is typically a strong move to the up side, just the opposite in the inverse.

So looking at all of this would you assume that there is a potential reversal possibility here. Obviously how TSLA behaves on Monday would be determined by the broader markets as well but I am trying to understand the labels here better.

8cQtZxQ.png


Even this next chart of the infamous GME has a similar setup as per the B4 indicator though the indicators in consensus candles seem to be negative about it and the overall channel trend is red which gives me pause

Would love to hear your thoughts on this.

@Christopher84 not sure you check this thread but if you do, I would love to hear your thoughts as well.

Have a great long weekend.

Thanks.
 
@Chuck Thank you for so much for such a fascinating indicator, I am currently doing some backtesting combining the B4 indicator with the Consensus candles created by @Christopher84 and its incredible how accurate both of them are when used in tandem for entries and exits

I did have a question and I was hoping you could perhaps help me clarify some questions I had about the labels (I apologize if this was answered in the thread before, I did skim through all the pages of the thread but chances are I might have missed it).

Coming to the question and taking yesterday's TSLA's chart

qc8VRsx.png


The market forecast is bearish but the trend is Bullish and there is a bullish divergence. The Dotted MACDBB is also above the top BB band and green, is this supposed to imply there might be a potential reversal here. I also noticed a yellow cloud between the BB bands and going by one of your points in your first post




I also noticed that the bands are kind of narrow and with the Dotted MACDBB line above the BB lines, this also ties in with another point in the first post in this thread




So looking at all of this would you assume that there is a potential reversal possibility here. Obviously how TSLA behaves on Monday would be determined by the broader markets as well but I am trying to understand the labels here better.

8cQtZxQ.png


Even this next chart of the infamous GME has a similar setup as per the B4 indicator though the indicators in consensus candles seem to be negative about it and the overall channel trend is red which gives me pause

Would love to hear your thoughts on this.

@Christopher84 not sure you check this thread but if you do, I would love to hear your thoughts as well.

Have a great long weekend.

Thanks.
Thanks for using the B4,

The Market Forecast is the Intermediate trend. In your example the longer-term trend is bearish. The shorter-term trend in your chart aggregation period is bullish, that does not necessarily signify a reversal, the market forecast label is there to give you a longer-term forecast.

The Divergence label shows when “certain “, oscillating indicators and price action are out of sync it means that “something” is happening on your charts that could require your attention and it’s not as obvious by just looking price action. Sometimes price moves are made when a divergence is present and signals a chain reaction to price. That’s the reason we included it. Divergences don’t always work, but some traders use that as their edge.

When the dotted MACDBB is above the top BB band and green, that means price is trending bullish just the inverse is true of a bearish trend.

The yellow cloud is a squeeze, we are working in collaboration on an improvement to that as we speak.

When the lines of the BB are consolidated and the squeeze is very high in the overextended area high above the MACDmidline, I find price has a tendency to break down after the squeeze. (not always) I also find the inverse to be true in a lot of cases.


Hope that helps!
 
Thanks for using the B4,

The Market Forecast is the Intermediate trend. In your example the longer-term trend is bearish. The shorter-term trend in your chart aggregation period is bullish, that does not necessarily signify a reversal, the market forecast label is there to give you a longer-term forecast.

The Divergence label shows when “certain “, oscillating indicators and price action are out of sync it means that “something” is happening on your charts that could require your attention and it’s not as obvious by just looking price action. Sometimes price moves are made when a divergence is present and signals a chain reaction to price. That’s the reason we included it. Divergences don’t always work, but some traders use that as their edge.

When the dotted MACDBB is above the top BB band and green, that means price is trending bullish just the inverse is true of a bearish trend.

The yellow cloud is a squeeze, we are working in collaboration on an improvement to that as we speak.

When the lines of the BB are consolidated and the squeeze is very high in the overextended area high above the MACDmidline, I find price has a tendency to break down after the squeeze. (not always) I also find the inverse to be true in a lot of cases.


Hope that helps!
Thank you for taking the time to respond on a Saturday. Much appreciated. Your response does help tremendously. Looking at what you mentioned, there is a small possibility of a reversal but with the market trend being bearish, chances are the reversal will be short (or could swing to the upside strongly but we might need more confirmation on it). I think i'll be better served when the market trend and the trend are both in sync with entering an entry

I am not sure I understood this line (especially the part in bold)

When the lines of the BB are consolidated and the squeeze is very high in the overextended area high above the MACDmidline, I find price has a tendency to break down after the squeeze.

Can you explain a little further, thank you
 
Thank you for taking the time to respond on a Saturday. Much appreciated. Your response does help tremendously. Looking at what you mentioned, there is a small possibility of a reversal but with the market trend being bearish, chances are the reversal will be short (or could swing to the upside strongly but we might need more confirmation on it). I think i'll be better served when the market trend and the trend are both in sync with entering an entry

I am not sure I understood this line (especially the part in bold)

When the lines of the BB are consolidated and the squeeze is very high in the overextended area high above the MACDmidline, I find price has a tendency to break down after the squeeze.

Can you explain a little further, thank you
Meant to say zero line sorry.
 
Status
Not open for further replies.

New Indicator: Buy the Dip

Check out our Buy the Dip indicator and see how it can help you find profitable swing trading ideas. Scanner, watchlist columns, and add-ons are included.

Download the indicator

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
398 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top