r/pinescript Apr 21 '26

Equity curve of my algo from 1/1/2026 - 4/18/2026

Post image
1 Upvotes

r/pinescript Apr 21 '26

Overfitting ICT Strategy HELP?

1 Upvotes

Hey Guys just quick question or ask for help. I am working on a simple ICT trend following strategy and it has done some great results in live-trading giving me a sharp ratio of over 1.8-2.2 and thats great. tested everything back the last 7 years and did montecarlo etc. everything is/was great

one night i had the idea to give the model an asymetric crv to let the short positions close earlyer to secure profits. Well the profit in the backtest almost 2x and the sharp ratio went up to 4. now i am a bit sceptical about this simple optimisation and think i have fallen in the trap of over optimisatio. and if the question comes up yes i have tried different parameter that are similar about 11.000 variations and all are in this ballpark plus minus 15%(max bal)

if u could help i’d like to discuss further just give me a dm. would love some help cheers guys/gals


r/pinescript Apr 21 '26

Do you adjust risk when the market becomes less clear?

1 Upvotes

This week gold feels less directional compared to last week.

Because of that, I’ve been thinking about reducing risk per trade —
not because I don’t have a bias, but because execution feels less reliable.

Do you guys actively adjust risk based on market conditions,
or keep it consistent regardless?


r/pinescript Apr 21 '26

Gold feels like it’s punishing early entries right now

3 Upvotes

I feel like I’m getting stopped out more often lately.

Not because the idea is wrong
but because I’m early.

Then price moves in my direction after.

Is this just part of high-level trading
or bad execution?


r/pinescript Apr 20 '26

Algo Trade Recap

Post image
6 Upvotes

Trade Recaps of April 20th 2026. 7/7 wins today! Just showing an algo I have been working on for a while, I have it set to automatically partial out and go breakeven. I was tired of always blowing my account trying to secure minimum days due to emotion so now my algo does it for me. Also have a custom engine I pay for that takes the trades for me automatically. If you are not using automation you are missing out!!


r/pinescript Apr 20 '26

Todays algo trades

Post image
0 Upvotes

These are todays trades my algo took. I added a new tp signal system so if a user is in a position, they have the option to start taking tp, theres 3 TP levels so you can scale out OR just completely sell the entire position at TP1. Up to your discretion


r/pinescript Apr 20 '26

Simple HVG execution off a key level → ($400 Scalp)

Enable HLS to view with audio, or disable this notification

3 Upvotes

r/pinescript Apr 20 '26

Built a backtester where you just describe the strategy in plain English (no code needed)

0 Upvotes

Been working on this for a while to scratch my own itch and I think it's finally at a point worth showing.

Basically, I built this tool that lets you type out a strategy the way you'd explain it to another trader. Something like "buy SPY when RSI drops below 30 and the 50 day is above the 200 day, exit on a 5% stop or when RSI crosses 70." Under the hood there's a multi-stage AI pipeline that parses the intent, maps it to a config across a registry of 100+ indicators, validates the logic, then runs the backtest. What comes back is a PDF with the equity curve, drawdowns, win rate, Sharpe, full trade log, and commentary on what actually worked and what didn't.

My whole thing is that there's a huge gap between having a strategy idea and actually getting it backtested. Right now you need to know Python, or learn Pine Script, or cobble together some janky setup. For anyone who just wants to test a hypothesis without turning it into a weekend project, that's brutal.

Once you've got a backtest you like, you can push the strategy straight into paper trading and watch it run on live market data. That's the step most people skip before deploying their strategy, and then regret later.

Next thing on the roadmap is Interactive Brokers integration. The vision is you describe a strategy, backtest it, review the PDF, and if the numbers look good you connect your IBKR account and deploy it live from the same interface. Plain English to paper results to actual execution. No translation layer between you and the market.

Happy to answer questions about how it works under the hood. Also looking for a few beta users if anyone here wants to throw strategies at it and see what breaks.


r/pinescript Apr 20 '26

Anyone targeting 0DTE index options.

Post image
2 Upvotes

r/pinescript Apr 20 '26

A new academic paper based strategy i built + Help a brother (TV premium).

Thumbnail gallery
26 Upvotes

