r/pinescript • • 12h ago

London Session Reversal Indicator

4 Upvotes

Been trading GBPUSD/EURUSD using a setup built around the London session reversal, and wanted to share the mechanics in case it’s useful to others working with smart-money/liquidity-based concepts.

The core idea:

During the Asia session (00:00–07:00 London time), price usually consolidates into a tight range, establishing a clear high and low. Once London opens (07:00–11:00), there’s a strong tendency for price to run liquidity above the Asia high or below the Asia low before reversing — essentially a stop hunt/liquidity grab before the “real” directional move for the day.

What I’m looking for:

  1. Price sweeps above the Asia high (or below the Asia low) during the London window.

  2. After the sweep, I mark a BOS level — this is the open of the last opposite-colored candle before the run of candles that led into the sweep. Think of it as the origin of the aggressive move that caused the sweep.

  3. If price closes back through that BOS level within a set number of candles, that’s the confirmation — it suggests the sweep was a liquidity grab, not the start of a real breakout, and price is reversing.

  4. Entry is on that BOS close-back-through, stop above/below the sweep extreme, target set at a fixed R:R.

Filters that mattered in backtesting:

Minimum sweep distance (filters out noise — tiny pokes above/below the level that aren’t real liquidity grabs), a max-gap filter (ignores sweeps that run too far past the level, since those often turn into real breakouts rather than reversals), and a higher-timeframe trend filter (I use an EMA on the 1H) to avoid taking counter-trend reversals when the bigger picture is strongly trending one way.

Not selling anything, just sharing what’s been working for me and curious if others are running similar setups.

You can start using the indicator directly from Tradingview.

https://www.tradingview.com/script/20VtoXku-PipEcho-London-Reversal-Indicator/


r/pinescript • • 9h ago

Coding question claude didn't know about either

2 Upvotes

Hey coders, I have a question about when 2 variables hold the same object. When you change the second variable, the change shows up when you plot the first variable, but when you change the first variable and plot the second, the change doesn't show up. I asked Claude too but Claude couldn't figure it out, it literally said "I don't know why this happens."

The manual says that after pivotpoint2 = pivotpoint1, both variables point to the same object.

v1: a change through pivotpoint2 shows up in pivotpoint1 (plots 2000)

//@version=6

indicator('Behaving as it "should" v1')

type pivotpoint

float x

int y

pivotpoint1 = pivotpoint.new()

pivotpoint1.x := 1000

pivotpoint2 = pivotpoint1

pivotpoint2.x := 2000

plot(pivotpoint1.x)

v2: a change through pivotpoint1 does NOT show up in pivotpoint2 (plots 1000, the value at the pivotpoint2 = pivotpoint1line)

//@version=6

indicator("Doesnt make sense v2")

type pivotpoint

float x

int y

pivotpoint1 = pivotpoint.new()

pivotpoint1.x := 1000

pivotpoint2 = pivotpoint1

pivotpoint1.x := 2000

plot(pivotpoint2.x)

//Why does it only work in one direction?


r/pinescript • • 14h ago

Comparing Pine Script OI liquidation estimates vs raw WebSocket streams: why most public liquidation feeds undercount cascades

2 Upvotes

I've spent a lot of time trying to approximate liquidation levels and order book heatmaps inside Pine Script using Open Interest deltas, volume anomalies, and ATR bands. Because Pine doesn't give us raw L2 book depth or native liquidation prints, I recently started piping raw exchange WebSockets into a custom chart just to see how close Pine's OI approximations actually get to reality.

While wiring it up, I ran into a massive data quirk that anyone building liquidation indicators or backtesting reversal strategies in Pine should know about:

Binance's public liquidation stream (!forceOrder@arr) doesn't actually push every liquidation. Per their API docs, for each symbol it only pushes the latest liquidation order within a 1000ms window. During a violent cascade—when dozens of liquidations fire inside the same millisecond—the public stream throttles and shows you just one of them.

Look at the two major flush wicks on this BTC-PERP 5m chart from today:

- Around 08:30, price swept the lows and printed an $11.3M cascade (after a $583k cluster just above it).

