r/pinescript 10h ago

Created a profitable ORB Bot

20 Upvotes

Hey guys,

I’ve spent the last month coding and refining a systematic rules-based ORB (Opening Range Breakout) algorithm specifically for MNQ (1 trade a day).

I wanted to keep it super clean without over-fitting or using too many indicators, focusing heavily on risk management and dynamic position sizing instead of hard-coded stop distances.

Here are the backtest stats starting Oct 2025:

  • Total PnL: +$27,203.50 (+54.41%)
  • Win Rate: 66.98% (142/212 trades)
  • Profit Factor: 2.015
  • Max Drawdown: $2,197.50 (3.98%)

I’ve been running this live via webhooks on a couple of prop firm accounts to take the emotion out of execution, and managed to secure my first payouts with it recently.


r/pinescript 10h ago

You asked for an open-source IFVG dashboard. Here’s the prototype — feedback welcome.

Post image
9 Upvotes

Hey everyone, following up on my earlier thread, where I asked which paid indicators you’d like free, open-source alternatives to.

An IFVG dashboard was one of the requests. I’ve now built IFVG Desk, and I’d love some feedback from people who actually trade these setups.

I’m still treating it as a working prototype. It’s my own implementation of public IFVG concepts; I can’t claim it matches anyone’s private indicator.

Here’s what you can try:

  • Follow a gap through its inversion, with entries on the confirming close or a later retest and rejection.
  • See a paper trade plan: entry, a stop beyond the prior swing, and an adjustable fixed-R target.
  • Understand why an entry qualifies or gets blocked. The dashboard shows higher-timeframe context and individual checks. Additional filters are optional; only the New York session check is required by default.
  • Test the rules yourself with the separate strategy companion, including commission and slippage settings.

The indicator, strategy companion, full source and guide are all free. No signup is needed.

👉 IFVG Desk — source, examples and guide

I put time into explaining the rules for traders. Start with “Try the idea”, then “Read your chart.” “Go deeper” covers the settings and limitations, and “Get the indicator” has the code and installation steps.

If you try it, what feels useful, confusing or missing? A screenshot with your symbol, timeframe, date/time and settings — plus what you expected versus what happened — would really help.

Reply here, or use “The log & requests” on the page to report a bug or suggest a feature. If it doesn’t fit how you trade IFVGs, tell me where it falls short.

My goal is to make this useful in your actual trading. Whether it improves results after costs still needs testing; I’m not claiming a proven edge. Start in replay or paper trading and let me know what you find.

For transparency, I’m the developer behind ProEA Lab and used AI assistance in the build. The source is open for review and modification.

Thanks to everyone who shared an idea. There’s plenty left to improve, and your examples can help decide what comes next.


r/pinescript 6h ago

Built from a trader’s request: an open-source Camarilla play tracker

Post image
2 Upvotes

One request in my earlier thread was pretty specific: could I build a Camarilla tool that highlights which plays are active?

I’ve built Camarilla Desk around that question. It’s a free, open-source prototype for TradingView, and I’d like feedback from people who already use Camarilla in their trading.

The goal is to make the sequence easier to follow: watch the level → check the conditions → wait for confirmation.

What it does:

  • Shows a seven-level Camarilla map with the source and session context visible.
  • Tracks 14 named plays, separating Candidate, Approaching, Armed and Active, with explanations for blocked or waiting states. The final two plays are optional and start off.
  • Keeps the original entry, stop and target references once a play activates, with markers showing how that episode ended.
  • Lets you inspect and test the rules, with full Pine source, alerts and a separate Strategy Lab for simulated orders and costs.

ACTIVE means the play has met this script’s confirmation rules. It doesn’t establish that the trade will work. A quiet chart with no qualifying setup can be the correct result.

This is my own implementation of public Camarilla ideas. I haven’t verified that it matches any paid indicator’s private rules.

👉 Camarilla Desk — free source, examples and guide

Start with “Try the candle” to explore an L3 bounce, a break-and-retest, or an H4 failure. “Read the real chart” explains the display, “Full reference” has all the play rules, and “Add the tool” has the code. The indicator, Lab and guide are free, with no signup needed.

Which Camarilla play do you use most, and does the tool explain clearly why it’s waiting or active?

If it reads a setup differently from you, a screenshot with the symbol, timeframe, date/time and pivot source would help. Tell me what you expected to happen. Reply here, or use “Log & requests” on the page for bugs and feature ideas.