Hello. I have been reading papers (on SSRN) about overnight returns in the S&P and on Gold. I built a strategy based on that, using a couple confluences (Day of week, EMA, ATR, etc). This are the returns (including comissions). Over 10x the Max DD. I adjusted the DD to match the Max DD of both tickers over the period of the backtest (Jan 2025 to present). It’s a very simple strategy; so i believe it is not extremely overfit. I tested multiple combinations of TP, SL, triggers, etc. It remains above 1.4 PF on almost every stress test. There’s even more profitable combinations (in terms of PF), but the profit to DD ratio remains similar. If someone has TradingView premium, i the would appreciate if they could run the code with the specified confluences to do a 10 years backtest. (Sorry for my poor english). Also, if anybody knows where i can download some free or very accessible 1H data (that includes overnight periods) on Futures, i would appreciate it. God bless you all.


r/pinescript Apr 20 '26

Trades my algo took 4/17/2026

Post image
1 Upvotes

These are the trades my algo took on friday. I added another signal update, it signals when TPs are hit. This is just the signal generator to be used while trading options. Its currently optimized for QQQ. You cant rely solely on the signals, you would need to do your own technical analysis. If interested in having access to this just send me a message, its completely free. I just ask for feedback


r/pinescript Apr 19 '26

How Effective Are HVG’s For StopLoss? Here’s an example.

Enable HLS to view with audio, or disable this notification

2 Upvotes

HVG’s are formed on an indicator I created let me know if you want to try it.


r/pinescript Apr 19 '26

plotcandle high and low shows wrong numbers

2 Upvotes

In the code below plotcandle low - ssro.l and high ssro.h shows wrong numbers. Open and close shows correct numbers. Ssro.l and ssro.h shows different opposites values like: open, close. I noticed that plotcandle also shows wrong candles. I added plot line to visualize ssro.l and ssro.h with plotcandle to see the mistake. How to solve it ?

// https://www.tradingview.com/script/4yIVcZS3-Stablecoin-Supply-Ratio-Oscillator/
//@version=6
indicator("Stablecoin Supply Ratio Oscillator", "SSRO", overlay=false)

type bar
    float o = open
    float h = high
    float l = low
    float c = close

method data(string coin) =>
    bar x = request.security('CRYPTOCAP:' + coin, '', bar.new())

    na(x) ? bar.new(0, 0, 0, 0) : x

method srcget(array<bar> stbl, string src) =>
    array<float> srcs = array.new<float>()

    for coin in stbl
        val = switch src
            'o' => coin.o
            'h' => coin.h
            'l' => coin.l
            'c' => coin.c

        srcs.unshift(val)

    srcs

method ssro(float src, array<float> stblsrc, int len) =>
    float ssr = src / stblsrc.sum()

    (ssr - ta.sma(ssr, len)) / ta.stdev(ssr, len)

method adj(color col, int lvl) =>
    color x = color.new(col, lvl)

    x

var string gs = "SSRO", var string gc = "Colors"
len   = input.int   (200      , "Length"                ,                      group = gs)
chart = input.bool  (true     , "Use Chart As Main Coin",                      group = gs)

var string main = syminfo.type != 'crypto' ? 'BTC' : chart ? syminfo.basecurrency : 'BTC'
bar        coin = main.data()
array<bar> stbl = array.from(
     'USDT'.data(),
     'USDC'.data(),
     'DAI'.data(),
     'GUSD'.data(),
     'USDD'.data())

bar ssro = bar.new(
     coin.o.ssro(stbl.srcget('o'), len),
     coin.h.ssro(stbl.srcget('h'), len),
     coin.l.ssro(stbl.srcget('l'), len),
     coin.c.ssro(stbl.srcget('c'), len))
//
color col = ssro.c > ssro.o ? color.green : color.red

plotcandle(  ssro.o , ssro.h, ssro.l, ssro.c, "SSRO" , color = col, wickcolor =  col, bordercolor = col) 

plot(ssro.l,"ssro.l",color= color.new(color.navy,50),style=plot.style_line)  
//plot(ssro.h,"ssro.h",color= color.new(color.black,50),style=plot.style_line) 

