The Use of AI with ThinkOrSwim Scripts

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: 76
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
 
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:
One AI assisted script has done well for me - here is a TOS back test as a quick down and dirty, that shows a 180-day profit of $165, 262 dollars with 513 trades (which for you math-heads that are already calculating in your head is 2.85 trades per day and $322.15 per trade, lol... you nerds). I use this one strictly on /mes and /cl. TOS will not easily let me back test spreads... this are single 50 share buys and sells. I use it daily.

 
Here is another 15 min for 5 days on /es - $10.5k in 5 days - not bad...lol.. now this is not real world because we humans tend to mess things up like maybe getting cold feet and getting out early or thinking we are smarter than the math and stay in too long or second guess the program and do not get in at all. But this goes to show that AI assisted scripts can be just as good as any other "educated guess". (my week using this script was a tad better than that)


 
Here is another 15 min for 5 days on /es - $10.5k in 5 days - not bad...lol.. now this is not real world because we humans tend to mess things up like maybe getting cold feet and getting out early or thinking we are smarter than the math and stay in too long or second guess the program and do not get in at all. But this goes to show that AI assisted scripts can be just as good as any other "educated guess". (my week using this script was a tad better than that)


can you please share the script?
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
1048 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