Thinkscript Tutorial Basics | Custom Scanners & Quotes | ThinkorSwim
Education
Introduction
Oh, all right, I want to welcome everybody to the first class of the Discord server. We'll be covering how to build custom quotes and scanners using Thinkscript. So what we're gonna be covering today is like how to build something like this and what it does and basically just the basics of Thinkscript. I'm not a scripter; I don't code. This was all very foreign to me. I literally learned this like two days ago. So this is gonna be a very rudimentary just-the-basics to get started and messing around with it. This isn't gonna be any advanced stuff. I won't be talking over your head or, you know, a lot of times whenever you've learned something from somebody that's really good at something, they just, when they start speaking, they're just everything they say is just going over your head because you have no idea what they're talking about. So hopefully there won't be any of that in this video. That's actually called expertise syndrome or yeah, I think that's what it's called, but I'm going to let the room fill up real quick.
Now, for those, let me turn on my... those in the Discord chat, let me turn on my... turn off push-to-talk and just be voice-activated. And let me know if you guys would rather have that... Can you guys hear me alright in the Discord chat? There's gonna be an echo, so if you're listening in the Discord, I guess just mute the main video and we'll talk on the Discord because the Discord should have no lag.
Alright, so real quick, let me get a gauge of who... how much experience you guys have with scripting or ever working with Thinkscript. So if you have no experience at all, put in a zero. If you have a little bit of experience, put in like one and that could be with like other languages or something. If you have a feel for like basic scripting, put in a two, and then, you know, if you're moderate to advanced, do three, four, or five.
Now, let's get started. I'll run you through my... if you didn't watch the video I posted last night, which was actually 20 minutes long and I didn't intend to be that long, I'll run through these quotes real quick and explain to you what they are. So what we'll build some of these today and I'll show you how I built them and I'll explain the basics of them. So the first one we have here is actually...
Now, for the gap scanner or quote, basically just tells you the gap of the pre-market from yesterday to today. If we go to XL r XR
, this is a 21% gap up. If you click the close, then do the open, and use the drawing tool, it's about somewhere around there.
For the percent change from open, this is a calculation of how much the stock has changed since the opening bell, and I also have a dollar change from open which is the same thing but tells you the dollar amount. The percent change from open can also notify red to green moves, with green boxes indicating when a stock has moved from red to green. It also flashes orange when within plus or minus 2% of the open.
Next up is my volume-to-average-volume ratio, exceptionally handy for filtering. Now, let’s get to building some of these.
Thinkscript Syntax and Functions
To create a new custom quote, click on the scroll icon and bring up the script editor. Let’s use the plot
function first for gap calculations: