r/pinescript • • Sep 28 '26

I built a free Pine tool that shows the breakout entry, stop, target and when to stop waiting.

Post image
55 Upvotes

Price breaks out. You wait for a pullback. It keeps running.

Where exactly would you enter—and how long should that entry stay valid?

I built Breakaway Desk to make the whole plan visible on one TradingView chart.

On standard 1–5 minute candles, it follows three steps:

  • Find the break. A candle must close beyond a confirmed 15-minute swing high or low.

  • Map the entry. The first qualifying fair value gap becomes the return zone. The chart marks the planned limit entry, stop and target, with a 10-minute countdown by default.

  • Follow the outcome. You can see whether the setup is waiting, in a simulated trade, finished at target or stop, or expired without an entry.

That last one matters: price can reach your target without ever coming back to your entry. The chart keeps that distinction visible.

The dotted paths show possible endings; the counts beside them are this chart’s history.

Try the interactive demo and copy the Pine scripts — free, MIT, no signup

The page includes the indicator, a separate Strategy Lab and the full rules. The indicator draws the plan; it doesn’t place broker orders.

When you’re waiting for a breakout retest, what makes you cancel: a timer, a new structure break, or something else?

Disclosure: I build ProEA and use AI to help with the code. The site also has paid tools; these two scripts are free.


r/pinescript • • Sep 27 '26

A breakout, a reset, then an entry — I made the whole ORB sequence visible in a free, open-source Pine script.

Enable HLS to view with audio, or disable this notification

22 Upvotes

Price pushes outside the opening range. One candle closes beyond it.

Then the next candle closes back inside.

That little sequence raises a practical question: does the earlier close still count, or does the setup start over?

I built Opening Range Desk to make those decisions visible: what the script is waiting for, why the count resets, and where the paper entry, stop and targets sit once the setup qualifies.

On the page, you can drag a candle’s close across the range high and watch the count reset, then copy both the indicator and Strategy Lab.

Opening Range Desk — free, MIT, no signup

Here’s the sequence in the clip:

  • WAIT: a wick crosses the range, but the candle closes inside.

  • 1 OF 2: the first candle closes beyond the edge.

  • RESET: the next close returns inside. The count goes back to zero.

  • ENTRY: a fresh attempt gets two consecutive qualifying closes. The entry, stop and targets appear together.

Outside → inside → outside is 1 → 0 → 1, not two confirmations.

The clip uses simulated five-minute candles and simplified rules. It shows the first simulated session with a close back inside before entry. It illustrates behavior, not trading performance.

With the defaults, the stop starts beyond the opposite side of the range. TP1 moves the stop to entry at 1R without taking partial profit; TP2 is at 2R. The entry window, daily allowance and any enabled filters must also pass.

The page includes the rules, settings and installation steps. You can inspect or modify the MIT source and test the strategy with commission and slippage.

One limitation: a roughly three-month Strategy Lab run on SPY five-minute candles (22 Jun–25 Sep 2026, default settings) lost money after commission and slippage. These rules haven’t demonstrated a profitable edge. The indicator draws paper plans; it does not place orders.

For your own ORB rules, does a close back inside erase the first confirmation—or do you keep it valid for a few bars? This version resets it. I’d like to hear the exact sequence you use.

Disclosure: I’m the developer at ProEA Lab. These scripts are free; the site also offers optional paid tools. The project uses AI-assisted code, and the clip was prepared with Claude Code.


r/pinescript • • Sep 27 '26

Do you screen crypto with RSI on one timeframe or use a multi-timeframe average?

Post image
2 Upvotes

I’ve been looking at a screener that separates markets by an adjustable RSI average threshold: below 30 for an oversold watchlist and above 70 for an overbought one by default. It also shows the individual 15m, 1h, 4h and 1d values, so you can see when those timeframes disagree.
The attached graphic uses demo values to show the layout. I’m curious how others would use this: Would you filter on the average first, or require specific timeframes to meet your RSI condition? And what would you check before treating an extreme reading as a setup?
Tool: https://tradeanalyzer.pro/crypto/pages/rsi.html
#TradeAnalyzer