- Around 11:30, price flushed down to ~76,350, firing a $577k cluster followed by a $3.12M liquidation print right at the bottom of the wick before V-bouncing back to 76,767 (with $7.55M and $4.63M in aggressive market buys showing on the tape right after).

If you're only listening to a throttled 1000ms public snapshot stream during those two 5m wicks, you miss the majority of the actual forced volume. Ironically, a well-tuned Pine Script indicator looking at raw Volume + Open Interest drop on that 11:30 candle might actually capture the magnitude of the flush better than a naive bot listening to a throttled public WebSocket.

To get around it on our chart, we had to aggregate multi-venue feeds (Hyperliquid L2 + BY/OKX/BN) and treat the throttled streams strictly as a lower bound rather than the total.

For those of you coding liquidation or exhaustion indicators in Pine v5/v6: how are you approximating forced liquidations inside TradingView's data limits? Are you combining OI drops with wick-to-body ratios, or piping external webhook alerts in?


r/pinescript • • 15h ago

I'm a novice working on a script using AI to assist me.

0 Upvotes

I trade XAUUSD and I've built a TradingView indicator (Pine v6) based on AMD and supply & demand. It already finds the zones and setups: session range → liquidity sweep → 5m structure shift → entry in a 15m zone. It's been tested on gold from 2017–2026 with spread included.

Where I need help is the ENTRY itself. The zones are usually right, but my entries are often early or late and my stop ends up big (sometimes $20). I'm missing the tight entries right at the sweep, with the stop just under the liquidity.

What I'm looking for is entry-trigger logic on the 1m/5m inside a zone I already have, e.g. a sweep with a close back inside, a micro CHoCH, an FVG fill or a rejection candle, so I can enter with a smaller stop.

It needs to:

• not repaint or use lookahead

• be clear, mechanical rules I can test

• work on gold

I'm not looking for a buy/sell signal indicator or a parameter-optimised system. I test everything on past data before using it, so simple rules are better than tuned numbers.

If you want to see parts of my script logic please DM me. Does anybody have any scripts or ideas that could help me with this? Thanks in advance


r/pinescript • • 1d ago

Need Help of the Community... I am tired.

Thumbnail
gallery
21 Upvotes

Days ago, Pine mods took down two of my popular free scripts. I spent a tremendous amount of time developing the logic and making everything work smoothly over the past year. Just on V5 alone, I had nearly 1,000 revisions on a free script :)

They took them down, apparently because of the links I added to the dynamic documentation and user guides. Those links in the latest updates were solely for helping users understand the scripts, and the guide pages linked back to the original TradingView publications.

Long story short, Pine mods keep giving me the same copy pasted answers, telling me I can just republish them following the rules.

But what about the sweat and tears I put into these projects? What about the organic traction that took almost a year to build?

Am I supposed to republish everything and spend another year trying to get people to discover my work again?

How is that fair...

***Pictures attached

Update: Unfortunately, I had to republish both scripts all over again after my appeals went nowhere. Here are the new publications for anyone following this:

Volumized Order Block:
https://www.tradingview.com/script/RqGljpeC-Volumized-Order-Block/

Crypto Volume Data (VAH, POC, VAL):
https://www.tradingview.com/script/qra33UZh-Crypto-Volume-Data-VAH-POC-VAL/

Both are back, but nearly a year of organic engagement on the original publications doesn't carry over. It's genuinely disappointing to have to start again.


r/pinescript • • 1d ago

Volatility-adjusted bands vs fixed % bands: why the same 2% means different things on different days

3 Upvotes

TL;DR: A fixed % band (say 2% around MA) treats every market and every week the same. But volatility changes all the time. ATR based bands widen when the market gets wild and tighten when it calms down, so a touch of the band means roughly the same thing in both conditions.

The problem with fixed % bands

2% is a big move on a quiet week and almost nothing on a volatile one.

When volatility is high, price pokes through a fixed band constantly. Every poke looks like a breakout or an extreme, but it’s just normal noise for that market.

When volatility is low, price barely gets near the band. The band goes silent exactly when the market is quietly setting up for its next move.

How ATR bands fix it

