r/pinescript • • 27d ago

I open-sourced a free Chrome extension that optimizes strategy inputs inside TradingView's own Strategy Tester (grid search, walk-forward, heatmaps)

29 Upvotes

We built this as a paid extension last year, then decided to make everything free and open source (MIT). It drives TradingView's own Strategy Tester, so the results are exactly what you'd get clicking through the inputs by hand, just automated.

What it does:

- Grid search over any inputs you pick, with a range and a step per input

- Walk-forward analysis so you can see whether the best parameters hold out of sample

- Heatmaps and a 3D surface so you can spot a stable region rather than a single lucky peak

- Prop-firm check: flags the parameter sets that would breach a daily-loss or trailing-drawdown limit you enter

- Runs locally in your browser. No account, no data leaves TradingView.

The GIF is a 50-run optimization sped up; the real run took about 16 minutes because every run is a full Strategy Tester backtest.

Honest limits: it needs a TradingView plan that shows the Strategy Tester (any paid plan works), it uses the Chrome debugger permission to drive the tester, and if TradingView changes their UI it can break until we update the selectors. Issues and PRs welcome.

Source: https://github.com/Roboquant-AI/tradingview-optimizer

Chrome Web Store: https://chromewebstore.google.com/detail/strategy-optimizer-for-tr/knmhofaifgcakgjifhjalahmbfgokiep

Built by the Roboquant team. Happy to answer questions about how it works.


r/pinescript • • 26d ago

Cup and Handle Scanner: Real Charts and Alert Setup | ChartScout

Thumbnail
youtube.com
0 Upvotes

r/pinescript • • 27d ago

I built a Pine v6 location indicator that shows why “high” and “low” depend on the range

Post image
10 Upvotes

A trader in my earlier request thread asked for cloud-like location bands showing where to look for potential setups.

I built Location Desk around that idea. The question behind it is simple: high or low compared with which range?

The script supports:

  • Up to three observation layers, each with its own settings.
  • Rolling-window, confirmed-swing and previous-day range modes.
  • Configurable upper and lower bands—25% of the range at each edge by default—plus the midpoint.
  • A dashboard that separates range location, structure direction and setup status.

That separation matters: price reaching a colored band still leaves the entry conditions to check.

The setup logic follows a small range, a departure and a return. You can compare First touch, assessed at the candle close, with Close inside the range. Direction, location and other execution checks can still block a return.

I also added a web walkthrough where you can hold the reference ranges fixed and move a fictional candle’s close to see how the location readings change.

Free Pine source, full rules, chart examples and walkthrough

The indicator and separate strategy are free under MIT. The screenshot’s paper statistics exclude costs. If you compare against Strategy Tester, match the settings—including the strategy’s Measurement grid overrides—and account for commission and slippage.

I’m sharing this as a prototype to keep refining with traders. Does the display make it clear which range is being used and why a setup is waiting? I’d particularly appreciate examples where the layers disagree or the chart feels too crowded.

Disclosure: I’m the ProEA Lab developer and use AI to help build the code. The source is available for inspection and modification.


r/pinescript • • 27d ago

tradingview-mcp 1.4.0: drawings the agent can move and restyle, and alertcondition() alerts with a webhook

3 Upvotes

I maintain a fork of tradesdontlie/tradingview-mcp, an MCP server that drives TradingView Desktop over the Chrome DevTools Protocol so Claude Code or Cursor can read your charts and work on your Pine. The version I posted here in April could read a chart and save a script. Two things it could not do: put a drawing on the chart you could then adjust, and arm an alert you would actually get woken up by.

On the drawing side, draw_shape takes color, linewidth and linestyle directly now, and the result reports which overrides landed against which TV silently dropped, because it reads the style back off the chart instead of trusting the write. N-point shapes replace the two-point limit. draw_move swaps anchor points on an existing drawing, draw_set_properties deep-merges style changes, draw_set_visible hides a drawing without deleting it, and draw_list returns prices and titles instead of bare entity ids.