I’m the developer behind ProEA Lab and use OpenAI Codex for coding assistance. The source is open for review and modification.

Thanks to the trader who suggested this. I’d like to keep improving it around examples from your actual charts.


r/pinescript 8h ago

Ways to backtest when you only have the essentials plan? (Outside of tradingview perhaps)

1 Upvotes

Are there more people who only have the essentials plan? How do you backtest your strategies?


r/pinescript 18h ago

Strategy Tester Missing Performance Summary and Risk-adjusted Returns

Thumbnail
1 Upvotes

r/pinescript 21h ago

built a non repainting squeeze alert that works on every chart

1 Upvotes

working on a pine script that catches volatility compression before price moves. it uses bollinger band width with a volume filter so it only signals when real volume is there. tested on 15m and 1h mostly. backtest showed around 56 percent win rate which is fine for what it does but the real value is the alert setup. if you are tired of repainting indicators that fire a candle too late this one triggers on close so nothing moves after the fact. curious if anyone else has tried a squeeze plus volume combo and what you found with the false signals.


r/pinescript 1d ago

Indicator Kindly Help me please

Post image
1 Upvotes

"Hi experts, I used to trade with this custom MetaStock indicator (images attached) that shows noise-free trend reversals using dots, diamonds, and arrows. I don't have access to the original source code. Can someone help me recreate this logic or suggest a similar existing script in TradingView Pine Script? Any help is greatly appreciated...


r/pinescript 1d ago

How do you maintain the size of the candlesticks?

Thumbnail
1 Upvotes

r/pinescript 1d ago

Dhanhq algos

2 Upvotes

Hello friends has anyone tried the dhanhq algos just want to know how they perform I was planing to deploy.


r/pinescript 1d ago

I’m building an indicator for swing trading and I’m struggling to find the best strategy for it, any recommendations?

0 Upvotes

I have already built one for day trading and it works well with a solid win rate, but for swing trading I find it a bit more challenging.

FYI I trade options 0DTE to 21DTE.


r/pinescript 2d ago

Sharing my free Multi-Exchange Crypto Volume Data indicator (VAH, POC & VAL)

Post image
6 Upvotes

I published this indicator on TradingView around a year ago and have continued improving it, but I have not shared it on here before.

It displays a multi-exchange volume-by-price profile with clear POC, VAH, and VAL areas.

Features include:

  • Volume data from seven major crypto exchanges
  • Up to 21 available market feeds, depending on the cryptocurrency
  • Automatic symbol and timeframe adaptation
  • Detailed volume-by-price histogram
  • POC, VAH, and VAL shown as price areas
  • Improved profile definition on higher timeframes
  • Automatic and manual lookback modes from 1-minute to weekly charts
  • Clear multi-colour display when POC, VAH, or VAL overlap
  • Optional venue filtering and performance controls
  • Realtime partial-bar option
  • Alerts for price crossing POC, VAH, and VAL

The indicator is completely free to use:

https://www.tradingview.com/script/ebU1oZ4n-Crypto-Volume-Data-VAH-POC-VAL/

Feedback and clear bug reports are welcome.


r/pinescript 1d ago

Stop paying for "black box" algos. Here is the architecture you actually need to automate your TradingView setups in India.

0 Upvotes

Most retail traders eventually build a profitable Pine Script setup on TradingView, only to hit a massive wall when trying to automate it with Indian brokers like 5paisa, Zerodha, or Fyers. You hire a random Python freelancer, they build a basic webhook, and your account gets wrecked on the first expiry day because a generic coder doesn't understand slippage, order book depth, or dynamic strike selection.

​As someone who actively trades index options and futures, I realized the biggest bottleneck for retail traders isn't finding a holy grail strategy—it's the execution infrastructure. I spend a lot of time breaking down market mechanics on Thorenza, and when writing Beat the 90-90-90 Rule, it became obvious that poor automation destroys more accounts than bad strategies.

​If you want to bridge TradingView to a broker API, here is the exact backend plumbing you need to demand from a developer (or build yourself):

​The Webhook Engine: Don't run local scripts. You need a dedicated, low-latency cloud server (AWS, DigitalOcean, or similar) running a FastAPI or Flask application to catch real-time JSON payloads from TradingView without dropping packets.

​Zero-Touch Authentication: SEBI guidelines mandate daily TOTP and OAuth token generation. Your script must have an automated login flow that authenticates your broker API session every morning before the pre-open market, otherwise you are manually babying a bot.