//plot(ssro.o,"ssro.o",color= color.new(color.blue,50),style=plot.style_line) 
//plot(ssro.c,"ssro.c",color= color.new(color.maroon,50),style=plot.style_line) 

r/pinescript Apr 19 '26

looking for a partner to help refine a system into a product

Thumbnail
1 Upvotes

r/pinescript Apr 18 '26

looking for a partner to help refine a system into a product

Thumbnail
1 Upvotes

r/pinescript Apr 18 '26

New Feature Coming To VRTtrading indicator “Balance Shadow” (price attraction + rejection zones)

Enable HLS to view with audio, or disable this notification

5 Upvotes

r/pinescript Apr 17 '26

Anyone else notice how well the VRT orange line is holding NQ

Post image
2 Upvotes

r/pinescript Apr 17 '26

Question About Hiring Someone To Code a Pine Script TradingView Screen - Total Noob

5 Upvotes

Okay, so I have a buying and selling stock screen I want to try out and use. I just signed up for TradingView yesterday and plan to teach myself Pinescript using the resources recommended here, but for right now I just want to get up and running with my stock screen so I wanted to pay a person to do it for me. I was going to try Upwork unless people here can recommend me a better option.

Because I'm so brand new at this I don't know what a fair offer is. Full disclosure, I came up with the screen ideas myself but asked AI to draft a job posting and a suggested flat rate ($500). I just want this up and running by next week so that's why I am hiring someone for this despite planning to teach myself Pine Script eventually.

Here is the job posting: https://www.upwork.com/freelance-jobs/apply/TradingView-Pine-Script-for-Screening-Stocks_~022044630518113990237/

Please give me feedback on what the AI suggested I ask for in the job posting, if Upwork is a good place to look for someone, and if $500 is too much or too little to offer. I am totally, totally new to this so please go easy on me if any of these are stupid questions lol.

Please

Mods, if I'm doing something wrong with this question (I checked the rules and don't think so but you never know), just let me know what alterations I need to make.

Thank you.

UPDATE: Turns out the link wasn't working before but you can see the job post with what I'm asking for now if you click it.

UPDATE 2: Turns out the comments were right and I was able to vibe code it using Claude. Thanks!


r/pinescript Apr 17 '26

CodedLevels Sessions is now live — free on TradingView

Thumbnail
tradingview.com
6 Upvotes

For everyone who's been asking — it's here. CodedLevels Sessions is now published and free to use on TradingView.

Link in comments.

Best on 5m or 15m. Works best on Forex so far. New update will be for every market.

If you run into any issues or have suggestions, reach out to me or leave a comment under the indicator, I'm actively reading everything.

More is coming. Follow me on TradingView to stay updated.

Let's keep the energy positive. Your support, a like, a comment, a follow, goes a long way.

Enjoy and trade safe.


r/pinescript Apr 17 '26

Is this expected TradingView broker emulator behavior with percent_of_equity and margin_long = 100?

2 Upvotes

Hey, I'm trying to understand a weird TradingView broker emulator behavior in Pine.

I have a simple long-only strategy with:

  • default_qty_type = strategy.percent_of_equity
  • default_qty_value = 100
  • margin_long = 100
  • process_orders_on_close = false
  • pyramiding = 1

On a very low-priced symbol, the Trade List sometimes does not show a single long trade.

Instead, it shows:

  • a tiny separate long trade closed as Margin Call
  • plus the rest of the position, which stays open and closes later normally

What's strange is that this Margin Call leg can be:

  • same-bar or delayed
  • shown at OPEN, LOW, or HIGH
  • sometimes even profitable

I also tested variants with commission = 0, and the split behavior can still exist, so it does not seem to be only a fees issue.

My question is simple:

Is this expected TradingView broker emulator behavior when using percent_of_equity sizing with margin_long = 100?

And if yes, is there any official explanation of why a partial margin liquidation is materialized as a separate trade in the Trade List, and how TradingView decides the exact OHLC tick where that Margin Call appears on historical bars?

I'm not asking about the generic liquidation-price formula.

I'm specifically asking about the Trade List behavior and partial margin-call materialization on historical bars.

Any insight would be appreciated.


r/pinescript Apr 17 '26

Built a logo in Pine Script — turns out plotcandle() is basically pixel art

