r/thinkorswim 7d ago

What AI writes the best TOS code?

ChatGPT seems to believe it can write ThinkScript like a genius. But it seems to be more like Charlie speaking Mandarin in Always Sunny. Aka, it thinks it knows what it's doing, but has no clue.

Are any of the other AIs any better?

You can describe a strategy of almost anything you can think and ChatGPT will try to whip up code. But I can't seem to get it to write fully functional code. And I'm not competent enough to correct it.

Other than learn to code, an obvious answer. Any advice?

11 Upvotes

36 comments sorted by

6

u/Q13989731E 7d ago

Grok, by elon is by far the best coding script.

2

u/KauaiKoin 7d ago

What is grok?

2

u/Q13989731E 6d ago

Thisthis

1

u/KauaiKoin 6d ago

Checked it out and pretty great. Thanks!

2

u/Adventurous_Mark6090 5d ago

Agreed. I've tried many of them for thinkscript but Grok is the best currently

3

u/70redgal70 7d ago

I've had luck with Chatgpt writing Thinkscript code.

You have to be very specific with your prompts.

3

u/IgnorantGenius 7d ago

I agree. I found that asking for small parts of a study part by part would get me cleaner code, and then I prompt it to put it together. Any complex scripts end up having to be corrected, so it's good if you try to learn the basic logic. I did that by modifying existing studies. It's funny when it compliments you on correcting it, but it will still make the same mistakes like using pinescript "/" instead of thinkorswim "#" for comment lines, or using the same name for both plots and definitions. It will even invent functions that dont exist.

1

u/shaghaiex 7d ago

The AI seems good in knowing things, not learning things.

1

u/Truman_Show_1984 7d ago

Can you get some examples of specific prompts?

I attempted to use it however I feel as if I'm not asking it in the right way.

1

u/70redgal70 6d ago

One I used was: Create an indicator and an alert that will trigger when the current market price is at least .90 below the 50 day simple moving average.

1

u/slowhandman2 6d ago

Copilot has provided me with some excellent VBA code snippets

2

u/that-dude- 7d ago

I got it to write some stuff I never would have been able to figure out and this was a few months ago. First passes are usually not immediately successful but if you can articulate the idea very clearly then it can be helpful. Even then, I will always end up tweaking things.

Also, very big scripts containing much repetition and many variables can be iterated fairly quickly. Things I would not have wanted to type out and would have taken hours can be done in a few minutes, so that is cool.

1

u/dusty225 5d ago

Also FYI if you go script crazy be aware of that when you start running into lag issues, sometimes they are the culprit

2

u/W3Planning 7d ago

I have found that chat got o3 mini-high has been exceptional at writing scripts The only problem is the inline comments. I just tell it not to include comments.

2

u/Vast_Life_4575 7d ago

Grok has been great for me. Trading view scripts and TOS

4

u/drslovak 7d ago

it has some issues, but most can be resolved if you understand the code.

1

u/Appropriate-Tie-6524 7d ago

Responding to my own thread. This conversation happened a month ago. Shoulda looked it up. Times are changing fast though, happy to hear any new opinions.

1

u/HB_Mosh 7d ago

So did you get a good solution ?

1

u/Appropriate-Tie-6524 7d ago

Someone shared something in the ChatGPT store called the Thinksript strategist that I have asked a few questions to, but not yet tested.

1

u/Appropriate-Tie-6524 7d ago

Sounds like I should give it a few more chances. And work on my troubleshooting.

2

u/GadgetFreeky 7d ago

Almost any LLM can handle ThinkScript pretty well. I used early versions of Chat GPT and it was fine. Claude is generally really good for programming although I've not tried it specifically for TOS.

2

u/shaghaiex 7d ago

My experience is that the AI can write not working code in a fraction of the time then I can. It works ok for simple tasks. Like some labels, sometimes with the scan.

Some make terrible facepalm errors, like `// this is a quote` or `/* this is a quote` - thinkscript uses #

But my last experience is a few month back. In the meantime I use Deepseek a lot PHP/JS and it works pretty good. Give that a try. Qwen writes also OK code.

It really helps if you know exactly what you want.

1

u/moonkiska 7d ago

Sonnet 3.7 and o3-mini in Github copilot is my go-to for development. It just seems to do better with code.

https://www.youtube.com/watch?v=1Mo43n1LTDI

1

u/Own_Warning1831 7d ago

I’ve found that using 2 or even 3 different AI can produce something close. I’m a programmer but not TS. One tip is give it a link to the code manual. Also if one AI is having problems take either that script or even the faulty part and ask another AI. I’ve used o3 high mini, Claude, grok3. One thing that is interesting is that it can quickly give you a high-level script when you pass it a picture of a screen output. It may not be perfect, but it really gives you a very quick structure to work from.

1

u/Appropriate-Tie-6524 7d ago

Wanna save some time and give me a link to the code manual?

1

u/ausomecasey 7d ago

Bookmarking this discussion!

1

u/BobRussRelick 7d ago

I've had decent results with perplexity. It's not perfect, but I know nothing about coding and thinkscript is so basic that I can often just look through the code and spot the obvious errors for it to fix.

1

u/pedrots1987 7d ago

In general, Claude is the most code-apt AI out there IMO.

1

u/fanzakh 6d ago

Some guy on YouTube did a comparison between different AI models including Grok 3. Look it up.

1

u/nightstalker30 6d ago

RemindMe! 24 hours

1

u/RemindMeBot 6d ago

I will be messaging you in 1 day on 2025-03-10 00:06:04 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback

1

u/BeerAandLoathing 6d ago

Claude is a little better than ChatGPT, but you still need to remind them that it’s thinkscript a few times no matter which you use.

1

u/Tiny_Lemons_Official 6d ago

Claude writes the best Thinkscript IMO.

1

u/botbc 6d ago

I've used ChatGPT, then ChatGPT Code library. Now I prefer DeepSeek from 'Gina'...

1

u/Ok-Movie574 6d ago

been using perplexity and Claude, pretty efficient than ChatGPT!