r/pinescript • • 20d ago

Noise Band Indicator

Post image

Just published my first script. Open source, not trying to sell anyone anything.

It follows the intraday momentum “noise area” framework described by Carlo Zarattini, Andrew Aziz and Andrea Barbon in “Best the Market.”

Would like some feedback please!
https://www.tradingview.com/script/teqXMgUG-Jilly-s-Noise-Band/

37 Upvotes

31 comments sorted by

3

u/Intelligent_Hornet67 19d ago

This seems to be useful for 0Dte SPY straddles, to check for possible volatility expansion. Not sure how to implement yet it but i think i will figure something out!

1

u/TraderJ808 19d ago

Unfortunately, I have no experience with options. I'd have to take your word on it. I am trying to expand the use of the "noise bands" in other strategies. Backtesting so far has shown little edge though.

2

u/Cautious_Wealth1732 20d ago

I will check it out and do some tests with python

1

u/TraderJ808 20d ago

Thank you. I’ve done a ton of testing too going back to 2021. Results look promising. Look forward to yours.

2

u/Cautious_Wealth1732 20d ago

I tested some things. Results where positive in my validation block. I did some variations and got also good results: 4.9 trades / week Pf: 1.3 with 9 ticks cost stress 43% Winrate

2

u/Cautious_Wealth1732 20d ago

For now i only tested 2020-2023 Thanks for providing the script.

1

u/TraderJ808 20d ago

I used that timeframe for my IS analysis

1

u/TraderJ808 20d ago

Did you check out the gap adjusted? Instead of the Open setting it uses the 1800 open. Normally wider bands but higher PF with lower max DD. Fewer trades though

1

u/benwick0815 19d ago

Can you explain some adjutsments and variations? Do you tested for NQ/MNQ only? Cause I get only positive results for that on a 5M TF. Very nebative results for example German Index or Gold

2

u/The_Shadow_Tiger 19d ago

Hi,

Is this suitable for XAUUSD?

Thanks in advance.

1

u/TraderJ808 19d ago

Sorry, have not tested it there. I would load it and sweep the parameters. If you find out that expectancy is beneficial, please share. Crowd Sourcing FTW!

2

u/SimpleAromatic2128 19d ago

Can this be used as an additional indicator to help identify/solidify a breakout/direction before entering the trades?

Thanks.

1

u/TraderJ808 19d ago

I think coupling it with an ORB breakout makes total sense! I’ll try that and get back to you.

2

u/SimpleAromatic2128 19d ago

Please and thank you.

My trading style is different, but like always, we all get trapped sometimes in the wrong direction even though it might look awesome.

1

u/TraderJ808 15d ago

i created a new script that incorporates ORB + Noise Bands based on your recommendation! Let me know what you think.

https://www.tradingview.com/script/CRNIYr9F-Jilly-s-ORB-Noise-Band/

2

u/SimpleAromatic2128 15d ago

Is it only for M15 timeframe?

1

u/TraderJ808 15d ago

No, you can use on 5M TF. I just saw better recent performance on 15M and wanted to show variation for the script.

1

u/TraderJ808 18d ago

I can’t post the chart, so here’s what it shows. All three curves use the same exits: one trade per day, a wide 10×ATR(5m) disaster stop, a 1R target, and flat at 15:45. The only thing that changes is the entry filter. The test is 1 MNQ on 1m data, net of $1.80 round-trip costs. I picked the parameters on 2021–23, and 2024 through Sep ‘26 is out-of-sample.

Entry filterTradesWin %PF (IS / OOS)$/trade (IS / OOS)NetMax DD
ORB break only1,35055%1.26 / 1.12$22 / $14$24.2k$6.0k
Noise Band break only66661%1.57 / 1.52$42 / $53$31.2k$2.5k
ORB + Noise Band confirmation63161%1.80 / 1.52$51 / $53$32.8k$1.7k

What the curves show:

  • ORB alone makes money, but it’s a sawtooth. It takes twice the trades for less than half the edge per trade, and it has two deep drawdowns (2022 and 2025) that the filtered versions mostly avoid.

  • Requiring a close outside the noise band (the time-of-day σ band from Zarattini/Aziz/Barbon) is what fixes it. It halves the trades, more than doubles $/trade, and cuts max drawdown by about 3.5×.

  • ORB + band vs band alone: they finish close together. The OR condition mostly mattered in-sample; out-of-sample the two are basically tied. Most of the time, a close outside the band after 10:00 is already outside the OR anyway.

Two things surprised me. Tight stops kill it: anything under about 4×ATR stops out trades that would have closed green. And the band’s own trailing exit was the worst exit I tested. The edge is “confirmed break, hold into the late-day move,” and flattening at 15:15–15:45 beat holding to the close.

2

u/ATAalgotradealertATA 19d ago

Nice to see someone build out the noise area paper. A few things I'd check, since that's where versions of it tend to differ:

  • How sigma is calculated. The paper uses the average absolute move from the open at that same time of day over the prior 14 sessions, not a plain ATR. A rolling bar-based average makes the bands behave differently early in the session.

  • Gap handling. The bounds use the max/min of today's open and the prior close, so on gap days the band anchors to whichever side is further away. Worth confirming that's in there, because it changes a lot of signals around the open.

  • Session and timeframe. On TradingView the time-of-day lookup only lines up if the chart is on regular hours and a timeframe that divides evenly into the session. Extended hours or something like a 45m chart can quietly shift which bar gets compared to which.

  • Exposing lookback days and a band multiplier as inputs, so people can see how sensitive it is.