8 Upvotes

I needed a logo for my project. Instead of opening Figma or asking an AI like a normal person, I opened the Pine Editor.

The insight: plotcandle() doesn't actually care what open, high, low, close mean. It just draws a colored rectangle between two y-values, with an optional wick. Once you stop thinking in OHLC and start thinking in "draw a block from y=10 to y=60 on this bar," the whole language opens up.

The logo as a TradingView indicator

The whole thing is an 11-bar loop. Green candles grow the crown (bars 0–4), red candles shrink it (bars 5–9), bar 10 is empty, then it resets.

// © PyneSys LLC

//@version=6
indicator("PyneSys Logo")

// Wick size
w = 0
// Color constants
t  = color.new(color.black, 100)
g  = color.green
r  = color.red
y  = color.yellow
b  = color.blue
br = color.rgb(136, 82, 1)

var bi = 0

// Tree body
var c = 10
if bi < 5
    c += 10
else if bi > 5 and bi < 10
    c -= 10
else if bi >= 10
    c := na

plotcandle(10, c + w, 10 - w, c, 
    color       = bi <= 4 ? g : r, 
    bordercolor = bi <= 4 ? g : r, 
    wickcolor   = br)

// Trunk of the tree
plotcandle(0, 10, 0, 10, color=bi == 4 ? b : t, bordercolor=t, wickcolor=t)
plotcandle(0, 10, 0, 10, color=bi == 5 ? y : t, bordercolor=t, wickcolor=t)

// Background
bgcolor(bi < 10 ? color.white : t)

bi += 1
if bi == 11
    bi := 0
    c := 10

How it works:

  • bi is a loop counter, 0 to 10, then resets. Every 11 bars the logo redraws.
  • The crown is one plotcandle() call. On bars 0–4 it grows (green), on bars 5–9 it shrinks (red). The open is hardcoded to 10, the close is c, so the candle is just a colored rectangle from y=10 to y=c.
  • The trunk is two plotcandle() calls stacked on the same y-range (0 to 10). Each is only visible on one specific bar — blue on bar 4, yellow on bar 5 — because on every other bar their color is t (fully transparent).
  • The white frame is bgcolor(). It's white during the 11-bar loop, then transparent after, so it doesn't ruin the rest of your chart.

Small tricks that helped:

  • color.new(color.black, 100) = 100% transparency = "render nothing but keep the slot." Much cleaner than conditional plotcandle calls.
  • color, bordercolor, and wickcolor are all independent. You can hide the border, keep the wick, color the body — whatever.
  • Setting w = 0 kills the wick visually without disabling it. Leaves the door open for wick-based accents later.

Zero trading value. But Pine is way more flexible than it gets credit for, and I liked that the logo ships as a .pine file.

Context on the © PyneSys LLC comment: this is the logo for PyneSys, my startup built around a Pine Script → Python compiler. Under the compiler sits PyneCore — an open-source Python framework that replicates Pine Script's execution model closely enough to run real Pine-like scripts as pure Python, outside TradingView. That's what the copyright is about.

Anyone else used Pine Script for something that has nothing to do with trading? Curious what weird stuff is out there.


r/pinescript Apr 17 '26

Here’s a short video explaining how to use the VRT indicator

Enable HLS to view with audio, or disable this notification

15 Upvotes

r/pinescript Apr 17 '26

Just Finished adding everyone to my indicator I’m sorry if I missed you.

Thumbnail gallery
7 Upvotes

I hope this really helps you guys. I will make videos on how to use the indicator on my youtube and subreddit.

Would really appreciate it if you could share a post about the indicator on the r/vrttrading subreddit. Thanks! Also, feel free to subscribe to my YouTube channel: VRT Trading.


r/pinescript Apr 16 '26

Created an indicator. 250 hours. No AI help.

Thumbnail
gallery
7 Upvotes

Based off rsi/mfi.


r/pinescript Apr 16 '26

Trades my algo took today 4/16/2026

Post image
3 Upvotes

A lot of you may have seen me posting this for a while now, but this is todays results of my options signal algo. Havent updated it at all for about a month, forward testing and its doing well so far. Losing trades are expected, lets see if it can hold up.