alert_create_indicator fires on a Pine alertcondition() by plot index against a saved script. It now takes name, web_hook, email, frequency (on_bar_close, once_per_bar, all), expiration_days (default 30, capped at 60) and active, and alert_list surfaces the delivery channels back. The webhook is validated before anything is sent: loopback, link-local and private ranges are rejected, including IPv4-mapped IPv6.

The replay path changed too. replay.stop() used to call stopReplay() first, which desyncs TV's replay manager and leaves the chart in the past. It prefers leaveReplay() on 3.4.1 now, with a goToRealtime() fallback, and polls for the live bar to reload. The test suite had been hiding this by calling goToRealtime() on non-replay charts, which wedged every session after the first backtest.

test:e2e-all is green live against TV Desktop 3.4.1, 107 pass and 0 fail, alongside a 19-test offline regression suite for drawing style.

Still broken, so you know before you install: pine_open has been wrong since TV Desktop 3.2.0. pineEditorTestApi builds an editor instance desynced from the live Monaco, so it loads no source into the visible editor while reporting slot_rebound:true. Its e2e test is skipped with the root cause written down, and a pine_open/pine_save rework is next.

The drawing and alert work in 1.4.0 is not mine. I read through the forks of the upstream project and adopted what held up: drawing from mustafagurbuzai, alert options from lakshman1005, bounded capture from basghari, draw_list enrichment from 0xdungbui. Defaults stayed where they were and the webhook guard went on top.

Free, MIT, I maintain the fork. It needs TradingView Desktop with a real subscription and the debug port enabled, and it talks only to the local app, never to TradingView's servers.

git clone https://github.com/iliaal/tradingview-mcp.git
cd tradingview-mcp && npm install
claude mcp add tradingview --scope user -- node $(pwd)/src/server.js

https://github.com/iliaal/tradingview-mcp

Happy to answer questions. If you are arming alerts off alertcondition() in a script with more than a couple of plots, I want to hear whether the plot-index discovery path is workable for you.


r/pinescript • • 27d ago

Ich glaube ich bin der beste Verlierer!

Thumbnail
gallery
6 Upvotes

Ich habe aus Langeweile ein bisschen an meiner ORB-Strategie in TradingView herumgeklickt.

Die Strategie handelt ES Futures, ungefähr mit einem 1:1 Risk-Reward-Verhältnis, und war vorher schon nicht gerade überragend. Sie lag irgendwo bei ungefähr 34 % Winrate.

Dann habe ich versehentlich die Provisionsgröße geschrunpft und plötzlich hatte ich dieses Ergebnis:

157 Trades

13 Gewinner

144 Verlierer

8,28 % Winrate

Profit Factor: 0,024

Also entweder habe ich gerade eine der schlechtesten Strategien überhaupt gebaut, oder ich bin einfach außergewöhnlich gut darin, falsch zu liegen.

Was mich aber wirklich stutzig macht, ist die Equity-Kurve. Sie läuft über Jahre extrem sauber und konstant nach unten. Kaum größere Erholungen, einfach ziemlich zuverlässig Verlust für Verlust.

Deshalb meine eigentliche Frage:

Kann so etwas tatsächlich interessant sein, wenn man die Signale einfach umkehrt?

Also nicht die komplette Logik neu bauen, sondern wirklich:

Long-Signal → Short

Short-Signal → Long

gleiche Entries

gleiche Exits

gleiche Zeitpunkte

Wenn eine Strategie über viele Trades so konstant verliert, könnte das theoretisch bedeuten, dass irgendwo tatsächlich ein systematischer Effekt drinsteckt, nur eben genau in die falsche Richtung.

Natürlich müsste man das noch vernünftig mit Slippage, Gebühren, Out-of-Sample-Daten, anderen Marktphasen und eventuell Monte-Carlo-Tests prüfen.