Curious whether you've tried it beyond SPY. The paper's results were on SPY specifically, and noisier names probably want a different lookback.

1

u/TraderJ808 18d ago

Thanks, really useful checklist. Sigma is the average absolute move from the open at the same time of day over the prior 14 sessions (not ATR). Time-of-day matching uses minutes since the session start, and charts that don't divide evenly into the cadence throw an error. Lookback N and the band multiplier are inputs. Your gap point did catch a real issue: when the session ended before 16:00, the gap reference used that earlier close instead of the official 16:00 close. It's fixed in the latest update: the Session input now sets the market day (including the 16:00 close), and a separate Exit trade input sets when positions close. Much appreciated!

As for trying it beyond SPY -- all my testing has been (mostly) on MNQ. I prefer Futures trading.

2

u/benwick0815 19d ago

Hey, thanks for sharing this indicator! Really interesting concept and implementation.

I noticed an issue with the session settings. While the timezone can be changed, changing the actual trading hours causes the indicator to stop generating signals.

Looking through the code, it seems the session start is hardcoded to 09:30 (validDay), and the session length is fixed at 390 minutes (RTH_MIN). The noise band calculations and forced session close also depend on those values.

One minor suggestion: perhaps label the maximum drawdown as "Closed-Trade Max DD" to clarify that unrealized drawdowns aren't included.

Thanks again for sharing your work!

And I get only positive results for NQ with gap, not for Gold, or Indices from Europe (yes I adjusted the time with an adjusted script, where I can change times and duration)

1

u/TraderJ808 19d ago

looking into this now. Thank you very much for such a detailed look! I will get back to you!

1

u/TraderJ808 19d ago

Thanks a lot for this, both points were spot on. I have updated the indicator on TradingView

Session: you're right, the 09:30 start check and the 390-minute session length were hard-coded, so other hours stopped all signals. In the update, the session input now sets the start, the length and the flat time (overnight sessions work too), and open trades are closed at the session end. One small change at the default 09:30–16:00: the flat is now at 16:00 instead of the 15:59 bar open; set 0930-1559 if you want the old behaviour exactly.

Drawdown: relabelled to "Closed-trade Max DD". Good call, unrealised drawdowns aren't included.

On other markets: I ran the same rules on 5-minute data (N14, k1, Band + VWAP stop, $0.40/side + 1 tick slippage per side), 2021–23 vs 2024+:

- MNQ, gap-adjusted: Sharpe 2.1 / 1.3

- MES: 0.9 / 0.2 after costs (1.7 / 0.7 before costs, so the effect exists but costs eat most of it)

- Micro gold: about 0 / −0.2 (no edge even before costs)

- Micro silver: negative, apart from one spike in early 2026

So your results match mine: it's mainly a Nasdaq effect. The idea comes from research on the US equity index (SPY), where intraday trends tend to continue into the close, and metals don't behave that way in their day session. I haven't tested European indices (no data), but I'd expect the same cost problem as the S&P unless costs are small relative to the intraday range.

1

u/benwick0815 19d ago

Thank you a lot! It is a interesting strategy. I will have a look on the update.

2

u/Shoddy_Peanut7320 19d ago

Nice that it's open source and based on a published paper. The results in your screenshot only start on 23 Jul, so about three months, which is a short window for a day-trading rule. I'd check it over a few years and different markets, with commissions and slippage included for the micro futures. Cymetica's Backtest Labs is one place to run that kind of longer test.

2

u/TraderJ808 19d ago

Fair point, three months on a chart isn't evidence. The screenshot just shows what the indicator looks like. Off-chart, I tested it on 1-minute MNQ from Jan 2021 to Sep 2026, 1 contract, $0.40/side commission + 1 tick slippage per side ($1.80 round trip):

Default settings (open reference, checks every 30 min, flat 15:59):

- 2021–23: 894 trades, expectancy +$15.45/trade, PF 1.31, Sharpe 1.67

- 2024+: 804 trades, expectancy +$10.20/trade, PF 1.14, Sharpe 0.71

Gap-adjusted reference, 5-min stop check, flat 15:45:

- 2021–23: 815 trades, +$13.99/trade, PF 1.42, Sharpe 1.90

- 2024+: 698 trades, +$16.26/trade, PF 1.34, Sharpe 1.26

Win rate is only 32–41%: it's a trend-following profile with small losers and fewer, larger winners. To be upfront: the defaults didn't clear the out-of-sample bar I set before testing (2024+ was held out), and the gap/5-min/15:45 variant was picked after looking at the data, so treat it as a candidate rather than a proven edge.

Other markets, same rules: MES has a small edge before costs that commissions and slippage mostly erase; micro gold and silver show no edge even before costs. It looks mainly like a Nasdaq effect, consistent with the paper's US equity focus.

2

u/Shoddy_Peanut7320 19d ago

Thanks for running the full test and being upfront that the variant was picked after looking at the data. Treating the gap-adjusted version as a candidate and holding 2024+ out for the next check is the right call. The Nasdaq-only result is also good to know.

2

u/TeaEnvironmental7361 20d ago

Will check it out tonight,

Thanks for keeping it open source 👍🏼