The Use of AI with ThinkOrSwim Scripts

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

AI can produce ThinkScript code that compiles cleanly, but research shows an estimated 40% logic‑error rate in trading‑related outputs. AI is a tool, not a trader.

Tools can make a great surgeon or fighter pilot even better —
but tools cannot be the surgeon or the pilot.
The same applies here.

AI will confidently tell you a script/strategy is perfect if your prompt leans positive —
and just as confidently tell you it is terrible if your prompt leans negative.
This is a reflection of prompt‑steering, not script quality.

Use AI as an assistant, not an authority.
 
You can ask pretty much any LLM to look over your ThinkScript and help find possible issues.

You can also ask it to make a Google Colab/Python script to test the same strategy rules on historical data, so you can run a small backtest or case study.
 
To be successful on AI TOS scripts you have to be very specific and stay in the same chat as long as you are discussing the specific script. Here is a template on what ChatGPT requires to be "accurate". If not then use LuxAlgo, but you will still go through several reiterations. (suggestion: STAY SIMPLE)
 

Attachments

  • THINKSCRIPT REQUEST TEMPLATE.docx
    16.9 KB · Views: 90
I was coding custom scripts from peoples descriptions as a side gig since covid. Unfortunately for me, AI has completely killed that income because most people just outright accept the output from the models, BUT 40% error rate is generous compared to what I've actually seen the bots produce. You run into a major or issue of either 1. the coding being a mix of trading platform languages and python if its not an easy to reference coding source ie "build me the RSI but with a thick pink line" 2. when the indicator is adjusted to fit with the platform programming, the underlying logic ends up getting lost. AI tries to force a fit to the language as opposed to figuring out how to use the language to fit the underlying goal of why the indicator was created. So basically it comes down to this: if you don't know how to check whether what you got is accomplishing the goal then you might as well just download any old crap. TLDR: getting indicators from AI is like shopping in an outdoor street market for some rare, high end item and automatically taking the word of every single street vendor you encounter that what youre getting is 'top quality, best out there'
 
Last edited:
I was coding custom scripts from peoples descriptions as a side gig since covid. Unfortunately for me, AI has completely killed that income because most people just outright accept the output from the models, BUT 40% error rate is generous compared to what I've actually seen the bots produce. You run into a major or issue of either 1. the coding being a mix of trading platform languages and python if its not an easy to reference coding source ie "build me the RSI but with a thick pink line" 2. when the indicator is adjusted to fit with the platform programming, the underlying logic ends up getting lost. AI tries to force a fit to the language as opposed to figuring out how to use the language to fit the underlying goal of why the indicator was created. So basically it comes down to this: if you don't know how to check whether what you got is accomplishing the goal then you might as well just download any old crap. TLDR: getting indicators from AI is like shopping in an outdoor street market for some rare, high end item and automatically taking the word of every single street vendor you encounter that what youre getting is 'top quality, best out there'
It is my experience that one has to keep working with A.I. until it's right and works. Sometimes you have to test it for a few days on TOS to see if correct and keep working with A.I. until it is?
 
It is my experience that one has to keep working with A.I. until it's right and works. Sometimes you have to test it for a few days on TOS to see if correct and keep working with A.I. until it is?
oh believe me, I've tested the hell out of the limits, but like I said if you have no idea of knowing you're looking at the right thing then there really isnt any new benefit to using the new tool vs old standbys
 
I am using ChatGPT amd Claude, ChatGpt , there is a big improvement now, you need only to be persistent on it, he could do anything now. I use to convert script here , using ChapGpt, before there so many mistake, but after r months, I was amazed that it improved a lot, it is learning very fast. Some he cannot get, I keep insisting and guiding it, finally he is getting it.
 
ChatGPT had a dedicated ThinkOrSwim "gadget(?)" in the left sidebar. I canceled my ChatGPT subscription, and I don't see it now.
I'm guessing that is what I used to use. It was like a specified thinkscript but I thought they removed those a year ago and now you can just tell it to use thinkscript, but it will hallucinate with pinescript and make up functions that don't exist. Most normal error it makes is use the same name of definitions for plots.
 
rlUQvJc.png


Simple things, maybe. But when dealing with anything even remotely complex, AI can not reliably write scripts, or check your scripts. It's quite the opposite really, you must to be able to check the AI's scripts. It's still a bit of a paradox at this point. It is only truly useful in areas where you don't really need it.

It can lighten your workload, improve efficiency, and perhaps save you some mundane typing, but it can not fill a void where your own expertise is lacking. You still have to know what you're talking about, how to code, and be able to thoroughly proofread it.