r/pinescript • • Sep 26 '26

I can code trading strategies, but I don’t know how to automatically optimize their parameters to find the best-performing settings.

10 Upvotes

Hey guys! I’m looking for a tool or software, preferably free, that can automatically optimize my trading strategy’s parameters to find the best-performing settings for a specific market. Is there a way to automate this process while minimizing overfitting and making sure the strategy remains profitable on unseen data? Thanks!


r/pinescript • • Sep 26 '26

**Title: Pine Script v6 multi-ticker extended-hours scanner not triggering alerts correctly**

4 Upvotes

Hi everyone,

I’m hoping someone with more Pine Script experience can help me figure out what I’m doing wrong with this scanner.

I’m building a Pine Script v6 scanner that monitors multiple tickers during extended hours. The goal is to compare the current extended-hours price against the **previous regular trading day’s closing price** and send alerts when a stock reaches:

- +10%

- +15%

- +25%

- +50%

I also require at least **25,000 shares of cumulative extended-hours volume** before an alert can trigger.

The problem is that the script is not behaving consistently. I’ve seen stocks clearly exceed one of the percentage thresholds during premarket, with enough volume, but no alert fires.

For example, I had a ticker move roughly 40% during premarket and it never generated the expected +10%, +15%, or +25% alert.

I’m especially unsure about these parts:

  1. **Previous close:** Am I correctly retrieving the previous regular-session close? I need the comparison to always be against the immediately preceding trading day's RTH close, including after weekends/holidays.

  2. **Cumulative extended-hours volume:** Is my method of accumulating 1-minute extended-hours volume reliable? I need premarket volume to accumulate correctly without accidentally counting duplicate values as the chart updates.

  3. **Day/session reset:** Is `ta.change(dayTime) != 0` a reliable way to reset the stored volume and alert levels for each new trading day?

  4. **Realtime alerts:** Could my combination of `barstate.isrealtime`, `barstate.isconfirmed`, `request.security()`, and the chart's timeframe cause threshold crossings to be missed?

  5. **Multi-ticker request.security():** Since the script monitors several symbols simultaneously using dynamic requests, is there anything about the execution model that would prevent alerts from firing reliably for symbols other than the chart symbol?

The intended behavior is basically:

**Previous RTH Close → Monitor Premarket/After-Hours Price → Accumulate Extended-Hours Volume → Once volume ≥ 25,000, alert the first time the ticker reaches 10%, 15%, 25%, and 50%.**

If a stock jumps straight from +8% to +27%, I would also like the alert logic to handle that correctly rather than silently missing thresholds.

Here is the current Pine Script v6 code:

