Exit Indicators - PercentB

I have been prototyping a PercentB Exit indicator(it provides arrows when various percentage regions on Bollinger bands are crossed). It provides fast signals, but it can take me out of a trade that continues to increase shortly after a small dip. This may be unavoidable, but I thought it best to ask the community if anyone has a reliable method for filtering out false exits?
 
In the Picture below you may notice a lot of arrows are plotted(I have restricted down arrows to above the mid-line and up arrows below)Basically when the percent B crosses the Bollinger bands, midline, or halfway between those lines an arrow is produced indicating the end of the price movement. I need to filter out some of the arrows so that I don't abandon trades too early. This will likely require some sort of moving average cross or requirement of new highs/lows- some kind of filter, but I don't know what that filter needs to be.

This calls tops and bottems well and quicker than anyother indicator Ive seen, but it gives a lot of early signals too that I am hoping to filter at least some out somehow.

Code:
#percentB_Exit
declare lower;

input averageType = AverageType.SIMPLE;
input price = close;
input displace = 0;
input length = 20;
input Num_Dev_Dn = -2.0;
input Num_Dev_up = 2.0;

input Num_Dev_Dn_half = -1.0;
input Num_Dev_up_half = 1.0;


input Hulllength = 9;


def HMA = MovingAverage(AverageType.HULL, price, Hulllength)[-displace];

#HMA.DefineColor("Up", GetColor(1));
#HMA.DefineColor("Down", GetColor(0));
#HMA.AssignValueColor(if HMA > HMA[1] then HMA.color("Up") else HMA.color("Down"));

def upperBand = BollingerBands(price, displace, length, Num_Dev_Dn, Num_Dev_up, averageType).UpperBand;
def lowerBand = BollingerBands(price, displace, length, Num_Dev_Dn, Num_Dev_up, averageType).LowerBand;

def upperBandhalf = BollingerBands(price, displace, length, Num_Dev_Dn_half, Num_Dev_up, averageType).UpperBand;
def lowerBandhalf = BollingerBands(price, displace, length, Num_Dev_Dn_half, Num_Dev_up, averageType).LowerBand;
def PercentB = (price - lowerBand) / (upperBand - lowerBand) * 100;
plot  PercentB_half = (price - lowerBandhalf) / (upperBandhalf - lowerBandhalf) * 100;
plot ZeroLine = 0;
plot HalfLine = 50;
plot UnitLine = 100;
plot twenty5 = 25;
plot seventy5 = 75;

#PercentB.SetDefaultColor(GetColor(1));
#PercentB.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
#PercentB.SetLineWeight(1);
#ZeroLine.SetDefaultColor(GetColor(8));
#HalfLine.SetDefaultColor(GetColor(8));
#UnitLine.SetDefaultColor(GetColor(8));

plot reboundUp =  (PercentB[1] <= ZeroLine) and (PercentB > ZeroLine) or (PercentB[1] <= HalfLine) and (PercentB > HalfLine) or (PercentB[1] <= twenty5) and (PercentB > twenty5) and (Price[1] <= HMA[1]) and (PercentB[1] <= HMA[1]);

#(PercentB[1] <= UnitLine) and (PercentB > UnitLine) or (PercentB[1] <= seventy) and (PercentB > seventy)

reboundUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
reboundUp.SetLineWeight(1);
reboundUp.SetDefaultColor(Color.GREEN);

plot reboundDown = (PercentB[1] >= HalfLine) and (PercentB < HalfLine) or (PercentB[1] >= UnitLine) and (PercentB < UnitLine) or (PercentB[1] >= seventy5) and (PercentB < seventy5) and (Price[1] >= HMA[1]) and (PercentB[1] >= HMA[1]);

#(PercentB[1] >= twenty5) and (PercentB < twenty5) or (PercentB[1] >= ZeroLine) and (PercentB < ZeroLine) or

reboundDown.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
eF13HoI.png
[/IMG]
 
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

@Bladeof300 It might help you to review the Basics of a Good Strategy. The use of additional indicators and multiple-time frames are designed to help weed out false signals such as you describe.

Also, did you develop your strategy based on any of the established strategies out there? I googled trading with percent b. It brought up a plethora of ideas for reducing the false signals that seem to be associated with this indicator. Did you try them and false signals persisted?

The %B strategy on the StockCharts site combines it with the TOS money flow indicator as the basis for its strategy. It then adds some of the common indicators such as TOS MACD or others for use in confirming direction of the emerging trend to weed out false signals. It goes further to suggest that the use of the TOS ADX for confirmation of signal. In its conclusion, the site states that the indicator on its own is problematic but applied in a proper strategy, it is not useless:
044TyfQ.png
 
Last edited:
@Bladeof300 It might help you to review the Basics of a Good Strategy. The use of additional indicators and multiple-time frames are designed to help weed out false signals such as you describe.

Also, did you develop your strategy based on any of the established strategies out there? I googled trading with percent b. It brought up a plethora of ideas for reducing the false signals that seem to be associated with this indicator. Did you try them and false signals persisted?

The %B strategy on the StockCharts site combines it with the TOS money flow indicator as the basis for its strategy. It then adds some of the common indicators such as TOS MACD or others for use in confirming direction of the emerging trend to weed out false signals. It goes further to suggest that the use of the TOS ADX for confirmation of signal. In its conclusion, the site states that the indicator on its own is problematic but applied in a proper strategy, it is not useless:
044TyfQ.png


FYI, for future reference, it is proper forum etiquette to research your question before posting to the forum. There are several sites on the internet besides the one that I highlighted that turned up similar answers to your question and emphasizes the weaknesses of this indicator as anything other than a confirming signal in an otherwise established strategy.

The two biggest indicators of whether a retail investor will be successful are the ability to do research and the ability to apply that research. HTH
Thank you, for your help. This will be a huge help in developing an exit strategy
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
295 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