Thinkorswim Condition Wizard Watchlist

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys welcome to the video today I'm going to be showing you how to use the condition wizard to customize a column in your watch list now i've previously recorded and published a video on the condition wizard for thinkorswim i'll show you how to get to that from our website from our website you can go to the main menu at the top free tutorials thinkorswim tutorials from the left-hand navigation menu click on thinkorswim scans you can see right at the top of the list is thinkorswim condition wizard you click on that then you can see it opens up to the condition wizard video so if you find yourself a little lost in this video be sure to go back and view the original video that I did the original video focuses more on the scans shows a little bit of how to display your code in a but what I wanted to do is make sure that you understood there was another video that preceded this one where we covered the condition wizard in great detail step-by-step very carefully so if you feel lost at all during this video go back watch the other one and then come back to this one and and finish this one all right so let's go ahead and go back to the forum I'll show you how to get to the forum so from the top of our website menu right here Q&A forum ok we'll click on that and then all I do is scroll down here to the very bottom that's our list of topics and you can see that for watch lists we go ahead and click that and I'm going to change the view it's sorted now by newest and I'm going to change it to most views so what I'm doing for this video is I'm using the content of our Q&A forum to drive the topics that I cover in the video and I want to pick the ones that are most viewed because these are the ones that are getting picked up by the search engines so people are doing a search in Google and DuckDuckGo and Bing and other search engines and they're coming up with solutions posted in the Q&A forum and that's how these views pile up over time and so I just want to let you know that's where I'm getting the topics for today's video I'll be covering those shortly and I'll give you a review basically of what we're going to cover in today's video first I want to show you the watch list now many of you might not know where you can get the watch list gadget on your thinkest win platform so we'll go ahead and go to the chart and we'll open the side menu here you can see that I've got one watch list here and that's a gadget okay now I'm going to show you how to go ahead and open a watch list as a gadget if you don't have one already listed on your side bar for instance this one here is set to trader TV and to want to talk live news all right so we're gonna change the trader TV to a watch list I'm going to show you how to do that you go ahead and click the menu and then you select switch gadget and then you can select watchlist from the list voila we've changed Trader TV to a watchlist so I'm going to collapse that because we don't need that and I'm going to show you next how we detach a watchlist from the sidebar this is very helpful because you might want to collapse that sidebar to make best use of your real estate so you've got chart screen instead of you know sidebar with a bunch of stuff here so we'll click on the menu and select detach gadget and that's it so we've taken that watchlist and now we can click and drag that and put that anywhere on our screen that we want to okay so I'm going to close that because I've already got one open off to the side here I'm going to collapse the side menu and then we'll drag that watchlist in and I want to show you that I've got this push pin activated that says always on top when that push pin is straight up and down like that then anytime you click on the chart the watchlist is always going to stay on the top it's very helpful because then you can put that off to the side and you can work with your chart and you can scroll back and forth if you want to on the chart do access various other things on the platform like scans and whatnot and the watchlist will always stay on the top the other thing I want to show you is I've got it linked I've got it linked to number nine okay symbol link symbol link is number nine it's also the color lilac right and I've also got the chart set up to that same link number okay so I've got the chart and the watch list both linked together so that whatever I click on in the watch list automatically gets loaded on the chart all right so I want to cover those those are some basic basic things that we've covered in many of our watch lists videos in the past but I wanted to give you a clear understanding of that before we get too far into this because I don't want anybody to get lost before we get into the nuts and bolts of of today's topic okay so let's go ahead and move that off to the side and I do want to show you some of the topics we're going to be covering today so the first one we're going to cover is we're going to show how to assign the background color based on stochastics full K greater than stochastics full D this is a request in the Q&A forum and I provided a solution that was based on code here's what the user who input the question posted they posted their own code and they tried to put in their own statement here to assign priced color and then I went ahead and provided another solution here now now this is a code based solution what we're going to provide is a building that strictly from the condition wizard and the only thing we're going to have to mess with is this statement right here a sign well we rocket an assigned price color we're going to actually assign the background color right here okay so we're going to replace all of this code here with code that we build using the condition wizard and with the condition wizard we don't have to write any code at all we just build our condition and it produces the code for us and I'll show you how to grab that code and edit it so that we can make use of it in customizing our watch list columns some of the other topics we're going to cover we're going to show you how to do one with the RSI but using these tools you'll be able to select from a list in the condition wizard and choose whatever indicator that you would like to use so another topic that we're going to be covering is changing the background color for any prices above the V lab so I'm actually going to show you how to do green for above the V Lapp red for below the V Webb V WEP is a very popular topic on the Q&A forum there's lots of posts on that one so let's see the next thing we're gonna be covering the TTM wave custom color in a watch list and again in this one I provided some code here for a solution and we're gonna show you how to build that using the condition wizard so that you don't have to know how to write code all you have to do is learn how to use the condition wizard and you'll be able to customize your own custom watch list on your own okay let's see we're gonna go back to the original tab here and then I'm gonna quickly go over the disclaimer which is not so much a disclaimer as much as it is just telling you the honest truth I'm not a traitor I don't trade for a living I earn my living by providing custom tools for our viewers so don't think that anything in this video is an advertisement or a recommendation to buy or sell any financial instrument I'm not here to do that I'm not here to teach you how to make money with trading I'm showing you how to make the best use of your platform and giving you the tools that you can do with your own hands and not have to pay me to do it for you right so okay with that said we've got that out of the way let's go ahead and get into the details and to get started we're going to review some information from the learning center published by TD Ameritrade this is thinkorswim Learning Center by TD Ameritrade this is not my website it's actually TLC thinkorswim com that's the URL of this website and I use it regularly when I'm doing custom code projects for our clients and so this is where I go to as a programmer to learn the different tools that are available in the thinkorswim language to do all of the things that we can do with writing code so this is one of the main functions we're going to be using today a sign background color it's super super simple it takes only one argument and that is your color and we're going to be using this is such the most basic example here it sets the background to dark red okay we're going to be adding a little bit of juice to this by including an if-then-else statement so we're going to say if condition true or false then color white else color red okay that's just an example so we're gonna be using this that's how we're gonna set the background color of our custom watch list another of the functions that we'll be using is a sine value color it works exactly like a sine background color except this one assigns the color of the value that's displayed in the custom watch list so we're going to be using that as well and don't worry most of this is going to be using the condition wizard that doesn't require you to write any code whatsoever but there's going to be a little bit of adjustments needed and I'll show you that step-by-step so that you'll be able to do it without any problems at all okay so the first example we're gonna go step by step nice and slow and then the rest of the examples will speed things up a little bit so this isn't an hours long video to make sure that you can get all the information that you need to learn how to do this and get some ideas of your own from watching the video okay so the first example we're going to be covering is the assignment of the background color based on the stochastics we're going to be looking at the full k greater than the full D so first let's go to our chart and put the stochastics on our chart so we're going to go to studies edit studies we're gonna search for stochastics we're gonna put in stochastics full double click to add that to the chart let apply and okay so that way we can see what the stochastics is doing and when we write our code we'll be able to match up what our code is displaying in the watch list to what shows on the chart now the condition we're looking for here is a color based upon the stochastics full K which is this red line right here being above the full D which is the magenta line okay so you can see right here where these two cross over that's where the full K is greater than the full D and what we'll do is we'll set it up so that it's red if the full K is below the full D and green if the full K is above the full D so it's going to be red for instance in this section of the chart and then it's going to turn green for this section of the chart okay so we'll show you how to do that and we'll build that using the condition wizard so let's go ahead and get started we'll go to studies at studies and I've got a temporary study that I've already added to the chart doesn't matter what's in here what we're going to do is we're going to edit the code so we're going to click on the little script icon here just click once and now we see that we are in the think script editor now notice over here is the condition wizard so we're going to switch tabs here and switch from the think script editor to the condition wizard this one here is close is greater than open it's a true false condition as they all will be and we don't need this so we're going to delete it I'm going to show you now how to add a new condition it's this button down here in the bottom left and then we're going to select add a condition we're gonna select a study notice you can select value study function or price now if you get lost at any point during this video we've done a video previously that covered the thinkorswim condition wizard and we went into great detail and showed you many examples so be sure and view that video if you don't feel comfortable with this and you get lost along the way then go back and view the other video that will get you fully up to speed we'll go back to the Chart platform we're gonna select the condition so we're gonna select a study and just like we search for stochastics on the chart study we're gonna do the same here stochastics full and we want the full K is greater than and then from the right hand side menu we're going to select study search for stochastics full so we've got basically the same study on both sides we're going to change is the plot so on the left side we're comparing the full kay plot and on the right side we're comparing the full d plots we're saying full K is greater than full d hit save that's it you're done okay so that's our condition for stochastics for K is greater than stochastics full D we're gonna hit apply and okay and then apply now you don't see anything on the chart because this is now plotting on the top price graph so we're going to click and drag that down to a lower sub graph and we're gonna hit apply and now we can see and we head okay to clear up the edit strategies window and now we can see that this condition is true or or one you see at the top here it's 1 and over here this is 0 so it goes from 0 to 1 when the full K is above the full D okay so when this condition is false we know that the full K is below the full tee it's either true or false and that's all we need so now let's see how we take this code that was created in the condition wizard and you didn't have to write any code did you know all you had to do is click the mouse and we're gonna take that code and we're gonna drop it into a custom column on a watch list and then I'm gonna show you how to add in those little bits of code that help us to change the background color so we can see it on the watch list very clearly so what we'll do is we'll go back to studies edit studies and we'll click the script icon and this is the condition that we created remember we created it using the condition wizard which is here what you just saw the platform automatically opens it up in the thing script editor so all we do is copy this so I'm gonna highlight that and select copy now we can press cancel we can cancel this we're going to now bring in our watch list now in order to add a new column to the watch list you're going to right-click over one of the columns any one of these symbol last and it change whatever columns you have in there right-click over one of these columns and select Customize so I'm going to remove this column this is a custom column I'm going to remove that because we're not going to be using that for this example and then you want to click this arrow you see what I've done here you can search for various columns that are built in but if you want to do a custom column you've got to go ahead and select this arrow and then go down here where it says custom quotes so when you see the custom quotes you go ahead and click that now these are your available custom columns ok and what you'll have is yours if you haven't created it yet they'll all start out this way there'll be custom 0 1 0 2 0 3 0 4 0 5 0 6 and so on I think you get up to 19 of them or something like that to begin with so what we're going to do is we're going to double click on this one here that's going to bring it over to the list of current set and then we're going to click on the script icon and that will allow us to go ahead and edit the code that's in that custom column now what we could do is erase all of this code in this section here which is the think script editor and go over to the condition wizard and build it just like we did for the chart study so you don't really need to do the first step which is to build it in the chart study you can do it all here right in your custom column of the watch list but I wanted to show you then how you can build it in the chart first so that you can see with your own eyes what it does how it displays on the chart and then go ahead and paste that code in I'm just gonna right click and paste so I'm pasting in the code that we created that's already applied to the chart in the lower sub graph now we're gonna apply and okay and then we're gonna hit OK and view the results look at this so you've got values zeros and ones okay that's true or false look familiar yes it's exactly what is displayed on the chart let's look at this one this one says 0 that's IBM so we'll click on that one lo and behold on the lower subgraph where we created our chart study it's set at 0 so everything matches up now I wanted to show you something that the chart is set the daily time frame I'm going to right click to customize and I'm going to go ahead and click on that script icon again and I want to show you here you need to make sure that your watchlist column is set to the same timeframe as your chart if you don't get things lining up and you're gonna be frustrated and you're gonna hate me so make sure that you set your custom column to the same timeframe that you expect to see on your chart okay so we'll go ahead and hit cancel here and cancel here all right there's one more thing I wanted to show you if you select an intraday time frame you're going to need to change your chart settings because anything on an intraday time frame the chart is going to default to set aggregation period at market open yes that's a setting that's a mouthful but that's a setting I'll show you how to get to it we go to style we go to settings and we go to equities equities options futures and Forex you have to set this separately for each one so we'll go to equities because that's what we're going to be looking at today and you see this little setting right here start aggregation at market open I told you it's there that's a setting by default it's checked you need to make sure that that is unchecked okay because every other tool on thinkorswim whether it be a study alert or a scan or custom watchlist column anywhere else in the platform start aggregation at market open is not available it's not available so the only way you can get your charts to line up with your watchlist and your skins and your study alerts is to turn this off on all of your charts very very very important okay so mine's already off I'm just going to hit cancel so let's see next step is we're going to change the color of the background of this custom column notice we've got zeros and ones so we're gonna add the assigned background color as a line of code to our custom wizard code and then we're going to put an if-then-else statement in there to change the color if it's one where it's going to be color green if it's zero it's going to be color red okay so what we need to do is right-click over the custom column name and we can select customize and then select it from the list right which is to click on the script icon and that opens up the code editor but I'm going to show you another way it's a little bit of a shortcut I'm going to cancel here I'm going to cancel here so if you've already added your custom column to the watch list and you want to edit the code within it or the aggregation period it's assigned to simply right-click on that column and select edit formula and instead of opening the intermediary window it opens this window so you go straight to it it's a little shortcut okay so you can name your columns here okay I'm not going to change mine because I like it to stay custom zero one I reuse this all the time for different projects that I do for folks and we're gonna go back to the think script editor and I'm going to show you now the small little changes now you're gonna have to touch the keyboard but I told you don't be afraid we're gonna write some code here but don't freak out don't don't turn off the video don't walk away in frustration just follow what I'm doing very slowly very carefully if you get lost just scrub back to this part of the video and watch it over again this is very very simple and very easy the first thing we need to do is we need to take this true/false condition that we created which is plotting these lines on our lower sub graph of the chart and plotting the zeros and ones and our custom watch list we need to assign it to a variable so in order to do that we need to define a variable okay so it's de f4 define it's short for define D EF and then we need a name so we're just gonna say my variable okay then we need an equal sign and we put spaces in between all of these notice there's a space between the Deaf and the in the variable name and there's a space between the variable name and the equal sign okay we got spaces in there and at the very end notice everything's in red and error it says invalid statement okay but I'm not panicked do you see me panicking no I'm not panicking because we need one last little bit here to complete it and that's a semicolon just put that semicolon on there the error disappears and now we've got a new error that says at least one plot should be defined okay so what we can do then is simply change this de f2 so we change the de f2a plot and now instead of defining a variable name that we then would have to plot and use somewhere else in our code we can simply do it all in one step all in one line let's go ahead and see what that looks like in the watch list we'll hit apply and okay and it looks the same doesn't it so that's exactly what we expect because we all we did is we changed it into a form that we can then use in another line of code so I'm going to go ahead and select edit formula we'll go to the think script editor and so we've got plot my variable this is the condition that we created using the condition wizard that we didn't have to write any code you got the semicolon at the end I'm going to press ENTER to create another line and what we need now is one of those function names let's go back to the thinkorswim website The Learning Center and we're going to use a sign background color I'm going to copy that so I make sure that I don't make any mistakes typing it and then we're gonna right click and we're gonna paste okay now let's go back to the website so that we can see how to use this you can see that in the example and I'll even copy and paste this let's do that let's copy and paste the example they gave because the example always works the example is always going to work so we go ahead and replace the code that I just put in there right click and paste in that example and it works okay but it's not connected to the variable that we're plotting it will just simply color everything dark red let me show you we'll hit apply and okay and there's our watch list column and everything is red but that's not what we want but I wanted to show you the effect of simply copying and pasting that code from the example given from thinkorswim into our code so we're going to go ahead and edit the formula again now we've got the think script editor is open by default the next thing we need to do is replace what's here with an if-then-else statement now perhaps for the benefit of our viewers who haven't done anything with code whatsoever I should give you an example and show you how to get there so let's do that real quick alright so we're going back to the Learning Center and we're going to click on the hamburger menu now the website address here I'll give it to you is w w TL c dot thinkorswim comm okay TLC that's that's Learning Center ok thinkorswim Learning Centres TLC alright so then you go ahead and click this little hamburger menu here and we're going to click here and what I wanted to show you is how to do an if-then-else statement so I'm just going to type if then we're going to go down here to reserved words and click on that and here you'll see several examples it's called syntax and these are examples of how to use the if then else statement ok so you can read through that if you get lost and you don't know how to apply this stuff this is simply here we'll just go ahead and copy this ok we'll copy that and we'll paste that right into the code that we're working with here paste ok so what that is I'm gonna what I'm gonna do now is I'm going to show you that you can put this all in one line ok so you can backspace ok and delete those character you can put the cursor here you can backspace put a space in there and now you've got a place to put your conditions and it's all in one line ok on the website they show it to you broken down line by line so you can see the different elements the if the N and the ELPS but here you can do it all in one line and that's what we're going to use in our sign background color so we're going to grab this right here just this little section here is all we need we're gonna copy that and we're gonna paste it right in here okay now we don't need this anymore so I'm going to delete that so what we've got is our if condition then expression which is the result okay what do I do when the condition is true else what do I do when the condition is false okay so for the condition guess what we're going to use my variable I'm going to copy that and we're going to replace this right here including the little brackets at either side right click and paste so now we've got an if statement that says if my variable is true remember my variable is either 0 or a 1 okay that's false or true then what then we need to add a color now do you remember what the color looked like the color is the word color dot and then we put in the color and then over here we're gonna replace this expression with the color red so color dot re D and oops I forgot to erase this little bracket here so I'm gonna erase that little bracket there okay and now everything is good now the colors you guys I realize I need to show you the color so we'll go back to thinkorswim Learning Center we'll go ahead and click on that little hamburger menu and I'm going to cut type in color here in the search and then we want to look at constants okay under constants we click on color and then here is a list of all the colors that we can use now we're using green and red so this is what happens when so you click on green here and you can see that there's an example of a color dot green ok that's how you find out how to use those colors I'll go back to our editor here and so what we've got is we've got a pot statement and it's called my variable and we assigned it the code that we created using the condition wizard and then we added a function called assigned background color and within that we created an if-then-else statement that says if my variable is true then color green okay else color red that's what that is now we'll go ahead and hit apply and okay because we want to view the results with apply and okay and now look at our watch lists now we'll go ahead and click on the chart so we can see that now what we've got this one here BHP is red so we can click on that remember we've linked the watch list to our chart I want to show you that that the watch list is linked to number nine and the chart is also linked to number nine so that way every time I click on the watch list it's going to bring up that stock on the chart so let's click on one that's green okay we got CL over here so that's green and you can see in the lower subgraph that indeed is true so every time the full Kay is above full D it's green every time the full Kay is below the full D it's red so there you go there you have it it's as simple as that now you can see that these values are a little difficult to see when it's green so we can change those values from white to black I'm going to show that to you next so for the color of the value that's displayed in the custom column we're gonna be using the assign value color and here's the example that's given in the thinkorswim Learning Center and what you have to do is assign it to a plot so you see they've got plot diff equals clothes - clothes from the previous bar and then what they do is they take diff and they assign value color okay so that's the syntax you take the name of the plot you put a period at the end of it and then assign value color and then whatever you have in parentheses here that is what determines the color that is displayed in the custom column so we're going to do a very simple example so we're going to go ahead and copy a sine value color copy now let's go back to our watch list and we're going to edit that column we're going to right click and select edit formula then we're going to add another line of code we're going to right-click and select paste we need my variable as the plot we're going to copy that we're going to put it in front of a sign value color paste and we're going to put a period between them remember that period is required so it's my variable which is our plot dot a sign value color now we need to open close and parenthesis we'll put those in and we need to end it with the semicolon notice every single line here has ended with a semicolon okay so every time you've got a new line it has to end with a semicolon now that is red because we need to include a color value so I'm going to do is i'm going to select color dot black and we're not going to confuse things by putting in an if-then-else statement here it's just going to be simply the color black and that's going to change the color of the values in that column from white to black so we'll click apply and okay and we can see the results here in our custom column of our watch list whoo guys you made it through the first example now I told you it was going to be painless I told you not to be afraid this is really simple code we're not going to get much more advanced than this but I wanted to show this to you very slowly very carefully step-by-step next we're going to get into some of these other examples so you don't want to be sure to stick around to see how you can use the condition wizard to build using the RSI we're also going to do an example on the V whap remember I showed you that we were going to cover that we're gonna use the TTM wave I might throw in one more as a bonus at the end of the video and so stick around ok we're going to cover those next and as I said I'm going to go a little bit faster for these next examples because we took our time on the first example went step by step very slowly and carefully to make sure that every detail was covered so I'm going to speed things up a little bit so we can cram as much as we can into the rest of this video if you get lost along the way during this portion just go back to that first example we gave watch that over again because I'm gonna be reusing those tools again and again for these next examples okay let's see the next step is to look at the RSI custom watchlist and we can see here the viewer that posted this question they wanted RSI above 68 and RSI below 32 they wanted red and green so in this example what I'm going to do is I'm going to say RSI above overbought or RSI below oversold so instead of using the values that the viewer requested which is 68 and 32 I'll simply show you how to use the values that are set for the overbought and oversold in the indicator so that way I can show you how to adjust the settings of each indicator while working in the condition wizard okay so once again let's get started by going to the chart and study edit studies and we'll go ahead and modify our little test study here and we'll build a new condition we'll go to the condition wizard and will delete the condition that we built for the previous example we'll click add condition and we'll select a condition based upon a study and we'll search for RSI where it is at the top of the list and we want the RSI value is greater than then we'll go to study all rights I and for this plot we want to select the overbought so we want to know when RSI is greater than the overbought well where does that value come from that value comes from a user input called overbought you can see it here that it's defaulted to 70 we're going to change it to 80 remember that setting because that's the value that is going to be used RSI is greater than overbought which is what 80 why because we changed it let's go ahead and save that condition okay so let's go ahead and add another condition and we're going to add this condition for the oversold okay so we're going to select conditions let study will search for RS I will select that again we're going to use the our site plot and we're going to say the RSI plot is less than and we're gonna select study search for RSI select RSI and then we want to go ahead and select from look for the plot we're gonna select oversold now the oversold defaults to 30 we're gonna change it to 20 so we're gonna use 80 for the over what and 20 for the oversold but we only need to change it for each condition let's go ahead and click Save and now we're done so we hit apply and now we just get a flatline ok now why is that we don't get zeros and ones instead we get a flat 0 that's because these conditions work together in other words this first condition is saying that RSI needs to be above 80 and the second condition says that RSI needs to be below 20 well it's impossible for RSI to be both at the same time so it's going to be false all the time but all we want to do is utilize the tools here to create the code for us and then we're going to assign them to variables as we did in the first example and then take those variables and use them in an if-then-else statement to color the background of our custom column so let's go ahead and look at the think script editor and you can see here we've got the word and separating our two conditions so we created this condition and we created this condition and they're both true/false conditions and you can see that the word and is placed between them so what we need to do is we need to get rid of that word and and we need to separate this into two separate lines of code so I'm going to press backspace on my keyboard and then I'm going to click right here right to the left of the RSI this is this is our second condition right here okay and what I'm going to do is I'm going to press ENTER and that creates it as a separate line now I need to assign both of these two variables remember that each of these is a set condition true or false and they can't be both true at the same time so what we're gonna do is we're gonna create variables remember I showed you how to do that in the first example we're gonna use the word de f that's short for define RSI above is the name of the variable I'm going to give it we're going to use the equal sign and then we're going to put the semicolon at the end see how that line now is accepted by the compiler and is no longer highlighted in red we're going to do the same to the line below it we can't use the same variable name so we have to use it one that's unique that hasn't been used before so we're going to use RSI below and we're going to put a semicolon at the end when I clean that up a little bit remove that space there and there you go so we've got no more red on the compiler and we are ready to proceed we've got two variables one is RSI above one is RSI below each of those conditions we set up using the condition wizard now let's put them to work okay so again I told you this is going to be a little bit more advanced and it is so I've created a plot this is going to be the value that displays in our custom column and it's simply called value it really doesn't matter what you name it if RSI above is true then we're gonna print a value to the custom column of one else if RSI is below is true then minus one so it's going to print a minus one to our custom column in a watchlist else zero so if neither of these two conditions are true we're going to print zero so let's hit apply and okay and let's hit apply and okay we're going to need to go back to studies at its we're going to need to remove the stochastics and add the RSI to our chart and then we're going to need to adapt adjust the inputs for the overbought and oversold 80 and 20 so that we match the conditions that we set up so now we've got the RSI at the bottom and you notice that for this portion of the chart the condition is never true it's always false and hit ok here to move the code editor out of the way and you can see that the RSI is neither above or below oversold or overbought for the entire span here so we can scroll back and look to see if our size ever outside of either of those two lines and it's not so that's why the condition this blue line here from the results of our code is always zero so let's click through our let's bring a watchlist in here we're looking at COP let's start at the top here and and look through a few of these charts and see if we can find one where there we go so we've got one here we're on Baidu for instance the RSI was below the over sold line and what did we tell our code our code says when the RSI is below the oversold we're gonna print minus 1 on the column in our watchlist and here it is the spike showing down to minus 1 let's look at a few more here and look this one here shows that it was above the overbought condition for several bars in a row so you can see that this indicator here shows that it was a plus 1 for all of those bars in which the RSI was above the over bought condition so let's go ahead and grab that code will go to studies edit studies we'll click on the script icon and we'll copy that code and then we'll paste it I like cancel here and cancel here we're going to right-click over the column name we're going to edit the formula and we're going to replace the code from the previous example with the code that we just created and we're gonna hit apply and okay so you can see these are all zeros now oh we got one here okay ticker symbol M and that is set to minus one so if we click on that we should expect to see the RSI is below the over sold line and yes indeed it is for the last three bars so now let's go ahead and see how we can modify this code to color the background we want to have red if it's above the overbought condition and we want to have green if it's below the oversold condition and we want it to be the current color which is black if it's neither let's see how we do that we'll right-click and select edit formula now we go back to the thinkorswim Learning Center and we're gonna go back to where we had the page for assigned background color we're gonna copy that in fact let's just go ahead and copy the example that they gave us just like in the first example we're gonna create a new line so I'm going to press ENTER and then we're gonna right-click and select paste so now we've got a statement that will assign all the rows of that custom column to dark red which we don't want we want to create an if-then-else statement just like we did in the first example if value equals one then color green else if value equals -1 then colored red else color dot current what we do by using the color constant called current that will display whatever is default for the color scheme that's selected remember the user might be able to select the dark or the light background for thinkorswim and that may change the color of the background on the custom column so rather than fixing it to something that fits one color scheme let's put it to current that way it will pick up whatever is valid for that particular color scheme the user selected okay so we go ahead and click apply and okay and when you have an item selected like we do here for the ticker symbol M then you don't get to see the color of the background that's one of the flaws I feel it's a flaw in in the tool so let's go ahead and click off of that and you can see that it's indeed coloring that that red and everything else is the current color which is black okay so we could go ahead and update our code we go to edit formula and you can see here is where we have the overbought set to 80 and the oversold is set to 20 let's go ahead and change those values let's make this one 60 and let's make this one 40 and what I'm trying to do is I'm trying to make it easier for one of the stocks in the list to qualify as overbought or oversold so we'll hit apply and okay and sure enough we do so let's go back to our chart and adjust our settings for that study we're gonna need to do it here just like we did for the custom watchlist column and then we're going to need to do it again for the RSI study that's listed here that way everything is lining up exactly the way it's written okay so you can see here now if we click on Baidu we should see that that is below the oversold and yes it is if we click on Capote Li here CMG we should see that it is above the overbought which it is okay and you can change the background color from from white to black if you wanted to and just like we did in the first example but in this case if you changed it to black then you wouldn't be able to see these values where the background color is black so let's go ahead and edit the formula and see how we do that remember we're going to go back to the Learning Center for a thinkorswim we're gonna select a sine value color and then we'll go back and we'll go ahead and paste that in as a new line of code and we're gonna select if value equals double equal okay equals zero then color dot current because we don't want to change it else color dot black okay so it's a very simple if-then-else statement and I misspelled the word black let's fix that and we can see that it's red and the compiler is giving us a warning here a sine value color should be called on a base plot all right so what does that mean that means we need to take our plot which is value copy and then we need to paste that in front of a sine value color and what's next we need to put a period there because that allows it to say assign it's basically saying assign value color to what assigning the color to what well we have to tell it so we're telling it to assign the value to that valid that plot okay so it says basically if the value is zero then use the current color which is white otherwise change it to black so we'll hit apply and you can see immediately that everything that's highlighted in red or green the text color is black everything else the text color is white okay that's all we have for the RSI example next we're going to go on to the background color for the V whap so stay tuned we're going to cover that next okay so we're going to need to add the view app indicator to our chart and then we're going to need to update the code that we have so we have our we're gonna build our condition using the condition wizard so let's go to studies and edit studies we're going to remove the RSI by clicking this X and then we're going to add the V whap study so let's go ahead and search for V whap there it is and this is set to day we want to make sure that we understand what it's set to so and this is a daily chart so that's probably not going to work we need to set this to higher than daily okay we'll set it to week and then we'll click OK and then we want to update our code but let's go ahead and hit apply so we can see the changes so we've removed the RSI and now we have added the V whap to our chart so let's go ahead and build this in the condition wizard on our custom study we'll click on the script icon and we can go ahead and erase all this code right now the condition wizard is grayed out it's disabled because we've got regular code in here and the condition wizard that doesn't understand that code so we're just gonna hit the backspace to delete all of that and it's going to open up that condition wizard so that we can go in and add a condition we're gonna select study and search for V whap actually I did that backwards first we're going to select price and close there we go because we want to know when the closing price is greater than and then we'll select the V Webb study and there we are now notice there's a couple of other plots here so if you wanted to select the upper band or the lower band of the vo app you can do so here remember on the chart we have the chart set to daily so we had to change our timeframe to two week all right so we're gonna update that here on the condition wizard we're gonna hit save and you can notice that it's already inserted that parameter in the code so it builds the code for us let's go ahead and hit apply and okay and we can go ahead and review and see how this works out so we've got a value of zero remember is false so the close is below the V whop here and then here are the close is above the view app so here you can see the indicator is a true false indicating whether the price is above or below the V web now let's go ahead and grab that code and insert it into our custom column we're going to studies edit studies click on the script I con there and then we'll copy that code hit cancel and cancel we'll go and edit the custom column edit formula and then we'll select all of this and remove that text and select paste alright so now our custom column and our watch list if we hit apply and okay is going to have ones and zeros just like it shows on the lower study of our chart so let's look at bhp it says zero so if we click on that sure enough it has zero on the lower sub graph here so now we know everything is matched up and so we can see it's zero because the price is below the V whap line so let's go ahead and right-click and select edit formula because now we're going to assign the background color we're going to go to the think script editor we're going to create a new line then we're going to go back to the thinkorswim learning center and we're going to copy that code assign background color I'll paste that okay the other thing that we need to do I forgot to do this we need to assign a variable so let's see we're just going to call this value it doesn't really matter what the name is here and we're going to put a semicolon at the end remember that's required so now we've got a plot let's change this from death to a plot yes so now you can see we've got a plot name value that has a true/false result so we're going to copy that and we're going to insert here into this parenthesis we're gonna say if value so I'm just pasting there equals 1 then color green color dot green else color red now technically we could end up with something here where the price is equal to the V whap in which case we wouldn't get a true or a false right because we're saying if value equals 1 and if not color red so it could be equal to and you know if you want to cover that you can get fancy and add another section there for the purpose of the video and keep things brief let's just leave it as is and remember we want to go ahead and also update the value of the text that's displayed in that column so we're going to copy a sine value color remember we need to assign that to a plot so we type value we paste assign value color if value equals 1 then what do we want we want color black else color what color current okay so we've done all of that together in one step let apply and ok and now let's go ahead and go back to the chart and we can click through some of these you can see really clearly eBay is above the V whap just barely you can see that on that last bar right there and you can see that Facebook for instance is below the V web okay just just barely below the V web so but that makes it really easy to see and you've got all your colors they're displaying in the custom column so you know exactly what the condition of that stock is ok so next we're gonna cover the Wow we're already up to the TTM wave yeah so we're going to cover the TTM wave next and where that one it shows red or yellow depending on the position of the histogram and let's see what the user requested here could you write a simple code they always say that the use word simple - custom color watch list columns based on the TTM wave 1 which is the one that's red or yellow if the current bar wave one is greater than the one bar ago then color yellow else color red ok so we're going to show how to do this with the conditional wizard this is how I did it just writing the code from memory just because I know how this stuff works ok and let's go ahead and go to the chart we're going to update our chart we're going to remove through edit studies the view app and then we're going to update the code but first let's go ahead and add the TTM wave now all we care about is the wave 1 which is the yellow and the red so we're going to turn off the wave 2 and we're going to turn off the wave tool Oh okay so we're turning off the wave - hi and the wave tool oh ok we hit OK and then we hit apply now we've got that in the lower study now we're go ahead and build our condition so we go ahead into the custom study that we have here and we can go ahead and go to the condition wizard we can delete the one that's there add a new condition again I'm going fast here because we're nearing into the video but if you need to get lost again go back to that first example where I covered everything step by step very slowly let's see now we need to know if the study named TTM wave and we need to know if the current bar of the TTM wave notice the offset is set to zero so we're covering something new - new concept here offset okay it is greater than and we're going to select the same study okay and it's the same plot so we're dealing wave one and wave one or saying if the wave one of the current bar is greater than that the wave one of the previous bar okay so that's plus one the offset is plus one it might seem like you need to put a minus one there but no I'm sorry you put a plus one in there and you hit save and watch what happens it says TTM wave 1 is greater than TTM wave one from one bars ago there you go so now let's go ahead and hit ok applying okay and we can see that on our special custom indicator that it's every time the indicator is red on the bottom we have a zero plot and every time it turns to yellow the plot moves from zero to one ok so now we can go ahead and insert that into our custom column we'll go to edit studies click the script icon copy this code I'll cancel and cancel we'll right-click over that column in our watch list edit the formula we'll select all of this text here and we can paste in the new text we can hit apply and ok and then we can see a series of ones and zeros like for instance s is 0 so if we click on Hess we see that the histogram is currently red and if we click on Nike the histogram is currently yellow just like it shows in our column of our watch list so now let's add some color to this well right-click and select edit formula and go to the think script editor we're going to create a variable so we're going to assign this true/false statement to a variable named value again I said it doesn't matter what you name it we're got to put a semicolon at the end we're gonna add a new line so that we can add our background color and I just remembered we need to change this to a plot because that's going to end up being the value of our custom column let's go back to the thinkorswim Learning Center and copy that code that assigns the background color and we'll go ahead and paste that in and right now it would set everything to dark red but we don't want that instead we want to do this if value equals one then color dot yellow else color dot red now that probably looks like a dark red to me so let's go ahead and put that in there and see if it lines up we can change that later and again we also want to change the color of the value that's printed in there so we want to go ahead and copy that from the thinkorswim Learning Center and in a new line we want to type value the name of our plot put a dot in there and then we'll paste in the assigned value color and we want to say if value equals one then color blackk else color dot current so you see if after you've seen this about you know four or five times then it's you can kind of anticipate what I'm going to do next right so so this becomes easier with practice so just watch the video a couple of times and make sure you get enough practice in and if you get frustrated just post a question in the in the Q&A forum on our website and we can help you the rest of the way let's go ahead and hit apply and okay and look at that we've got everything set up and the colors are in alignment we can click on Twitter we can see that the histogram is red we can click on Starbucks here and we can see the histogram is yellow and you can do even a little bit more if you wanted to know for instance if it was yellow and above the zero line or if it was yellow and below the zero line if that made a difference to you then you can see how that logic you know you just construct and more complicated if-then-else statement okay that's all you would need to do for that so let's see I did say that I was going to give you a bonus I didn't mention what I was going to cover but I think I've got it in mine now let's go ahead and get into the next example okay and thanks for sticking through through that break there and I'm very grateful to be able to share this knowledge with you and show you guys this stuff and for the last example I'm going to take one of John Carter studies it's the linear regression channel it's TTML RC we'll go ahead and add that to the chart will go to studies edit studies remove the DTM wave we'll go ahead and add in the lrc there it is right there and I'll go ahead and review the settings because it's very important that you understand something here and that is the length okay so the length is set to 50 right now okay and that length is very very important because the the line is computed based upon that length okay the line is going to change in other words the upper and lower bands are going to change depending on that length so you want to make sure you absolutely get that matched up for each step along the way okay so remember that it's set to 50 we're gonna hit okay and we'll hit apply so we can see the result so now you can see we've got the two lines on here let's go ahead and hit OK here and move the watchlist out of the way so you can see that for the last 50 bars it plots the lrc alright so what we want to do is capture whether it is above or below these lines now I've got some lines turned off here let's go to studies edit studies and go ahead and hit the gear icon here and I want to show you that the upper band and the lower band are turned off okay I'm only displaying on mine the outer bands let's say I've got the inner bands turned off the outer bands are turned on and I've got that set up as a default for my platform you can set it however you want but I just wanted to point that out okay so we are dealing with u b2 and LB - okay so I just wanted to keep it clean I didn't want to put four lines on the chart and confuse people just keep it nice and clean so we'll go ahead and hit cancel now we want to build our condition so our lower study is going to show the condition based upon the TTM lrc so click on the script icon and we'll go to the condition wizard will delete the condition that's there from a previous example we'll click add condition what we need is the price of clothes is above is greater than and then we select our study from the right-hand side okay LRC okay make sure see the defaults 38 remember I pointed that out you want it to make sure it's set at 50 and what we want is you be to alright that's the outer band of the four sets of lines there that's the outer band so we're saying if closed is greater than the upper band two of the LRC save that condition will add a new condition and we'll go ahead and select price and closed is less then select the condition we'll go to study LRC make sure you update the length there from 38 to 50 and remember we're going to use the plot is lb2 so we want to know if closes below lb2 I'll click Save now remember these two conditions are impossible to happen together okay so you could never build this into a scan because it's always going to be false because the price cannot be both above the upper band as well as below the lower band at the same time unless those no it's impossible okay so we're gonna hit apply here and it's going to give us a flat line don't worry about it because we're gonna fix it just like I did in a previous example we're gonna have to do is take these two conditions and separate them out into individual variables and then we're going to set up our if-then-else statement to change the background color so what we want to do is go to the think script editor and we're going to split these remember from the previous example the word and is a key word that separates these two conditions we're going to remove that by pressing backspace on a keyboard and then we're gonna press enter here where the cursor is right next to the close press Enter and that gives us a new line now each of these lines are going to be an individual variable so what do we want we want to have define a variable named above okay and we put a semicolon at the end of that so that's good to read one away so that's good we define another variable and we're gonna call that below we have to put the semicolon at the end so now we've got two variables one is named above the other is named below and remember they both can't be true at the same time each one represents something distinct and different that we want to capture with our custom watch list let's go to the thinkorswim Learning Center and we're gonna grab the example here for the background color remember I said after you see this a few times you're going to begin to anticipate exactly what I'm gonna do next so we're going to paste that in and then we need to set up our conditions so we're gonna erase all of this and we're gonna say if above then color what is that that's a short that's a potential short right so then color red if below then color green because that's a potential law now I'm not telling you how to trade this indicator I'm just simply explaining to you how it's intended to be used JOHN CARTER teaches is that when it goes above one of these bands it's time to you know exit your long or take a new short okay I want to get into this you know I'm not teaching you how to make money or trade this for money I'm just showing you how it's how it's used by the professionals so we have if above notice I don't have any equal signs there that's because above is a true false statement so it's if above is true then color red if below again that's a true false statement if below is true then color green now we need one more notice it's still red it's waiting for me to finish this statement else okay if it's neither it's not above or below then what we want color yes you got it color current okay and you want to make sure that if you're building that nested if statement and that's what this is called I forgot that one else portion right there so if above then color red else if below then color green else color current so that's what's called a nested-if statement this if and then okay is nested within this one okay so that might be a topic for another video I hope I didn't just blow your minds okay sorry okay so we got our background color let's go ahead and put in our text color so let's go back to the thinkorswim Learning Center and we'll copy from the assigned value color and we need to have a plot so let's go ahead and create a plot we're gonna call it value equals if above then one else if below then minus one else zero so now we have our plot so that's going to display on our custom watch list column and if above is true in other words if the price is above then we probably want that to be - huh yeah so because that represents a short position and it'll change this one to positive okay I always like to think these things through even when I'm writing code for a project I'll sit here and I'll think to myself gee is that right now read it to myself just like this so if above is true meaning if the price is above the outer LRC Channel then minus one else if below if the price is below the outer lower channel than one okay otherwise zero so that's going to give us our values and our custom watch list and then remember we need to assign this so we a value dot assigned value color and then what we want is we want to say if value equals zero then color current very good for those of you who got that color current else so if it's not zero then it's something else and what we want is color black so that way it shows up a little bit more clearly on the watch list and we finished that up with a parenthesis and a semicolon so let's go ahead and hit apply and okay and check out our results so and I just realized I built this all within the custom study so we're gonna copy all of this code and we're gonna paste that into our custom column so I'm gonna hit cancel here and I'm going to cancel here and we'll bring in our custom watch list that has the code from our previous example my edit formula and then we'll highlight all of this text from our previous example and we'll paste in code that we just created so that apply and okay and you can see that we've got a few here we've got em oh I think that's mosaic I think is what that stockticker means so that's a plus one what does that mean that means price should be below that outer band of the LRC woops let's go ahead and update that study over the chart edit studies and edit studies and I'm gonna go ahead and take out that assign background color sorry about that guys don't worry it's just a happy little accident and learning that from bob ross right if you make an accident it's easy to fix so you hit apply and okay and apply and okay alright so there we go we've got the price is below that outer band of the LRC and that was indicated by a green on our custom watch list now we don't have any Reds here so we don't have an example of that but you can see that if you click on one that's that's a blank in other words it's not green or red the price is going to be between those lines if you had anything in here that we're red it would surely be above the outer band so here's that one chevron and you click here and you can see that price is below that outer band okay that's kind of a rare signal that's why you don't have too many here showing up on the on the list because the outer bands are the ones that are that are farthest away those are the most rare if you if you did this with the with the inner bands let's do that real quick as a bonus here we're going to close up this video here I'm already way over the time limit that I want it to be so let's go ahead and change this I'm going to show you how to do that because we can't do it through the condition wizard anymore because we modified the code we're gonna change this to you b1 we're gonna change this to UB lb-1 and apply and okay and it's going to update now we've got a lot more color on the chart and we've got some greens and reds so now let's update our chart and we go to studies at it studies and we'll go ahead and turn off you be well - and LB - and I'm gonna turn on lb 1 and UB 1 okay so I'm gonna ply and okay so now you can see that we've got the inner bands are plotted on the chart so if we go here to see e LG you can see that it is above that that inner top line and if we go to Yelp you can see that it's below the inner lower line okay so hopefully that didn't confuse to many of you I just wanted to show you some of that stuff some of the more advanced stuff because I know there's there's a lot of there's wide variety of viewers that I'm talking to here and I know some of you are just barely able to grasp the first example I gave and if you tough toughed it through the rest of the video and you're looking at this advanced stuff and pulling your hair out don't worry about it this was for the people who can who can move on to that next level go back to the first example practice a little bit more watch the video a couple a few times it will come with practice okay it will come with practice so guys I'm just so excited I've got goosebumps I'm so excited that I've been able to share this knowledge with you and I sure hope that you guys are going to be able to build some fantastic tools that save you time and make your trading so much more effective and efficient thanks for watching guys appreciate your support take care everyone thank you for watching this tutorial video be sure to visit w-w-w this video increases your knowledge and helps you become more efficient with this topic whether for home or work please support this channel by sharing these videos with your friends and colleagues thanks and take care
Info
Channel: Hahn-Tech, LLC
Views: 19,573
Rating: 4.965909 out of 5
Keywords: Thinkorswim, Condtion Wizard, Watchlist, chart study, chart analysis, chart indicator
Id: DplSEPkv7kU
Channel Id: undefined
Length: 74min 7sec (4447 seconds)
Published: Sun Aug 18 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.