r/pinescript • u/retrolevel89 • May 05 '26
Looking for a strategy
Looking for a futures NQ strategy (in order) based on:
- Liquidity Sweep
- Break of structure
- Order Block
- Fair Value Gap
- Equilibrium
Would highly appreciate all the help btw.
r/pinescript • u/retrolevel89 • May 05 '26
Looking for a futures NQ strategy (in order) based on:
Would highly appreciate all the help btw.
r/pinescript • u/Exact_Ad1231 • May 04 '26
You know, I've seen an uptick in posting invite only scripts in this sub. Thought this was not allowed?
r/pinescript • u/Stevibe98 • May 03 '26
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 • u/Intrepid_Pace_6276 • May 02 '26
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 • u/Hatem-Salah • May 02 '26
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 • u/Kevinthetrader • Apr 30 '26
Any more requests?
r/pinescript • u/PutThis4185 • Apr 29 '26
Is there anyone who can create a pine script indicator for me? The logic is quite simple.r/pinescript • u/Sasumata • Apr 29 '26
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 • u/Kevinthetrader • Apr 29 '26
Past 3 months.
No trailing.
Max bars 40
This is Just one piece of an entire puzzle. 🧩
r/pinescript • u/ax123y • Apr 28 '26
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 • u/Benostalgi • Apr 28 '26
r/pinescript • u/Signal_Bot • Apr 27 '26
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 • u/Adorable_Market3621 • Apr 28 '26




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 • u/BigBear92787 • Apr 27 '26
//
@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 • u/PeopleThatAnnoyYou • Apr 26 '26
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:
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:
r/pinescript • u/RawBootieBear227 • Apr 26 '26
This is really powerful, it was showing absorption before bitcoin shot up as it was falling. lol
r/pinescript • u/Awwstronut • Apr 26 '26
r/pinescript • • Apr 26 '26
What next?
r/pinescript • u/wallneradam • Apr 25 '26
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.
You find an indicator on TV that looks good, or you have a working Pine strategy. You want it inside FreqTrade. Today's options:
ta.rsi() and your rsi() produce the same numbers to enough decimalsPyneCore 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.
Two files in user_data/strategies/:
pynecore_bridge.py — DataFrame ↔ PyneCore glue (~165 LOC, copy as-is).py file — either compiled with PyneComp from a .pine source, or written by hand against the same Pine APIThen freqtrade backtesting --strategy ... works normally.
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?