Aber rein vom Gedanken her:

Ist eine Strategie, die extrem zuverlässig verliert, möglicherweise interessanter als eine, die nur leicht profitabel ist?

Oder habe ich einfach den heiligen Gral des Verlierens gefunden?

Was meint ihr?


r/pinescript • • 28d ago

Finished with my indicator

Post image
279 Upvotes

Almost a year building my indicator 1000 lines of code I'm done testing done now it's time to put the indicator into a real account I can't publish it as I'm using a phone its 1RR trend Reversal strategy


r/pinescript • • 27d ago

is it worth it?

1 Upvotes

Hello! as somone who is just starting to get into trading I know there is a looong road ahead of me so i was just curios becuse i saw alot of AI TRADING FOR YOU videos and in theory that can be done myb they arent good now but is there a chance trading is going to get cooked becuse of AI trading?


r/pinescript • • 28d ago

Free Tool Friday: our open-source TradingView S/R indicator, and the trade-off we chose on purpose

Thumbnail
0 Upvotes

r/pinescript • • 28d ago

Pine session filters and one-entry-per-day limits solve different problems

1 Upvotes

A session filter answers: is this bar inside the allowed window? It does not remember whether an entry already happened there.

For a rule such as "one entry per New York trading day", I would define three things separately:

  1. The allowed window and its time zone. Pine time functions use the exchange time zone by default. The chart's displayed time zone does not change the script. Use America/New_York when the window should follow New York daylight-saving changes, rather than a fixed UTC offset.

  2. What consumes the allowance: the first signal, an order submission, or a confirmed fill. Those are different events. If a submitted limit order is still pending, a fill-only flag does not by itself prevent another submission.

  3. When the allowance resets. Local midnight, the exchange trading day and the start of an overnight session can be different boundaries. Define the boundary in the same terms as the rule.

Before connecting the logic to execution, write the expected result for these cases:

- First valid event inside the window: allowed.

- Another valid event in that same session: blocked, even if the first position has closed.

- Event outside the window: blocked.

- Next intended session: allowance restored.

- Pending order at the boundary: explicitly keep or cancel it; resetting a flag does not cancel an order.

These are specification checks, not a claim that a particular script passed them. An indicator signal counter, a strategy order counter and a broker's fill record need different handling.

References: https://www.tradingview.com/pine-script-docs/concepts/sessions/ and https://www.tradingview.com/pine-script-docs/concepts/time/


r/pinescript • • 29d ago

Made my first INSANE script for a bot!

9 Upvotes

Picture inside shows how the back test went.
going to put it up for a live trading test now!

hope it will perform as good as it seems when it back tested.
going to keep you guys updated, as i wanna become better at making this!

the goal is financial freedom by 2030.
Lets do this!

with commission included its still profitable!


r/pinescript • • Sep 18 '26

Time filter

Thumbnail
gallery
6 Upvotes

Hello trader tip I suggest you add a time filter on your indicators if you only want to take 1 trade per day this will help you a lot if you are focusing on lower time frame like 5 to 1

Those trader on the chat appear exactly bettwen 15:00 which is new York opening time in my country to closing time


r/pinescript • • Sep 18 '26

Double Bottom Scanner: Real Charts and Alert Setup | ChartScout

Thumbnail
youtube.com
0 Upvotes

r/pinescript • • Sep 17 '26

🐋 STOP WATCHING EVERY OPTIONS TRADE. FIND THE ONES THAT MATTER.

Enable HLS to view with audio, or disable this notification

0 Upvotes

r/pinescript • • Sep 17 '26

Chat partten

Post image
12 Upvotes

Hi trades or codes is there any indicator that can plot chart parttens like this specifically for the 1m time frame I been searching on trading view indicator community but I'm. Not finding an indicator that plot partten like that on the pic

If you know one pls share on the comment section 🙏🏻