Basically, you have to issue it directives; tell it what to do, don't ask. Then you must have the wherewithal to ensure it has correctly followed your directions. If instead, you're asking it how to do things, or having it explain things that you don't understand, then you might as well not even bother.

Without the capacity to proofread it, teach it, provide it with a basis of working sample code, and sometimes even argue with it, you're bound to get burned by ai-hallucinations, and you won't be able to tell the difference. AI often says the most ridiculous things when left on its own.

That's how we keep ending up with copy/paste ai-generated posts where the code isn't even attempting to accomplish what the what the emoji-laden instructional manifesto says it does, and other things like ai-hallucinated TOS guides about features and settings that literally do not exist.
 
Last edited by a moderator:
rlUQvJc.png


Simple things, maybe. But when dealing with anything even remotely complex, AI can not reliably write scripts, or check your scripts. It's quite the opposite really, you must to be able to check the AI's scripts. It's still a bit of a paradox at this point. It is only truly useful in areas where you don't really need it.

It can lighten your workload, improve efficiency, and perhaps save you some mundane typing, but it can not fill a void where your own expertise is lacking. You still have to know what you're talking about, how to code, and be able to thoroughly proofread it.

Basically, you have to issue it directives; tell it what to do, don't ask. Then you must have the wherewithal to ensure it has correctly followed your directions. If instead, you're asking it how to do things, or having it explain things that you don't understand, then you might as well not even bother.

Without the capacity to proofread it, teach it, provide it with a basis of working sample code, and sometimes even argue with it, you're bound to get burned by ai-hallucinations, and you won't be able to tell the difference. AI often says the most ridiculous things when left on its own.

That's how we keep ending up with copy/paste ai-generated posts where the code isn't even attempting to accomplish what the what the emoji-laden instructional manifesto says it does, and other things like ai-hallucinated TOS guides about features and settings that literally do not exist.
Was this written by AI? ;) You make good points - AI is a language-based tool - use it as any tool and remember that any tool is only as good as the craftsman. (like you eluded to)

I look at it as innovation, play with it, improve it and sharpen its skills as well as your own. It can be a great way to ease yourself into coding because as you review its script you will pick up the nuances of the script structure and nomenclature. I have no problem with these "artificial" scripts as they are seemingly getting better every day.

Limitations are for sure, the user has to realize it's the "sharp chisel" that makes it work. As I have said in previous posts here and elsewhere, right now you have to be very precise and complete in your instructions to AI and it will probably take many reiterations until it gets it "right".
 
Last edited:
Ya know what.... I hadn't used the gemini/google ai mode in a long time and ya know what....HOLY CRAP, its coding ability and logic has grown at a parabolic rate compared to other models I've used more frequently or tested recently. I haven't even seen Claude come anywhere close (granted im only using free modes) If you're going to go the AI route and understand the underlying mechanics of the indicator, I'd actually recommend using it. Even as a programmer its outstanding for laying out the framework that can be tweaked afterward. Masssssssive time saver/game changer to my opinion, and thats from somebody who's p!ssed i lost an easy income stream lol
 
Ya know what.... I hadn't used the gemini/google ai mode in a long time and ya know what....HOLY CRAP, its coding ability and logic has grown at a parabolic rate compared to other models I've used more frequently or tested recently. I haven't even seen Claude come anywhere close (granted im only using free modes) If you're going to go the AI route and understand the underlying mechanics of the indicator, I'd actually recommend using it. Even as a programmer its outstanding for laying out the framework that can be tweaked afterward. Masssssssive time saver/game changer to my opinion, and thats from somebody who's p!ssed i lost an easy income stream lol
Yes. Gemini and also try Grok (especially Heavy/Team) (and Grok does great backtesting - you can give it file of data to test). For either, keep one project in one chat, as they do look back at your input iteratively.

If you find something these models do wrong add it to a text file and send that as one of your first messages. Mine for Gemini is something like: "Remember these rules for this project: 1) do not change the profit engine code, 2) do not change visual (label, chart or signal) positions, colors or shapes, 3) there is no color.black in thinkscript, 4) do not include code that causes repainting of any sort, 5) thinkscript requires top-down programming techniques - all variables and functions must be initialized before you use them..."
 
Ya know what.... I hadn't used the gemini/google ai mode in a long time and ya know what....HOLY CRAP, its coding ability and logic has grown at a parabolic rate compared to other models I've used more frequently or tested recently. I haven't even seen Claude come anywhere close (granted im only using free modes) If you're going to go the AI route and understand the underlying mechanics of the indicator, I'd actually recommend using it. Even as a programmer its outstanding for laying out the framework that can be tweaked afterward. Masssssssive time saver/game changer to my opinion, and thats from somebody who's p!ssed i lost an easy income stream lol
been using gemini for about 6 months, love it
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
603 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top