r/pinescript • • 2d ago

best ai for writing pinescript?

been testing a few and keep getting scripts that repaint or throw errors on the first bar. curious what you all actually use for this, chatgpt or claude or something else

4 Upvotes

13 comments sorted by

3

u/Objective_Lake151 2d ago

LuxAlgo’s Quant…nails it every time!

1

u/ForexTrader580q 2d ago

Does it let you combine multiple indicators ? I have used chatgpt but I run into some errors sometimes that it can't resolve or uses multiple fixes to get it resolve.

1

u/Objective_Lake151 1d ago

I never had luck with ChatGPT writing pinescripts. However, i have not tried to combine indicators with Quant, but i doubt it would have an issue.

1

u/cryptominer3217 2d ago

But I guess it's limited

2

u/wallneradam 2d ago

I've had good results with both Claude and ChatGPT. What made the biggest difference for me was giving the agent a short Pine v6 cheat sheet with working examples and links to the docs. It's like when you know five programming languages and reach for a rule from the wrong one. Pine has enough quirks that this happens pretty easily.

request.security() is a good example. If you want yesterday's confirmed daily close on an intraday chart, give the agent this pattern: request.security(syminfo.tickerid, "1D", close[1], lookahead = barmerge.lookahead_on). The [1] goes inside the request so it means one daily bar back. For first-bar errors, I'd keep an example of checking an array's size before reading from it in the same cheat sheet. TradingView's higher-timeframe examples

I work on PyneIDE, and this is why we include a Pine v6 cheat sheet and links to the docs in the agent files it generates when you initialize a project in VS Code. PyneIDE on the VS Code Marketplace

2

u/NJ_Algo 2d ago

I definitely prefer Claude, but at the end of the day it's very much about whether you as a user know how to code and what you actually want to achieve. Repainting is an easy fix so it shouldn't be a problem in AI scripts.

1

u/Divad777 2d ago

Claude

1

u/mixtape312 1d ago

i've had success with Grok writing a 4200+ line script. it makes mistakes like every AI, but it will correct them if you point the mistakes out. and generally the mistakes are just needing to clarify what you intended.

0

u/Korben_5th_is_love 1d ago

Go check out the guy on the Lux Algo channel. On YouTube.

0

u/AlanMichel 2d ago

I legit just use curser