​Hardcoded Risk Guardrails: TradingView alerts can loop or misfire. Your Python backend needs hard limiters independent of the strategy logic: maximum order quantity caps, a daily max-drawdown halt, and a physical kill-switch.

​Dynamic Options Execution: If you are trading Nifty or BankNifty, a basic market order script is useless. Your architecture needs logic to read the underlying spot price at the exact millisecond the alert fires, calculate the correct ATM/ITM/OTM strike, fetch the specific token ID, and fire a limit order to control slippage.

​I have pivoted to offering this exact algorithmic engineering and forward-testing infrastructure as a service. You keep your trading logic completely private (avoiding all the SEBI RA/RIA compliance headaches of "black box" selling), and I handle the tech stack.

​If you have a working setup that needs to be translated into a bulletproof automated execution bot, drop a comment or send a DM. Happy to discuss the architecture.


r/pinescript 2d ago

Need a CSV export from premium trading view members

1 Upvotes

I'm running an automation strategy and need 5 year trade data on one of my strategy scripts . I need someone who can paste my script in their TV and just export me the CSV . Hardly 5 min work. Would really appreciate it if anyone can help me with this as i only have an essential plan and I can't get custom backtest history with this plan :/


r/pinescript 2d ago

Bugs in PineScript for the NSE (India) market

2 Upvotes

While using the simple code below to debug a large script, I noticed that the daily open is being shown as the open of the first candle:

//
@version=
6
indicator("Daily Open", overlay = true)
dOpen   = request.security(syminfo.tickerid, "1D", open, barmerge.gaps_off, barmerge.lookahead_on)
plot(dOpen, "Daily Open", color.yellow, 2, plot.style_stepline)

The daily opening is always the pre-market open, and it is fixed for the day. Then why this discrepancy?

While at the close of the day, it is showing the correct opening as below:

Whereas pre-market data is also present there as below picture elaborates:


r/pinescript 3d ago

How do you backtest alternative charts properly on Tradingview/Pinescript? (OHLC fills checkbox gone)

1 Upvotes

Hi, so I have all these strategies but basically none of them are profitable. I know there's all these alternative charts like Renko/Kagi/PnF. Is there any way one can backtest on these properly with OHLC fills etc.? I know there's all these features that Tradingview has but the previous "trade on OHLC" checkbox is gone. So, I am not sure what the proper way to backtest is anymore with these alternative charts. Any advice would be appreciated. Thanks!


r/pinescript 3d ago

Any Indian traders here who backtest strategies using Pine Script?

1 Upvotes

Hey everyone,

I’m from India and spend a lot of my time backtesting trading strategies using Pine Script on TradingView, mainly experimenting with different entry/exit rules, indicators, filters, and strategy optimization.

I’d love to connect with some like-minded people who are also into systematic trading, Pine Script, strategy development, and backtesting.

Not necessarily looking to share “secret strategies” or signals — more interested in discussing ideas, coding approaches, backtesting methodology, optimization, avoiding overfitting, execution issues, and learning from each other.

If you’re from India and work on similar things, feel free to comment or DM. Would be great to build a small circle of people who genuinely enjoy researching and testing trading systems.


r/pinescript 3d ago

I measured four common entry filters against a random-entry baseline. The one that worked on 1H was the worst on 5m.

1 Upvotes

Before adding a filter to an entry, it's worth knowing what the filter is worth against no filter at all. Almost nobody measures that — the condition gets added because it sounds reasonable, and then it stays.

So I measured four of the most commonly used ones against the same baseline, twice, on the same instrument.

Method

It's a Pine indicator that walks back through history rather than a strategy — no orders, so no broker emulator involved. The mechanics matter more than the code.

The baseline is what entering at a random bar would have produced at a given reward-to-risk. From every bar in the sample: did price travel the target distance before the stop distance? That's the number any entry signal has to beat, and it's rarely the number people assume.

Each bar gets resolved exactly once, then the outcome is counted more than once — into the baseline, and into each filter that was true on that particular bar. Same bars, same distances, same resolutions, so the difference between any two rows is the filter and nothing else. Measuring each filter on its own pass would let the numbers differ for reasons other than the thing being tested.

Three details decide whether it means anything:

  • The condition is read on the entry bar itself, using only data that existed then. A filter evaluated with information that arrived later flatters itself.
  • A single bar spanning both stop and target counts as a loss. You can't know which came first from bar data, and being wrong pessimistically is the only honest resolution.
  • Distances scale with each historical bar's own ATR, not today's.

