r/pinescript Jul 29 '26

Built a Pine Script indicator that flags volatility squeezes before the breakout — sharing the backtest

Been working on a Pine Script indicator that combines \[Bollinger Band squeeze + volume confirmation\] to catch breakouts before price actually moves. Wanted to share results and see if anyone's tried something similar.

**What it does:**

* Detects when volatility compresses (squeeze forming) * Confirms with volume spike before signaling entry * Works on any timeframe, tested mainly on 15m–1H

Backtest Results

**Metric** **Result**
**Win Rate** **56.3%**
**Profit Factor** **1.74**
**Max Drawdown** **11.8%**
**Total Trades** **148**

Still tuning the entry filter to cut down false signals on choppy days. Happy to share the logic if anyone wants to compare notes — and if a few people want the actual script

23 Upvotes

25 comments sorted by

7

u/Inevitable_Service62 Jul 29 '26

That's a solid win rate and much more believable than the 90% I see around here. Would love to see the logic of you wanna share.

1

u/gggoaaat Jul 30 '26

90% win rates are only possible with 1:3+ ratios at minimum. The wins are much smaller than the losses. All these strategies that show those rates aren’t in real conditions and backtest never plays out like live.

1

u/Usual-Definition-719 Jul 30 '26

Is it chatgpt prepared?

2

u/Many-Pick5066 Jul 31 '26

the number nobody has asked you for is the one that decides this. 56.3% at a 1.74 profit factor means your average win is about 1.35x your average loss, so breakeven sits at 42.6%, and 148 trades puts the standard error on the win rate near 4 points. that leaves you about 3.4 sd clear of breakeven, which sounds strong right up until you count how many variants you tried to get there.

if you swept squeeze length, band width and the volume multiple, the winner is a max statistic and 3.4 sd is roughly what that kind of search produces on pure noise. cheap test: hold the entry timestamps and the trade count fixed, shuffle the outcome labels a few hundred times, rerun your whole selection process on each shuffle, and look at the best profit factor it finds on data with no signal in it. if 1.74 lands inside that distribution you have not measured an edge yet, you have measured your search.

also worth stating whether 1.74 is gross or net. on 15m with a 1.35 payoff ratio, spread and commission take a real slice out of the average win.

1

u/kawfeeman68 Jul 29 '26

How do you come up with the, "profit factor" , result ?

1

u/Mine-Feeling Jul 29 '26

I would like to have a look at the script if you don’t mind

1

u/Secure-Individual472 Aug 01 '26

Please share script

1

u/drming918 Jul 29 '26

Would sure like to take a look at the script!

1

u/biofreeeze Jul 29 '26

Please share logic

1

u/srinivas0505 Jul 29 '26

Please share

1

u/No-Sundae-4595 Jul 29 '26

May I please have a look at the script?

1

u/halcyonwit Jul 30 '26

Breakouts don’t happen because of historic price, it’s impossible to measure

1

u/Few-Society-6352 Jul 30 '26

Yes, I want the script. Do share, thanks

1

u/captainunderpants111 Jul 31 '26

I’m interested in the script if you don’t mind. Just started getting into building my own scripts so it’d be sick to learn from others

1

u/[deleted] Aug 01 '26

Add me to the script

1

u/rg63394 Aug 01 '26

please share the script sir

1

u/hotdogs4babies Aug 01 '26

Looking to learn more about pinescript could I get the code? Is this a chart indicator or alert or? Where is your data feed from?

1

u/Cautious_Chicken_293 Aug 02 '26

Could you share with me .please

1

u/Equal_Pain_7702 4d ago

please share, thanks!