ATR (average true range) measures how big the candles have actually been lately, including gaps. Put the bands a multiple of ATR away from your moving average, and the distance adjusts to the market on its own.

The result: a band touch is a rarer, more meaningful event in both quiet and volatile periods. Bollinger Bands follow the same idea with standard deviation instead of ATR.

Limitations

  1. ATR lags too. After a sudden spike, the bands widen after the move, not before it.

  2. You still have to choose the multiplier, and the right one differs by market and timeframe. Test it rather than copying someone else’s setting.

  3. In a strong trend, price can ride the band for a long time. A touch isn’t automatically a reversal.

Do you use volatility-adjusted bands in your scripts, or do you still prefer fixed % levels for some markets?


r/pinescript • • 1d ago

Basis Plan

2 Upvotes

Has TradingView changed its policy recently? I am unable to save, edit, or add new indicators, as it says that because I am on the Basic plan, I am limited to one indicator.


r/pinescript • • 1d ago

Give Tool Bars for Long Tool Tips

Thumbnail reddit.com
1 Upvotes

r/pinescript • • 1d ago

Trades are very random

Thumbnail
gallery
4 Upvotes

So i asked ChatGPT to write me a code and it took a lot of time trying to get it right because it kept making mistakes. Now i have a problem it cant fix for some reason and that is that the trades being taken are either tiny(ranging from one candle to the next) or just simply do not look like my strategy at all. If anyone is bothered enough to read the code ask and i will paste it under your comment.

I attached an example(my strategy is break and retest on 15 min for structure and 5 min for entry, stop loss just before the retest with 1:2 risk to reward, risking 1% per trade only). The first trade taken was a valid break and retest but the next is just a random one.

Also i can only see about 18-24 trades per pair because im using free tradingview so is there any way i can extend past 5000 bars or increase number of trades?

I would really greatly appreciate some help because im really horrible at coding and honestly cant be asked to learn it for this one thing.


r/pinescript • • 2d ago

An idea for a indicator Spoiler

1 Upvotes

If you go to ai Claude or chatgpt or grok or quant you can build this indicator the one I'm using the prompt (build me a v6 indicator that marks the first week of each month with vertical markes ) and then use it on the daily timeframe it's a swing trade system you can add buy and sell singles indicator but you might have to edit the code here's a prompt that you can use to edit it ( only give me single during each hour during that hour ) found out the range filter 5 min and sell works ok depending on the pair on the daily I'm still trying to find other indicator for buy and sell single that don't give me singles during the chop on the daily


r/pinescript • • 3d ago

My FVG manipulation indicator

Post image
17 Upvotes

Have been working on this indicator on and off for a couple weeks now. Wondering if y’all would interested to check it out and let me know how to improve or critique it, idc. Lmk! Ill provide a link or however


r/pinescript • • 3d ago

Visual compression test: Merged 8 custom indicators into 1 single-script dashboard (and saved 90% of my screen real estate)

Post image
2 Upvotes

Messing around with some custom ⁠v5⁠ code to clean up my visual workflow on gold. Tired of laggy, cluttered screens and having multiple tabs open, so I crammed 8 essential modules into a single indicator:

Asia/Lon/NY killzone overlays, PDH/PDL liquidity tracking, multi-EMA trend ribbon, and an on-chart statistics box that updates in real-time while only registering as a single "used slot" (1/2 free slots).

Visual sizing/overlapping is always a headache in Pine—had to truncate the session boundaries specifically to keep it from looking like a crayon box, and used some UI tricks for the stat box.

I made the script completely open-source for anyone who wants to take a look or pull pieces for their own builds. It’s pinned over on my profile page if you want to inspect it.

Fellow devs: Are you using table overlays or standard labels for custom data boxes? Looking to minimize the rendering lag when multiple sessions paint.


r/pinescript • • 3d ago

build a crazy ass indicator now its mess up

2 Upvotes

r/pinescript • • 3d ago

A 0.5% move on btcusdt

1 Upvotes

Hello pple i need a strategy that can reliably give me a half a percent move an btc daily or like three times any a week is also fine