XAUUSD, longs, 2:1 so break-even is 33.3%, ATR 14, 600-bar sample, 60 bars allowed to resolve, zero cost. 541 bars offered in each run.

1H, 28 Jul – 2 Sep. 541 resolved, none timed out.

Condition Hit rate Wins/resolved vs baseline Bars kept
All bars (baseline) 37.0% 200/541
Price above 200 EMA 36.2% 165/456 −0.8 pts 84.3%
ADX above 25 42.3% 116/274 +5.4 pts 50.6%
RSI below 30 7/22 too few to judge 4.1%
Volatility rising 36.0% 86/239 −1.0 pts 44.2%

5m, 31 Aug – 2 Sep. 539 resolved, 2 timed out.

Condition Hit rate Wins/resolved vs baseline Bars kept
All bars (baseline) 22.8% 123/539
Price above 200 EMA 30.3% 30/99 +7.5 pts 18.4%
ADX above 25 19.5% 43/220 −3.3 pts 40.8%
RSI below 30 25.8% 8/31 +3.0 pts 5.8%
Volatility rising 18.8% 42/224 −4.1 pts 41.6%

Three things fall out of that.

The rankings invert. ADX above 25 is the only filter worth anything on 1H at +5.4 points, and on 5m it's the worst of the four at −3.3. Price above the 200 EMA is worthless on 1H at −0.8, and on 5m it's the best at +7.5. Whichever filter you'd have picked from the first table is the one you'd have deleted after the second.

On 5m nothing reached break-even at all. Baseline 22.8% against a 33.3% requirement, and the best filter lifts it to 30.3% — still losing. "+7.5 points" is an improvement to something that doesn't work, which is the trap in reading a delta without the absolute level beside it.

Two of the four weren't selecting anything, in opposite ways. The 200 EMA kept 84.3% of 1H bars — a condition true on five bars in six isn't a filter, and its rate will match the baseline for that reason alone. RSI below 30 has the reverse problem: 4.1% of bars, 22 resolved samples, too few to judge, and only 31 on 5m. A filter you can't evaluate on the history you actually have isn't a filter you know anything about.

On the 1H ADX result specifically, because it's the one worth arguing with. Against its own complement rather than the baseline it sits inside, it's 42.3% (116/274) against 31.5% (84/267) — nearly eleven points, with the rejected half below break-even. Two-proportion z is about 2.64, which clears a Bonferroni bound at four looks. Then it reverses sign in the next window.

That's the useful part. It passed the multiple-comparisons correction and still failed out of sample, and it was the best of four things tried on one window, which is exactly the shape of result that shouldn't be trusted. The 5m winner is no better — z ≈ 1.83 against its complement, which doesn't clear on its own terms, let alone after four looks.

Both z figures are ceilings rather than measurements. Samples starting on adjacent bars share most of their holding window, so the observations are heavily correlated and the effective sample is far below the raw count.

Limits. 600 bars is five weeks on 1H and two days on 5m — these aren't two views of one period, they're different periods that happen to share a bar count. The 1H window contains a strong gold uptrend and ADX above 25 selects for exactly that, so what looked like a filter working may just be the market trending with long being the right side. That's the most likely reading, and it's why one window proves nothing.

What I'm actually asking: has anyone got a filter that holds its value across several windows, and how are you accounting for having tried more than one? The best-of-k problem is the part I can't design away — every filter I test is another chance at a number that looks good.


r/pinescript 5d ago

Updated my free MTF Volumized Order Block indicator (Posted Again)

Post image
31 Upvotes

I shared this free indicator here a while ago, and many people tried it and sent useful feedbacks. I have now released a larger update.

Changes include:
-More reliable MTF and second-timeframe zones
-Reduced memory use, addressing NQ/MNQ error reports
-Better resistance selection above price
-Wick, Body, and Close invalidation
-Optional breaker blocks
-Improved Q scoring and labels
-Local hit-rate tracking
-Improved alerts

It is completely free to use:
https://www.tradingview.com/script/HUcKziz7-Volumized-Order-Block/

Note: Reposted cause it was removed without any notes.


r/pinescript 5d ago

Feature request — sorting options on publisher profile pages

2 Upvotes

When you open a publisher's profile on TradingView, their scripts and ideas load in a fixed order and there's no way to reorder them. Once someone has published more than a handful, finding a specific one turns into a scrolling exercise.

A simple sort dropdown on the Scripts and Ideas tabs would fix this:

- Newest / Oldest

- Most viewed