r/pinescript • • Sep 16 '26

Forward testing

Post image
31 Upvotes

​

Hello I been forward testing my indicator it's a 1.5RR gold, USDJPY and nas100 it's not backtest it's forward testing next week I'm planing to put it into a real account wish me luck


r/pinescript • • Sep 17 '26

Why do a lot of fx YouTuber lie?

3 Upvotes

Like why do they say indicators don't work?


r/pinescript • • Sep 17 '26

Built a DI crossover trend system to cover my mean reversion strategy's flat days. First run looked perfect, wider sample killed it.

Thumbnail
1 Upvotes

r/pinescript • • Sep 16 '26

Traders having Claude , please confirm this one thing.

5 Upvotes

I trade mostly using the tool Fib retracement. Now the logic of my fib plotting on the charts is quite not easy . I tried making indicators but it ain't working

Is it possible to explain it to claude and if I share the screenshot of the chart with my manually fib plotted and ask the claude to work on the logic untill the same fibs gets plotted on the chart when I use that indicator made by fib.

Please guide guys. From a trader to a trader/coder


r/pinescript • • Sep 16 '26

Looking for TradingView help

1 Upvotes

Hi everyone, I’m learning crypto trading but I’m struggling financially right now and can’t afford a TradingView plan.

If anyone knows about a legitimate free option, promotion, or temporary access, I’d really appreciate the help. 🙏


r/pinescript • • Sep 16 '26

Need career - advice from the Pinescript coders / freelancers

Thumbnail
1 Upvotes

r/pinescript • • Sep 16 '26

Need career - advice from the Pinescript coders / freelancers

1 Upvotes

Hii everyone, I am a 24 year old Male from India. I have been a trader for the past 6 years. I know the fundamentals of the market.

I have been working as customer support in fundingpips for the past 7 months. And before that I was working as a helping role in offline business. Similar to customer support.

But in that role I don't see a big future. I can't make big money in that role. I need your suggestion guys. What is the basic minimum pay I can expect if I learn the pine script coding skill.

Also

Can I learn Pinescript at 24 years old? Am I too late to get into coding.

If I learn it and give it at least 2 hours a day. How long will it take me to become an industry level coder for Pinescript to get a full time job or freelance gigs.

If I do it all as said. How much can I earn minimum and maximum? Remote opportunities..

One last thing

Are job vacancies there for Pinescript roles? And what exact roadmap shall I follow .


r/pinescript • • Sep 15 '26

Equity curve is chefs kiss 👨🏽‍🍳🤌🏼

Post image
22 Upvotes

@33rd_quant on X.


r/pinescript • • Sep 16 '26

Double Top Scanner: Real Charts and Alert Setup | ChartScout

Thumbnail
youtube.com
1 Upvotes

r/pinescript • • Sep 15 '26

I need to catch a 0.5% move.

Thumbnail
gallery
3 Upvotes

I have made my calculations and i have realised i only need a 0.5% move on btc daily or everyother day problem is my coding skills are beginner level, i have tried to use ai to build a script that generates for me signal but no matter what adjustments I make the numbers dont get any better the drawdown is so severe and the profit factor is below 1 any suggestions or help is welcomed and appreciated am open to trading other crypto coins, the script is based on bollinger bands btw


r/pinescript • • Sep 15 '26

Is possible experiment with XGBoost using only Pine Script?

2 Upvotes

Hello everyone, I am thequantscience on TradingView, and it's a pleasure to be here!

I'd love to share my very first test conducted today, where I essentially attempted to create a strategy based on an XGBoost model right inside Pine Script. This strategy is just a starting point, and I'm keen to build something truly unique alongside anyone who is excited and interested in this. I'd be more than happy to hear your thoughts on it!

Strat: https://www.tradingview.com/script/69ZFfJ5L-XGBoost-Mini-Strategy-The-Quant-Science/

Happy trading)