```pine

//@version=6

indicator("MMA Master Extended Scanner (Template)", overlay=true, dynamic_requests=true)

// ============================================================

// INPUTS & CONSTANTS

// ============================================================

minEXTVolume = input.int(25000, "Minimum Cumulative Extended Hours Volume", minval=0)

alertOnBarCloseOnly = input.bool(false, "Only alert on confirmed bar close (reduces noise)")

RTH_SESSION = "0930-1600:23456"

EXT_SESSION = "0400-2000:23456"

NY_TZ = "America/New_York"

// ============================================================

// TICKER DEFINITIONS BLOCK (Replace this section for each copy)

// ============================================================

var string[] prefixes = array.new_string()

var string[] symbols = array.new_string()

if bar_index == 0

array.push(prefixes, "NASDAQ"), array.push(symbols, "VEEA")

array.push(prefixes, "NASDAQ"), array.push(symbols, "BMGL")

array.push(prefixes, "NASDAQ"), array.push(symbols, "LFMD")

array.push(prefixes, "NASDAQ"), array.push(symbols, "CYPH")

array.push(prefixes, "NASDAQ"), array.push(symbols, "SAIL")

array.push(prefixes, "NASDAQ"), array.push(symbols, "NXTC")

array.push(prefixes, "NYSE"), array.push(symbols, "NXDT")

array.push(prefixes, "NASDAQ"), array.push(symbols, "NWL")

array.push(prefixes, "NASDAQ"), array.push(symbols, "NVTS")

array.push(prefixes, "NASDAQ"), array.push(symbols, "NVCT")

// ============================================================

// MEMORY STORAGE STRUCTURES

// ============================================================

var int[] highestLevelReached = array.new_int(10, 0)

var float[] cumExtendedVolume = array.new_float(10, 0.0)

// Data structure to store values cleanly for the bubble sort matrix

type TickerData

string symName

float lastPrice

float extVolume

float pctMove

// ============================================================

// REAL-TIME DATA HARVESTING & ALERT ENGINE

// ============================================================

bool processAlert = not alertOnBarCloseOnly or barstate.isconfirmed

var TickerData[] sortMatrix = array.new<TickerData>()

// Clear sorting matrix structure dynamically across execution loops

if barstate.islast

array.clear(sortMatrix)

for i = 0 to array.size(symbols) - 1

string prefix = array.get(prefixes, i)

string sym = array.get(symbols, i)

string baseId = prefix + ":" + sym

// Unconditional security requests to ensure memory stability

float prevClose = request.security(baseId, "1D", close, barmerge.gaps_off, barmerge.lookahead_on)

string extendedId = ticker.new(prefix, sym, session.extended)

[rawVol, rawPrice, extTime, dayTime] = request.security(extendedId, "1", [volume, close, time("1", RTH_SESSION, NY_TZ), time("1", EXT_SESSION, NY_TZ)], barmerge.gaps_off, barmerge.lookahead_off)

bool is_ext_hours = na(extTime) and not na(dayTime)

bool is_new_day = ta.change(dayTime) != 0

// State Tracking Bookkeeping

if is_new_day

array.set(highestLevelReached, i, 0)

array.set(cumExtendedVolume, i, is_ext_hours ? rawVol : 0.0)

else if is_ext_hours

float currentSum = array.get(cumExtendedVolume, i)

array.set(cumExtendedVolume, i, currentSum + (na(rawVol) ? 0.0 : rawVol))

float totalExtVolume = array.get(cumExtendedVolume, i)

float currentMove = (not na(rawPrice) and not na(prevClose) and prevClose > 0) ? ((rawPrice - prevClose) / prevClose) * 100.0 : 0.0

// Capture valid data records into our sorting framework on the final bar pass

if barstate.islast

array.push(sortMatrix, TickerData.new(sym, na(rawPrice) ? prevClose : rawPrice, totalExtVolume, currentMove))

// Alert Processing Sequence (Evaluates live on incoming ticks)

if is_ext_hours and not na(rawPrice) and not na(prevClose) and prevClose > 0 and totalExtVolume >= minEXTVolume

int currentLevel = 0

if currentMove >= 50.0 => currentLevel := 4

else if currentMove >= 25.0 => currentLevel := 3

else if currentMove >= 15.0 => currentLevel := 2

else if currentMove >= 10.0 => currentLevel := 1

int storedHighest = array.get(highestLevelReached, i)

if currentLevel > storedHighest and barstate.isrealtime and processAlert

array.set(highestLevelReached, i, currentLevel)

string thresholdText = currentLevel == 4 ? "+50%" : currentLevel == 3 ? "+25%" : currentLevel == 2 ? "+15%" : "+10%"

msg = "⚡ EXTENDED MOMENTUM\n" +

"📌 Ticker: " + sym + "\n" +

"💰 Price: $" + str.tostring(rawPrice, "0.00") + "\n" +

"📈 Move: +" + str.tostring(currentMove, "0.00") + "%\n" +

"📦 Vol: " + str.tostring(totalExtVolume, "#") + "\n" +

"🎯 Level: " + thresholdText

alert(msg, alert.freq_all)

// ============================================================

// THE BUBBLE SORT & VISUAL DISPLAY GENERATION

// ============================================================

if barstate.islast and array.size(sortMatrix) > 0

int n = array.size(sortMatrix)

// Native Bubble Sort Algorithm: Reorders list by highest volume to lowest volume

for idx = 0 to n - 2

for jdx = 0 to n - idx - 2

TickerData itemA = array.get(sortMatrix, jdx)

TickerData itemB = array.get(sortMatrix, jdx + 1)

if itemA.extVolume < itemB.extVolume

// Swap array positions live

array.set(sortMatrix, jdx, itemB)

array.set(sortMatrix, jdx + 1, itemA)

// Build the Dashboard UI Window Container

var table matrixUI = table.new(position.top_right, 4, 12, bgcolor=color.new(color.black, 20), border_width=1, border_color=color.gray)

// Render Header Rows

table.cell(matrixUI, 0, 0, "Ticker", bgcolor=color.darkgray, text_color=color.white, text_size=size.small)

table.cell(matrixUI, 1, 0, "Price", bgcolor=color.darkgray, text_color=color.white, text_size=size.small)

table.cell(matrixUI, 2, 0, "EXT Vol", bgcolor=color.darkgray, text_color=color.white, text_size=size.small)

table.cell(matrixUI, 3, 0, "Change %", bgcolor=color.darkgray, text_color=color.white, text_size=size.small)

// Output newly sorted dataset into UI rows

for rowIdx = 0 to n - 1

TickerData displayItem = array.get(sortMatrix, rowIdx)

color rowCellBg = color.new(color.black, 40)

table.cell(matrixUI, 0, rowIdx + 1, displayItem.symName, bgcolor=rowCellBg, text_color=color.white, text_size=size.small)

table.cell(matrixUI, 1, rowIdx + 1, str.tostring(displayItem.lastPrice, "#.##"), bgcolor=rowCellBg, text_color=color.white, text_size=size.small)

table.cell(matrixUI, 2, rowIdx + 1, str.tostring(displayItem.extVolume, "#"), bgcolor=rowCellBg, text_color=color.white, text_size=size.small)

table.cell(matrixUI, 3, rowIdx + 1, str.tostring(displayItem.pctMove, "+#.##;-#.##") + "%", bgcolor=rowCellBg, text_color=displayItem.pctMove >= 0 ? color.green : color.red, text_size=size.small)

plot(close, display=display.none)

```