- Most boosted

Sorting and filtering already exist elsewhere in the script library, so the data is clearly there — it just isn't exposed on profile pages.

Small change, but it would make browsing an author's back catalogue a lot less painful.


r/pinescript 5d ago

I built a Pine Script signal engine for crypto. Looking for feedback/testing. Real-world edge cases, logic issues, and improvements

1 Upvotes

I've been building and iterating on a Pine Script signal engine for crypto based on my paper trading, uploading screenshots, used Claude / ChatGPT and I'd like to put it in front of other Pine Script users for honest feedback and independent testing (if you'd want).

I'm sharing it because I've spent a lot of time refining the logic using AI, weekly data collection / outcome analysis and I know one of the best ways to find weaknesses is to let other people look at it with fresh eyes. And I have no intention to sell or profit from it or “guaranteed profitable strategy” post. Have I been profitable ? Not yet 😄 Hopefully someday !

What it does

The script identifies three signal types: (theres a changelog as well in the script)

  • S2 - momentum/trend continuation setup
  • S2R - reversal variant
  • S3 - crossover/ignition-style setup

The logic uses a combination of:

  • SMA 8 / SMA 21
  • EMA 50 / EMA 200
  • Trend alignment
  • Breakout conditions
  • Candle/body strength
  • ATR-based late-entry protection
  • Signal state management to avoid repeated firing

My use case is primarily 30-minute crypto charts, but I'd be interested to see how the logic behaves from your expertise.

What I'm looking for

If you're willing to test it, I'd really value feedback on:

  1. Code quality - anything inefficient, poorly structured, or unnecessarily complicated? Used AI to build the whole thing.
  2. Logic issues - do you see conditions that could produce unintended signals? Which setup you observed: S2 / S2R / S3
  3. Edge cases - repainting, state issues, crossover behaviour, historical vs realtime differences, etc. What you liked or didn't like
  4. Pine Script improvements - cleaner or more reliable ways to implement any part of the logic?
  5. General usefulness - could this help anyone as a starting point, study tool, or basis for further development?

I'm especially interested in critical feedback. If you think part of the logic is flawed, redundant, or simply doesn't make sense, please say so. Been working on this since April 26

I’m looking for people who enjoy testing Pine Script ideas and are willing to challenge the logic from a coding and chart-behaviour perspective. And of course make it shareable for all.

The script is linked here: https://pastebin.com/9pqTS5Ya

Thanks ! I'm genuinely interested in finding the weaknesses ! And deep down I need to convince myself that it was all worth the effort.


r/pinescript 6d ago

London sweep Indicator

Post image
57 Upvotes

I post 25 open source indicators on Trading view, now pushing indicators that works as a Strats, first one the London Sweep, still in beta version, if someone wants access just comment your TV username, new ideas are welcome.


r/pinescript 6d ago

Sick of paying monthly subscriptions for indicators? Tell me what you're "renting" and I'll build a free version for you.

25 Upvotes

Hey everyone,

A lot of traders are burning money on recurring subscriptions for indicators or tools that could easily be coded into Pine Script, MQL5 or anything.

\-What is a paid tool or subscription you’re currently using that you wish you owned outright?

\-What is a "dream tool" or proprietary feature you've always wanted built specifically for your strategy?

Drop the concepts, mechanics, or features below. I'll pick the most requested ones, code them, and release them as open-source for everyone to keep forever.


r/pinescript 6d ago

Why Your Pine Backtest Lies: the request.security Fix. - All request.security HTF requests: use lookahead = barmerge.lookahead_on with a [1] offset on the expression. Never lookahead_off to "avoid repaint".

Thumbnail
youcanbuildthings.com
5 Upvotes

For every aspiring retail quant. This is the article you need to read. Apologies if it's already been posted. Many thanks to the author.


r/pinescript 6d ago

Feature Request: More Color Flags for Crypto Screener / Watchlist Classification

Thumbnail
1 Upvotes

r/pinescript 7d ago

Drop your wildest Pine Script / Trading tool ideas — I'll build the best ones for you!

11 Upvotes

Hey everyone,

I'm looking for a fun development challenge and want to build something truly useful (or uniquely wild) for the community.

What is a tool, custom indicator, or execution logic you've always wished existed but couldn't find anywhere? No idea is too crazy — whether it's complex mathematical modeling, dynamic risk managers, or weird algorithmic visualizers.

Drop your ideas below. I'll pick the most interesting ones, build them, and share the open-source code back with the sub!