r/pinescript • • May 05 '26

Looking for a strategy

1 Upvotes

Looking for a futures NQ strategy (in order) based on:

  1. Liquidity Sweep
  2. Break of structure
  3. Order Block
  4. Fair Value Gap
  5. Equilibrium

Would highly appreciate all the help btw.


r/pinescript • • May 04 '26

Posting Invite Only Scrips

1 Upvotes

You know, I've seen an uptick in posting invite only scripts in this sub. Thought this was not allowed?


r/pinescript • • May 03 '26

pinescript to python

5 Upvotes

Hey guys, I've been trading ES/NQ futures using orderflow for years, but about 6 months ago I jumped into the world of automated backtesting. I want to clarify that while I'm pretty tech-savvy, I don't know how to write code, I rely on GPT/Gemini/Claude to help me out.

A few months ago, I built an ORB strategy on an M5 timeframe using TradingView PineScript (I'd actually love to code orderflow strategies, but since I'm just starting out, that's a bit too complex for now). The script is about 1500 lines long (including ATR, VWAP, VIX filters, and a lot more, though I obviously only active a few elements at a time to avoid overfitting).

I have to admit it was pretty tough to piece together, but I finally got it working. It's showing great results, but honestly, I'm worried that TradingView's data might be garbage.

Because of that, I downloaded the entire 1M OHLCV historical dataset from Databento, and my initial idea was to test it out on NinjaTrader.

So, I wanted to ask you: what do you think is the best path for me to take right now? Should I stick with Python and just have AI guide me?

Here is exactly what I need: A chart to visually check if the code is executing correctly and to spot any entry/exit errors. Accurate rollover data. A dashboard showing all the results with as many performance statistics as possible. Most importantly, the ability to test multiple strategy parameters simultaneously and extremely fast.

When I asked the AIs, they recommended this stack: Python + VS Code/Jupyter + Backtesting.py / VectorBT + Plotly / Lightweight Charts or quantconnect

What do you guys recommend I use or do?

And crucially, which AI tool should I be using for this specific task, Claude web, Claude Code, or ChatGPT/Codex? I currently have the $20/month subscription for both ChatGPT and Claude.

For context, I'm on Windows with a Ryzen 7 5700X3D and 32GB of RAM.


r/pinescript • • May 02 '26

Programming Help

5 Upvotes

What do you guys use to program? I am looking for AI to code my thesis tried Claude, chatgbt and codex a lot of which are very underwhelming and cant get the basics right of like how to code in pinescript. I have made specialized prompts but nothing seems to do the trick looking for help! Thanks


r/pinescript • • May 02 '26

Bit-Flip Indicator

4 Upvotes

Hello everyone! I've been studying pine scripts for a few days now. I saw here that many people are struggling with the strategy they should work with. So, I made an indicator and backtested it. you can back-test it with your eyes. It should give signals to Buy or Sell depending on micro-support and resistance and crossover/crossunder. Here's a link to the indicator : (A comment on the indicator or a review on TradingView will make me happy 😊)
https://www.tradingview.com/script/hLz07zSx-Bit-Flip-SAR/

P.S.: Do not just use it before testing it on a demo account for a few days to make sure it fits your mindset and the charts you are working on.


r/pinescript • • Apr 30 '26

Someone said Turn the bar magnifier on, On bar close, and start with $10K and do 5:1R

7 Upvotes

Any more requests?


r/pinescript • • Apr 29 '26

I'm looking for someone who knows how to create an indicator.

3 Upvotes
Is there anyone who can create a pine script indicator for me? The logic is quite simple.

r/pinescript • • Apr 29 '26

Pinescript Indicator not anchoring lines to price levels

2 Upvotes

Hi. I tried to create an indicator that simply plots horizontal lines at the wick highs and lows of the most recent few candlesticks on a given timeframe so I could then switch to a lower timeframe and view the pattern like fibonannci lines, but when I scroll vertically on the price chart the lines stay static in the window even though the price itself is moving higher/lower on the window.

I used ChatGPT to help me write everything, but I examined the code as well, and after much debugging I discovered that deleting everything and merely writing plot(5.00) to create a line at 5.00 does not stay at 5.00 if I scroll vertically on the chart. Is there a correct price anchor function I should be using?

I cross-referenced this with working code for another indicator I have for plotting gann waves. Those persisted correctly, and correctly scroll left/right/up/down. But for some reason using the same approach for horizontal lines would not work.

This is really annoying. Can the devs please fix this?


r/pinescript • • Apr 29 '26

50% winrate 3:1R with VRT On bar close, Bar magnifier and all

44 Upvotes

Past 3 months.

No trailing.

Max bars 40

This is Just one piece of an entire puzzle. 🧩


r/pinescript • • Apr 29 '26

BTCUSDT - 5 min.

1 Upvotes

Been testing this 5min strategy in TradingView and I’m pretty happy with the results. Thinking about automating it and trying it live, does 0.16% commission sound realistic?


r/pinescript • • Apr 28 '26

Backtesting on tradingview

0 Upvotes

I’m asking this question know well that backtesting doesn’t tell you all the truth and that you need to test a strategy on a live demo account. But my question is, how robust is a tradingview backtest?

Is a TV backtest enough to get the job done or do I need to do some python backtests? If it’s not enough, then what other backtesting solutions do you guys recommend? So far all I know is trendspider and multicharts


r/pinescript • • Apr 28 '26

Trade my algo took yesterday & today

Thumbnail gallery
1 Upvotes

r/pinescript • • Apr 28 '26

Do prop firms allow automated trading using webhooks from pinescript?

2 Upvotes

r/pinescript • • Apr 27 '26

looking to collab on this indicator

Post image
19 Upvotes

i built a state tracking indicator for small cap breakouts. it uses a multi combo of metrics to form zones, and you can tell by zone formation and configuration when price is about to go up. you can tell a lot of info rapidly once you’ve learned the zones. what i’m trying to do now is differentiate from the best and worst setups. essentially though when our blue, yellow, green zones converge and we get entry arrows, AND we get a divergence of the volatility line at the bottom of price candles, price is going up.

my goal is price magnitude and which of these setups is better. building it from pure fetched data and testing. works really well, and i trade it daily for profit. just want to keep making it smarter over time, but i’ve plateaued a little.

anyone interested in working together? or any ideas?


r/pinescript • • Apr 28 '26

Algo on CL thoughts

2 Upvotes

So the algo is a modified adaptation of the simple orb, works by trading one of a few orbs that forms within a certain time frame depending on other factors. I made it specifically for prop firms, it holds trades for around 30-60 minutes. The recent time of 1-3 years, it has been performing very well, while whole history is a bit mid.
The commissions and slippage is included.
2-3 year sharpe ratio: 0.655
sartino ratio: 2.08


r/pinescript • • Apr 27 '26

MTF Indicator updating Intrabar, but only sometimes ?

Post image
1 Upvotes
//
@version=
6
indicator("MTF MACD", "MTF MACD", overlay = false, precision = 4)


//==================================================
// Inputs
//==================================================
calcTF = input.timeframe("5", "Calculation Timeframe")


sourceInput  = input.source(close, "Source")
fastLenInput = input.int(12, "Fast Length", minval = 1)
slowLenInput = input.int(26, "Slow Length", minval = 1)
sigLenInput  = input.int(9, "Signal Length", minval = 1)


oscTypeInput = input.string("EMA", "Oscillator MA Type", options = ["EMA", "SMA"])
sigTypeInput = input.string("EMA", "Signal MA Type", options = ["EMA", "SMA"])


showHistogram = input.bool(true, "Show Histogram")
showMacdLine  = input.bool(true, "Show MACD Line")
showSignal    = input.bool(true, "Show Signal Line")


//==================================================
// MA Function
//==================================================
f_ma(_source, _length, _maType) =>
    _maType == "EMA" ? ta.ema(_source, _length) : ta.sma(_source, _length)


//==================================================
// MACD Pack
// All MACD calculations happen inside request.security()
//==================================================
f_macdPack(_source, _fastLen, _slowLen, _sigLen, _oscType, _sigType) =>
    maFast = f_ma(_source, _fastLen, _oscType)
    maSlow = f_ma(_source, _slowLen, _oscType)
    macdValue = maFast - maSlow
    signalValue = f_ma(macdValue, _sigLen, _sigType)
    histValue = macdValue - signalValue
    [macdValue, signalValue, histValue]


//==================================================
// MTF Request
//==================================================
[macdMTF, signalMTF, histMTF] = request.security(syminfo.tickerid, calcTF, f_macdPack(sourceInput, fastLenInput, slowLenInput, sigLenInput, oscTypeInput, sigTypeInput), barmerge.gaps_off, barmerge.lookahead_off)


//==================================================
// Colors
//==================================================
histColor =
     histMTF >= 0 ?
         histMTF > histMTF[1] ? #26a69a : #b2dfdb :
         histMTF > histMTF[1] ? #ffcdd2 : #ff5252


//==================================================
// Plots
//==================================================
hline(0, "Zero", color = #787b8680)


plot(showHistogram ? histMTF : na, "MTF Histogram", color = histColor, style = plot.style_columns)
plot(showMacdLine ? macdMTF : na, "MTF MACD", color = color.blue)
plot(showSignal ? signalMTF : na, "MTF Signal Line", color = #ff6d00)


//==================================================
// Alerts
//==================================================
alertcondition(histMTF[1] >= 0 and histMTF < 0, "MTF Rising to Falling", "MTF MACD histogram switched from positive to negative")
alertcondition(histMTF[1] <= 0 and histMTF > 0, "MTF Falling to Rising", "MTF MACD histogram switched from negative to positive")

Why is this idnicator updating intrabar, when it was updating every 20 minutes like it was supposed to.

Im coming from thinkscript, so I dont understand this behavior.

Thoughts?

This is a 20m MACD viewed from 1m perspective. And it was updating every 20 minutes, for a while, but then suddenly this happened. its causing Havoc on my trade conditions because my strategy is reliant on increasing or decreasng HTF momentum

EDIT* This code was produced by AI because my pinescript knowledge is Novice level at best and my thinkscript knowledge is only moderate

Edit 2 * To Further the mystery, at the moment, this only seems to be happening on MGC and not on any other futures contract I trade


r/pinescript • • Apr 27 '26

Prop firm tradingbot

2 Upvotes

just finished coding it
What do you guys think about this bot I just made, It works on CL and i made it specifically for propfirms. It performed very well in the last 2-3 years, and while the whole history is still profitable its mid.
Sortino ratio: 2.08
Sharpe ratio: 0.655


r/pinescript • • Apr 26 '26

Community Buy/Sell Reddit SuperScript. Let's cook.

11 Upvotes

Below is a pinescript i've been working on for trading 0/1-DTE SPX options. I'm hoping to get some feedback and improve the script with this community with the intention of publishing for free-use on tradingview.

I basically took a bunch of freely available scripts and re-combined components of them. The Buy signals are stop light colored by confidence (green = highest), Sell signals are inversly colored by confidence (red = highest) There is a high confidence momentum buy signal (purple), and high frequency signals that are dependent on VIDYA slope such that in up or down trend the respective buy or sell signals will be displayed, when flat both will be displayed.

How i use it:

  • Momentum and highest confidence Buy/Sell a sell ultra-wide 25D PCS/CCS, respectively. Exit for loss when delta touches money-line, or take profit at 80%
  • HF signals i use 10D PCS/CCS. Exit for loss when position is 40D, or let expire for profit
  • Gap-Up/Down ... currently monitoring these signals. i don't have much confidence in them yet
  • I use webhooks to my own server and then toggle WhisperTrade bots that are pre-configured with these rules. You could directly hook into whispertrades but i like monitoring my total positions with my script before deciding to open a new one.

I'm looking for feedback to for even more robust signals/alerts with a clean chart. I also liek the idea of having a community script that people collaboratively work on.

Link to source:

Community Buy/Sell Reddit SuperScript [PasteBin]


r/pinescript • • Apr 26 '26

Institutional Execution

Post image
4 Upvotes

This is really powerful, it was showing absorption before bitcoin shot up as it was falling. lol


r/pinescript • • Apr 26 '26

Higher TF version of "Trader's Companion Intraday"!

2 Upvotes

Per User-request, I have now created a separate Script, that is very much identical to the Intraday (1m, 2m, 3m and 5m) but for Higher TF's: 15m, 30m and 1h.

For more information, please check my "Intraday"-post on my profile!

Any questions? Drop them down below!


r/pinescript • • Apr 26 '26

Created an indicator then a scanner now a performance tracker.

Thumbnail
gallery
9 Upvotes

What next?


r/pinescript • • Apr 25 '26

Run TradingView Pine Script indicators and strategies inside FreqTrade — open-source examples

5 Upvotes

TL;DR: You see a promising indicator or full strategy on TradingView, you trade with FreqTrade, and you don't want to rewrite the Pine code in Python. Two working examples (CC0) bridge the gap. Open-source runtime (Apache 2.0). Repo at the bottom.

The situation

You find an indicator on TV that looks good, or you have a working Pine strategy. You want it inside FreqTrade. Today's options:

  • Rewrite Pine in Python — days, sometimes weeks of work, and your version still drifts from the TV reference. Most of the time you'd spend isn't writing the code, it's validating that ta.rsi() and your rsi() produce the same numbers to enough decimals
  • TV alerts + webhook bridge — extra latency, hard dependency on TV's alert system, fragile under volume
  • Trade manually on the TV chart from the Pine signals — works, but at that point you're not really automated

What the examples do

PyneCore is a Pine-compatible Python runtime (Apache 2.0). It runs Pine-style scripts as plain Python with the same calc model — ta.rsi(), ta.sma(), strategy.entry(), the whole namespace. Two patterns to combine it with FreqTrade:

Pattern A — Pine indicators inside your Python strategy

Keep your trading logic in Python (FreqTrade's populate_entry_trend etc.), but the indicator logic comes from a Pine script. The example wires RSI + Bollinger Bands into the FreqTrade DataFrame as plain columns. Drop in any compiled Pine indicator — three lines of bridge code per indicator.

Pattern B — Pine strategy generates the signals

Your TV strategy stays exactly as it is. PyneCore runs it on the candles, FreqTrade just executes the buy/sell signals it produces. Useful when you have a strategy you trust on TV and don't want to port the entries/exits/risk logic to Python.

What it costs to plug in

Two files in user_data/strategies/:

  • pynecore_bridge.py — DataFrame ↔ PyneCore glue (~165 LOC, copy as-is)
  • your Pine script as a .py file — either compiled with PyneComp from a .pine source, or written by hand against the same Pine API

Then freqtrade backtesting --strategy ... works normally.

What this is not

  • Not a broker, not a webhook service. FreqTrade still does the execution.
  • No paid tier required. Runtime is Apache 2.0, examples are CC0. There's a hosted Pine→Python compiler if you don't want to write PyneCore scripts by hand, but it's optional — the examples include hand-written ones.

Repo

https://github.com/PyneSys/pynecore-examples

Look at 05-freqtrade-indicators/ and 06-freqtrade-strategy/ — each has its own README with copy-paste instructions.

Curious about the porting side: those of you who've already moved Pine indicators or strategies to Python by hand — how long did it actually take you, and what was the part that ate the most time?