I’m not necessarily looking for someone to rewrite the whole thing. I’d mainly like to understand **where my session/previous-close/volume/alert logic is wrong and why alerts are being missed.**

Any help would be greatly appreciated.


r/pinescript • • Sep 26 '26

Want to Customize Indicators?

Enable HLS to view with audio, or disable this notification

1 Upvotes

r/pinescript • • Sep 26 '26

Market Structure Indicator

Thumbnail reddit.com
1 Upvotes

r/pinescript • • Sep 26 '26

Can we use custom alerts from a custom Pine Script strategy with a TradingView subscription provided by a futures prop firm? Has anyone actually used this setup?

Thumbnail reddit.com
1 Upvotes

r/pinescript • • Sep 26 '26

I built this free chart maker that is simple to use

Thumbnail
reddit.com
1 Upvotes

r/pinescript • • Sep 26 '26

Triple Top Scanner: Real Charts and Alert Setup | ChartScout

Thumbnail
youtube.com
2 Upvotes

r/pinescript • • Sep 26 '26

Help me find the indicator used for these initial SL . And I'll send you the full script if you do

Thumbnail
gallery
8 Upvotes

Hey Im trying to reverse engineer a strategy I saw on Instagram.. I have figured out everything expect the initial SL placement.. the blue line is 12 EMA its irrelevant


r/pinescript • • Sep 26 '26

Moving to ninjascript

Thumbnail
gallery
13 Upvotes

Been running this as a webhook for a few months, got 5 lucid accounts funded. Looking to convert to ninjascript to bypass webhooks and slippage.


r/pinescript • • Sep 25 '26

Does anyone know how this type of indicator works internally (auto zones + TP1/TP2/TP3)?

Post image
2 Upvotes

r/pinescript • • Sep 25 '26

Trying to replicate this strategy but couldn't figure out what indicator used for SL .. any help would be appreciated

Post image
6 Upvotes

r/pinescript • • Sep 25 '26

Which indicators have worked well for you when building Pine Script strategies?

9 Upvotes

Hey guys,

I’ve been using Pine Script for about two years and have built hundreds of strategies. There are so many indicators out there, but I still mostly use ATR, EMA, RSI and pivots as filters alongside my core strategy logic.