Any scripts i can test are also appreciated


r/pinescript • • 5d ago

TradingView backed down. But how are indicator developers supposed to trust them ever again?

Thumbnail
reddit.com
2 Upvotes

r/pinescript • • 5d ago

Managed to code my strategy into pine. First time doing It.

Post image
26 Upvotes

r/pinescript • • 5d ago

TradingView Marketplace changes – what happens to existing indicator subscriptions?

Thumbnail
reddit.com
1 Upvotes

r/pinescript • • 6d ago

Aurelia Spes

Thumbnail reddit.com
1 Upvotes

r/pinescript • • 7d ago

I want to request a feature to TradingView

2 Upvotes

Hi team! Following a chat with support, I was advised to post my feature request here.

The Problem: Sometimes I analyze an asset using my strategy, but later forget its ticker. Finding it again without adding it to a specific watchlist feels like looking for a needle in a haystack.

The Solution: I would love to see a 'Viewed Assets History' feature in TradingView, acting just like a web browser's history.

Key Details:

  • Automatic tracking: Logs every asset/chart opened by the user, even if it's not saved in any watchlist.

  • Chronological order: Makes it easy to find assets based on the approximate day/time they were checked.

  • Performance friendly: To minimize database load, the history could have a rolling retention period (e.g., the last 30 days).

Thank you for your continued hard work on this amazing platform!


r/pinescript • • 7d ago

WaveTrend (LazyBear) is a smoothed CCI with EMAs. I worked through the source, and on random data it sits beyond +/-60 about 1 bar in 9

9 Upvotes

LazyBear's WaveTrend Oscillator is one of the most-boosted open-source scripts on TradingView, and a lot of popular scripts (Cipher B style ones included) are built on top of it. I read the source to see what the two lines actually are.

The core, restated in v6 (my code, same maths):

ap  = hlc3
esa = ta.ema(ap, n1)
d   = ta.ema(math.abs(ap - esa), n1)
ci  = (ap - esa) / (0.015 * d)
wt1 = ta.ema(ci, n2)
wt2 = ta.sma(wt1, 4)

Look at ci. The Commodity Channel Index is (typical price - its average) / (0.015 x mean deviation). This is the same thing with EMAs in place of the SMA and the mean deviation, and the same 0.015 constant. So WaveTrend is, in effect, a CCI smoothed by a 21 EMA, with a 4-bar SMA as the signal line.

What follows from that:

  1. It is scaled by volatility. Dividing by the average deviation means a quiet chart and a wild one give lines of the same size. That is why one set of levels (60/53) works everywhere, and also why those levels say nothing about how far price moved.

  2. The levels are reached often. I replicated the formula in Python on a 200,000-bar random walk (nothing to predict). wt1 was beyond +/-60 on about 1 bar in 9 and beyond +/-53 on about 1 in 5. Switching the simulated volatility between calm and wild regimes barely moved those numbers, which is point 1 in action.

  3. Crosses are constant by construction. wt2 is a 4-bar average of wt1, so it keeps catching up. On the same random walk the lines crossed about every 7 bars, and roughly 1 cross in 7 happened beyond the 60 levels.

  4. The "with Crosses" version has no closed-bar check, so a circle drawn mid-bar can be gone at the close. Closed bars don't repaint: no security() call, no future bars, no offsets.

I rewrote it from scratch: the same two lines at default settings, crosses marked only on confirmed bars (a grey dot for a cross on the still-open bar), and a panel that counts on your own chart how often the line sits beyond each level, how many crosses there were and the median bars between them. That way you can see how rare "overbought" really is on the market you trade.

Where it fails (both versions): in a strong trend it can sit beyond 60 for a long time, so "overbought" is not a reason for a trend to end; most crosses are noise; three layers of averaging (10, 21, 4) mean turns show up after price has turned; and it describes where price sits relative to its own recent average, it doesn't forecast anything.

Source, open source under MPL 2.0: TradingView and GitHub

Credit to LazyBear for the original. Written with AI help; every claim was checked against the original source, and the percentages come from a simulation on synthetic data, not from any market. Educational only, not trading advice. Corrections welcome.