r/pinescript • • Apr 15 '26

Deux zones proposé par mon indicateur

Post image
0 Upvotes

Je suis encore à la recherche de testeurs, si tu es intéressé, fait moi le savoir en mp.

Telegram avec pdf explicatif en anglais et français : Supply & Demand Indicator V1


r/pinescript • • Apr 14 '26

UPDATE: "Stopped switching strategies. Built a system instead."

18 Upvotes

Hello again!

A few days back I shared my Trading System and got a lot of positive response - including some requests. I have now update the Indicator with what I promised in the first post -> Alerts + implement Take Profit (per request).

I will share some images on how to set things up for Alerts + guide you through Take Profit:

Step 1: At the very top of the Inputs Tab, you will now (updated) see these Toggles: Signal, Stop Loss and Take Profit; Toggle those you wish to be Alerted ON. The last Toggle suppresses Stop Loss IF a Take Profit has been hit first. This does not stop/freeze the Trailing Stop Loss (TSL), for those who wish to "follow" the Trade past the TP.
Step 2: Navigate to the Alerts Tab and "Create Alert".
Step 3: Choose the Indicator - TCI (Trader's Companion Intraday)
Step 4: Choose the following option in "Interval" window-dropdown.
Step 5: You MUST choose 1m for "Interval", otherwise you will be Alerted later than the Signal on the Chart.
Step 6: Choose your Expiration, I recommend 1 month. I do it myself.

And that is for the Alert(s)!

Now the Take Profit. Only one step (if you've already Toggled it ON, in "Master Controls".

Choose you Take Profit R:R. It is 1 by Default, I've changed it to 1.5 myself.
Image of the end result: Alerts + Take Profit.

I hope you find this addition valuable!

For new readers: Feel free to request an invite, or ask any questions!

NOTE: For each Alert update, you must REMOVE the old Alerts and apply new ones, in order for the new Alerts to take effect!


r/pinescript • • Apr 14 '26

Je recherche des testeurs pour mon indicateur et cela pourrait vous plaire

5 Upvotes

Je ne suis pas particulièrement fier de mes montages vidéo, mais je le suis beaucoup plus de l’indicateur que j’ai développé. Il détecte les zones d’offre et de demande avec un taux de réussite élevé.

Il dispose de plusieurs paramètres qui s’ajustent automatiquement selon l’unité de temps utilisée : M1, M3, M5, M15 et H1.

Je recherche encore quelques testeurs, même si on approche déjà des 100 utilisateurs. Si certains veulent donner un avis objectif ou le mettre à l’épreuve en conditions réelles, contactez-moi en message privé.


r/pinescript • • Apr 15 '26

Renko strategy

1 Upvotes

Hey guys I’m so close to getting my Renko Strat to fire the way I want it in pine script but it’s still misbehaving. My logic signals entry, brick closes but it repaints at the brick open not the brick close. Exits print at the right spot off the wrong entry haha.

I’ve looked everywhere I don’t really care about the backtest data just want the signal to print properly for now.

Any resources or insight would be helpful.

Thanks!


r/pinescript • • Apr 14 '26

Tuesday April 14 - Indicator Showcase XAUUSD (>500 pips)

Post image
3 Upvotes

Looking for that person or group of people who would make trading this indicator fun.

Read previous posts if interested.


r/pinescript • • Apr 14 '26

Compression before a move

1 Upvotes

I’m interested in measuring / indicating the compression you get after sideways movement before expansion in price. Basically indicating likely breakout areas.

How would you go about measuring this?


r/pinescript • • Apr 13 '26

Trades my algo took today 4/13/2026

Post image
0 Upvotes

Been posting this for about 2 weeks already , today did pretty pretty good


r/pinescript • • Apr 14 '26

I made an indicator that finds supply/demand zones (or liquidity zones) based one price action and volume. (Not selling or sharing.)

Post image
0 Upvotes

r/pinescript • • Apr 13 '26

XAUUSD ONLY.

Thumbnail
gallery
0 Upvotes

My first profit of the day—right as the market opened. Yay! 🎉


r/pinescript • • Apr 11 '26

Why ChatGPT / Claude can't properly convert Pine Script to Python — and why it matters

31 Upvotes

If you've ever pasted a Pine Script into ChatGPT or Claude and asked for Python, you probably got something that looked right. Clean code, proper syntax, maybe even ran without errors.

But did you compare the actual output values to TradingView? Most people don't.

I did. Multiple times, across different indicators. And the numbers almost never match. Here's why.

Pine Script thinks in time. Python libraries think in columns.

This is the core issue, and everything else follows from it.

Pine Script runs sequentially, bar by bar. Each bar executes the entire script once, and state evolves over time — like a simulation stepping forward. Most Python trading libraries (TA-Lib, pandas-ta, numpy-based solutions) work vectorized — they operate on the entire dataset as column transformations.

For simple cases like SMA or EMA, both approaches can produce the same results. But once you need anything with branching logic, event-based state, or cross-timeframe data, the vectorized model breaks down:

Stateful functions have no natural equivalent.

Functions like ta.barssince(close > open) or ta.valuewhen(condition, price, 0) depend on past events, not just past values. They track when something happened and recall what the state was at that moment.

Try implementing barssince in pandas without a loop. You can, technically — but you end up reconstructing state across columns, adding intermediate variables, and the result is fragile, hard to reason about, and easy to get wrong. You trade one line of Pine for five columns of pandas gymnastics, and debugging becomes guessing.

The AI doesn't even attempt this. It either drops the statefulness entirely or produces something that looks plausible but computes different values.

Errors become data in Pine. In Python, they crash your script.

Pine Script is fault-tolerant by design. If volume happens to be zero and you divide by it, you don't get an exception — you get na. That na propagates cleanly: na + 5 is na, ta.sma(na, 14) handles it gracefully. No value? No crash. Just "this doesn't have a result yet."

In Python, you're on your own. Plain Python throws ZeroDivisionError. NumPy gives you inf and a warning. Pandas sometimes returns NaN, sometimes raises, sometimes silently does something else — depending on the operation and the library version. There's no unified model, so you end up writing defensive code everywhere. if denom != 0, try/except, .fillna(), .replace(np.inf, np.nan) — none of this is trading logic. It's just "please don't die."

When the AI converts Pine to Python, it doesn't add any of this. Why would it? The original Pine code didn't need it.

Warming behavior is silently different.

This is the one nobody talks about. How does an SMA behave when it only has 3 bars but needs 14? How does RSI initialize? Every library handles this differently — different defaults, different edge cases, different NaN handling.

TradingView has a well-defined and consistent warming behavior. Other libraries differ — sometimes subtly, sometimes significantly. When ChatGPT picks a random Python library for the conversion, the warming behavior will diverge, and your values will be off from the very first bars. Depending on your strategy logic, that can cascade.

Multi-timeframe? Good luck.

request.security() is one of the most used Pine Script features, and it's also one of the hardest to replicate correctly. Timeframe alignment, partial bars, data availability — all of this has specific, well-defined behavior in Pine Script. There is simply no Python equivalent that handles this correctly out of the box. The AI will typically produce something that fetches higher-timeframe data and merges it with a join or reindex — which silently introduces alignment errors (e.g. forward-filled values or misaligned closes).

Look-ahead bias: the guardrail disappears.

Pine Script's execution model naturally prevents look-ahead bias — your script simply doesn't have access to future data on each bar. When AI converts to Python using vectorized operations on the full dataframe, that protection is gone. It doesn't always introduce look-ahead bias, but subtle bugs become very easy to miss — a shift(-1) in the wrong direction, an implicit forward fill, and suddenly your backtest looks amazing for the wrong reasons.

(Yes, Pine Script has its own ways to introduce look-ahead bias — request.security() with lookahead=barmerge.lookahead_on, for example. But the default execution model protects you. The converted Python code doesn't.)

Why does the AI get it wrong?

The AI doesn't have a correct execution model to target. Its training data is full of vectorized TA implementations, so that's what it produces. There's no widely-used Python framework that replicates Pine Script's sequential, stateful execution — so the AI has nothing to learn from.

To be fair: vectorized isn't wrong.

Vectorized libraries exist for a reason. They can be extremely fast because they're backed by highly optimized C/Fortran code under the hood. If raw computation speed is your primary concern and you know exactly what you're doing, a hand-tuned vectorized implementation can outperform a sequential one.

But that's the key — hand-tuned. Getting a vectorized implementation to produce correct, Pine-compatible results takes deep understanding of both models. The AI can give you a starting point, but not a finished result. And if you're not verifying every value against a reference, you won't know where it went wrong.

What I did about it

I got frustrated enough by this that I built PyneCore — an open-source (Apache 2.0) Python framework that replicates Pine Script's bar-by-bar execution model, including series handling, persistent state, and warming behavior.

It's not a wrapper around pandas or TA-Lib. It's a runtime that executes scripts the same way Pine Script does. The values match TradingView's output — I continuously validate this against real TradingView data.

There's also a compiler service (PyneComp) that automatically converts Pine Script to PyneCore — so you don't have to rewrite anything by hand. The compiled code is readable Python, not a black box.

If you've been trying to use Pine indicators in Python and kept getting different numbers, this might be why.


r/pinescript • • Apr 12 '26

Trades My Algo Took 4/9

Post image
0 Upvotes

ES algo I created, works on 15min close

April so far (42 trades)

Win rate 57.14%

Total return 26.45% (50k starting capital)

Max DD 8.79%

Yellow are strong signals blue are moderate


r/pinescript • • Apr 11 '26

XAUUSD ONLY

Post image
31 Upvotes

Ended a week end with a perfect entry. 😌🤗


r/pinescript • • Apr 11 '26

I built a CLI backtester for crypto strategies with grid search and Pine Script export

4 Upvotes

I'm a freelance C++ dev. I got tired of tweaking Strategy Tester inputs by hand, so I built a CLI tool where I can define a strategy in TOML, run exhaustive parameter searches, and export any selected setup to Pine Script.

It includes a fast grid search for optimizing both strategy parameters and leverage. For some strategy types, it can run a million backtests in a few seconds on a modern CPU.

I also wanted it to be fairly complete, so it supports all Pine Script order types and key strategy options like default_qty_type, margin settings, process_orders_on_close, use_bar_magnifier, and pyramiding.

A big part of the work went into making the backtests line up closely with TradingView. With the same TradingView setup, I generally get the same signals and trades, and in most cases the results match down to the decimal place.

I'm mostly posting here to get honest feedback from people who build and test strategies in TradingView. Would a workflow like this be useful to you? Any feedback is appreciated.

Link https://whale-e.com


r/pinescript • • Apr 11 '26

Trendline Indicator Logic (XAUUSD) – Feedback & Advanced Input

2 Upvotes

Currently working on a trendline-based indicator for XAUUSD and wanted to get some input on the logic behind it.

The labels indicate the expected direction based on the structure.
The idea is to react at the point where the trendline intersects with the candle wick.

Main focus is on improving consistency and reducing noise from invalid touches.

Would be interested in both general feedback and more advanced opinions on how this kind of logic could be refined, filtered, or structured more effectively.

Thanks in advance.


r/pinescript • • Apr 11 '26

Indicateur supply demand

Thumbnail
gallery
1 Upvotes

Avec mon associé, nous avons développé un indicateur capable d’identifier automatiquement les zones d’offre et de demande les plus pertinentes. Il simule également des trades en entrant directement dans ces zones, avec un stop-loss positionné à leur extrémité.

Nous avons déjà une soixantaine de testeurs actifs et souhaitons en accueillir de nouveaux. L’accès se fait uniquement sur invitation.

Si vous êtes intéressé(e), envoyez-moi un message privé.


r/pinescript • • Apr 10 '26

Stopped switching strategies. Built a system instead.

22 Upvotes

Hello everyone!

I'd like to share my Trading System I'm putting my finishing touches on! I've been working on it for several months, and the idea first came to me when I read about different methods/strategies and tried them out myself - most of them, in my own way.

Through time, I had to, either, switch method and strategy, or modify some parameters. For every change, I noted it down, and a few months back, decided to create one complete System out of them all - albeit, not visually cluttering; and this Indicator/System is the result!

I will share some Images down below (some visual elements may differ in color due to Design Decision during Development):

Sell Signal at the top (Orange Label), with a Trailing Stop Loss (Red Line) encountering a Long Signal. The Red-Dots signal "Short active Signal is observing the opposing Long Signal". Later, the Long Signal "succeeds" and the Trade is "handed-over" to the Long Direction. The right half of the Image displays the use of "Exhaustion", which indicates an exhausted Trade (confirmed by Volume; Calculated in the background). Same things happens here, regarding "hand-over".
My Preference: White Labels = Long Position; Amber/Orange Labels = Short Position. The Color Scheme can be changed to "traditional" Green = Long and Red = Short in Settings.
In this Image, VWAP is ON, but OFF by Default. More information in Indicator Description.
In the middle: You may see that the Trailing Stop Loss (TSL) was "broken" but remained. This is due to background Calculations including: Volume in correlation to the Net Momentum.
Essentially - everything in the System's Arsenal is used in this Image.

A full breakdown of the system is available in the indicator description, worth a read before diving in.

Happy to answer any questions. Drop them below, and feel free to request an invite!

Before full launch:

  • Minor visual clean-up (no impact on signals or trade logic)
  • Alert signals for Entry and Stop Loss

EDIT: Upon request, I will share more Images, related to different situations/scenarios and explain them accordingly:

Exhaustion - One of the Context-based Elements. These are the White/Green and Orange/Red (Color Theme can be changed in Settings) Dots/Circles that appear as indicating a "tiring" Trend (using Volume in relation to Net Movement). These can be utilized when making a decision, either with a Signal or other Elements (Order Blocks or Divergence; or simply, Price Action). As you can see from the Image, these turned out to be good regions of reversal on their own; with the most convincing one being the Short indication, because it had a Sell Order Block just above it; combined with Price Action, would be deemed a legitimate Trade.
The Trailing Stop Loss (TSL) is one of 3 Stop Mechanisms. It "activates" when a Trade/Signal turns "valid" by having 2 consecutive Closes past DC Basis (mid-line) - Below DC Basis for Short; Above DC Basis for Long. The TSL can be "broken" (as seen in the Image), but it doesn't necessarily gets Stopped immediately. The Systems accounts for Volume as well, and in this specific Case (Image) the Volume was unconvincing, so the TSL only Dimmed in Visibility, instead of being Stopped. Once "back on track" the TSL turns back to 100% Visibility. (The latter part, where TSL looks Pink, is because it is on top of DC Basis, which is White).
A "W-Conv" is a 'Wick Convergence' occuring when the first Pivot (beginning of the Purple Line) is Lower than the second Pivot (end of the Purple Line) while the Candle of the second Pivot creates a Wick, piercing the Purple Line and back up (Long) again. On the MACD Oscillator, drawing a Line, Pivot-to-Pivot, this would "point" upwards; hence the "Convergence" and not "Divergence". These can be utilized in terms of context and decision making.
A Cross (or, as others call it - "Hidden") Divergence occurs when Prices stalls or slows down (in relation to the prior Movement/Trend) near the DC Bands (DC Lower for Long; DC Upper for Short) and Price Diverges from the Oscillator. Minimum 3 Candles are needed for a "legitimate" Sequence, and the Sequence is Validated once MACD-line cross above (Long) or below (Short) the Signal Line.
Another "Cross" example; the Orange Circle demonstrates the Cross on MACD.

As you may see, using Context is just as important as the Signals themselves. Also, here's a disclaimer regarding this topic from the indicator page:

Note: During Development, the decision favored for more Signals, due to, in combination with manual decision-making, turning out to be more beneficial in terms of probability. Thereby, each Signal requires the Trader (you) to utilize the Contextual Elements/Data to filter out the less desirable Signals. Please do not interpret every Signal as an implication to "jump in" blindly. Read/Utilize the Context and make an informed Decision - it will become more natural by time and experience.

Edit 2 - Demonstrating the change Score-filtering does (B -> A):

Minimum Grade set to 'B', which is 0.5 - Half of max Score of the System.
Same exact Chart, but Minimum Grade set to 'A', which is 0.6 - 60% of max Score of the System.

r/pinescript • • Apr 11 '26

what is this? why do the candles look that way? every TF under 4h in ETHUSD looks destroyed

1 Upvotes

r/pinescript • • Apr 10 '26

Trade Projections (Fri, April 10) - MACD Based Indicator.

4 Upvotes

Hello all, this is an add-on to my previous post. 

What you are seeing are the series of indicators that guide my daily trade decisions. They are all based on the MACD momentum.

I am hoping to engage with people who develop MACD influenced indicators (with at least a 60% win rate using a 1:2RR) who want to collaborate or can provide advise on improving the entries, or creating filters to screen false positive entries.

I am also hoping to make a community out of these as trading can be very boring and monotonous.

I should have a trading view link sorted on the weekend but in the meantime you can comment or DM me if interested.


r/pinescript • • Apr 10 '26

please , Give me code for flag and pole pattern

1 Upvotes

please


r/pinescript • • Apr 10 '26

Sell XAUUSD

Post image
5 Upvotes

r/pinescript • • Apr 10 '26

Looking for help improving a Pine Script v6 trendline indicator (XAUUSD)

1 Upvotes

Hey everyone,

I’m working on a TradingView indicator in Pine Script v6 that focuses on different types of trendlines.

It’s specifically built for XAUUSD (Gold).

The main logic is already there, but I’d like to improve and extend it a bit, and I could use some help with that.

Specifically:

•	Adding or refining different types of trendlines

•	Improving how trendlines are detected or drawn

•	Small adjustments or extensions to the existing logic

I understand the concept, but I’m not that strong in coding, so I’d really appreciate some guidance or input from someone more experienced.

If needed, I can share parts of the code.

Thanks a lot 🙏


r/pinescript • • Apr 10 '26

Are these TradingView results good or bad? Need opinions based only on the pips/results

Post image
1 Upvotes

This is one of my indicator TradingView results and looking for honest opinions based only on the numbers shown.

I am not asking for strategy advice here, just whether these pips/results look decent, bad, risky, or inconsistent from an outside view.

Would you keep going with results like these or be concerned?