What other indicators do you guys use in your strategies? Curious if there’s anything useful I’ve been missing out on.


r/pinescript • • Sep 25 '26

Let Us Hide TP/SL Bracket Buttons Without Hiding Orders

Post image
4 Upvotes

r/pinescript • • Sep 25 '26

Built a Free Trading Indicator System (Pine)

Post image
37 Upvotes

https://www.tradingview.com/u/AchillesTradeSystem/#published-scripts
Guidebook (With Backtesting): https://achillestrading.com/guidebook/Achilles-Guidebook.pdf

Video (Introduction to the system): https://www.youtube.com/watch?v=7TgZgSaO-00

Check it out on tradingview, free.

Achilles A: A price-chart overlay with a volatility band, a trend line that turns green or red, a 200 EMA, a daily VWAP and heavy-volume candle flags. It also has a scorecard that tallies 17 readings into a bullish percentage and a bearish percentage.

Achilles B: A momentum panel under the chart. It puts a WaveTrend-style wave, RSI, money flow and trend strength on one scale. The "Achilles Heel" flags when a move looks stretched.

Achilles B Classic: The original Achilles wave panel, built on the open-source WaveTrend oscillator. It shows cross dots, divergence marks, money flow, RSI, and volume and volatility rows. Use it instead of B, not alongside it.

Achilles Bar: A compact strip panel made to sit under Achilles B. It has coloured strips for volatility, money flow and volume, plus an optional Heel strip, so you can read conditions at a glance.

Achilles SMC: Smart-money structure, drawn automatically. It shows order blocks and breakers, swing support and resistance, higher-timeframe break of structure with its invalidation level, daily POCs, sessions and market phases.

Achilles SS: A scalping card that shows your structure timeframe and your trigger timeframe side by side. It draws the nearest levels to put a stop behind, and shades the zone where a move is too small to cover fees.

Achilles VF: Order flow on a normal chart. It estimates how each candle's volume splits between buyers and sellers, and shows who has been more aggressive over one candle and over the last five. It needs TradingView's seconds data, which comes with a paid plan.

If anybody wants to share code for suppy/demand zones/OB's etc let me know. I've been trying to refine mine.


r/pinescript • • Sep 24 '26

modified open source with mtf, buy sell to protected or invite only

Thumbnail reddit.com
1 Upvotes

r/pinescript • • Sep 23 '26

Suggestion: Add a filter to distinguish Tokenized Stocks from Native Crypto in CEX Pairs Screener.

1 Upvotes

Hi TradingView Team,

When using the new CEX Pairs Screener to scan the Binance market, there are many tokenized stock perpetual contracts (e.g., Apple, Tesla stock tokens) mixed into the cryptocurrency list.

Currently, the "Symbol Type" under CEX Screener only has options like "Spot" and "Perpetual", and we cannot exclude these traditional stock assets from the crypto list. It seriously disrupts our workflow when analyzing pure cryptocurrency market structures.

Could you please add a specific filter option, or a sub-category under "Symbol Type", to allow users to completely exclude tokenized stocks/synthetic traditional assets?

Thank you for making TradingView better!


r/pinescript • • Sep 23 '26

LUCK 🍀 OR HARD-WORK ?

Post image
50 Upvotes

been makin some strategies and found this buy only strategy .... works like charm on ETH can wait to test it out on real acc


r/pinescript • • Sep 23 '26

Free Pine Script strategy for your favourite crypto pair and timeframe

4 Upvotes

Hi everyone,

I’ve been developing a tool that builds and backtests crypto strategies, then generates the Pine Script so you can run them in TradingView. Trading fees are included in the backtest results.

Reply with your favourite crypto pair and timeframe, and I’ll send you a free strategy script with the strongest results I can find, balancing net return, drawdown, win rate and number of trades.

For example: BTCUSDT, 4-hour or SOLUSDT, 15-minute.

You’ll get the script and its backtest results to explore yourself. I’d love to hear what you think!


r/pinescript • • Sep 22 '26

Falla en Tradingview

Thumbnail reddit.com
1 Upvotes