How to Use ThinkorSwim Stock Hacker Scans

markos

Well-known member
VIP
This video shows how you can use the Stock Hacker in ThinkorSwim with most of the indicators posted on this site. It allows you to scan for new signals on your chart.

In this specific video:
  • I used the RSI 2 indicator as an example
  • The timeframe was the Daily chart
  • Scan within 1 bar (which means the current day)
  • Scan for both up and down signals on the S&P 500 Watchlist

#Mobius for Marshall ed by Markos TSL 11:15am 1-2-18
  1. Use the Scan Wizard
  2. Select Add Study Filter
  3. Click the pencil next to "D" on the right side
  4. Delete Study
  5. Add Condition
  6. Add Study
  7. Scroll to DIPlus (or your study) and add
  8. Center Column click Greater Than (or your study)
  9. Right Side Click Add Study
  10. Scroll to DIPlus (or your study)and click Offset1 (or your condition)
  11. Set Aggregation Period
  12. Select the Scan In List
  13. Select the Intersect with List
  14. Scan
More tutorials on how to use the ThinkorSwim Scan tab can be found here: https://tlc.thinkorswim.com/center/howToTos/thinkManual/Scan/Stock-Hacker
 
Last edited by a moderator:

tomsk

Well-known member
VIP
Just to be sure that EVERYONE understands how to interpret this, at the end of the scan there is a section of code like so:

# Comment out (#) the ONE not needed
plot BullScan = close crosses above SHigh;
#plot BearScan = close crosses below SLow;

Notice that there are some lines that are commented out with (#) - Those would be ignored by the scanner, only for human consumption
In the above example only the bullish scan is enabled.

In order to turn this into a bearish scan, just switch the commented lines like so

# Comment out (#) the ONE not needed
#plot BullScan = close crosses above SHigh;
plot BearScan = close crosses below SLow;

Compare those differences - it really is that simple.

Just REMEMBER that there can only be one active plot defined or the scanner would complain.

@BenTen many thanks
 
Last edited by a moderator:

HighBredCloud

Well-known member
VIP
@BenTen Yeah...perhaps you're right...I did read about it repainting. I just wanted to know that I was able to input everything correctly into the scan as I have never done this before. ANYWAYS...do you know of ANY good scans such as % gainers and losers but ones that show up practically at opening bell...and not hit later on such as 15 to 20 min into the market open such as the % gainers/losers found in default TOS scan... I guess what I am looking for is stocks that are going either up or down premarket and continue on that trend once opening bell rings. Would the HULL scan be more suitable for such a scan or are there better scans out there that I am not aware of? I
 

tomsk

Well-known member
VIP
In the past several years I have seen several versions of premarket gap up and gap down scans that Mobius had posted. You might like to check out the OneNote archive that @markos posted before. I'm almost positive it is archived there.
 

HighBredCloud

Well-known member
VIP
@tomsk I will look for them...Thanks for the suggestion. Would I import them the same way as this particular scan and under conditions also select "True" as BenTen suggested? Sorry for all the questions...I never used custom scans before...only ones I set that met my criteria...
 

tomsk

Well-known member
VIP
You will find that all the scans that Mobius writes are simple and effective and undoubtedly produce results. Hence you will not need to reference them as a separate study but import it directly into the scanner. Since you're new to scans, you might like to read up this great tutorial that @markos wrote.
 

HighBredCloud

Well-known member
VIP
@markos Not sure if you want to talk about the following here or if it would be better to make a separate post...but after reading the ONEDRIVE...I think it would be important to include and touch upon the differences between the LAST price vs CLOSE price when scanning as well as VOLUME vs AVG VOLUME...Something to note would also be what is best setting is as far as periods go...default is set to 50 SMA...

As far as the custom scans that were developed by many here. I think it would be nice to clarify if it's better to run the scan as a study as shown in the video or simply imported the study using the ThinkScript as suggested by some coders...It can be a bit confusing for a new user to the scanner especially with what conditions need to be added for the scans to work properly.
 

mmm777

New member
2019 Donor
In scan, is it possible to set up condition like scan stock in SPY (the stocks in ETF SPY or stocks in ETF IWM)?
 

BenTen

Administrative
Staff
VIP
@mmm777 You can choose the S&P 500 Watchlist that ThinkorSwim provided and it should let you scan for stocks in the SPY.
 

HighBredCloud

Well-known member
VIP
I have been looking for a Hull Moving Average scanner and I have found this scan on here below: I was told that in order to use this scanner I first need to save it as a study then open it as custom then study and edit condition to (is true) (within 1 bar). Please see the pic below:

5JChyVR.png


When I called TOS I was told that because this is a moving average study I need to use (cross below) for a bear scan and or (cross above) for a bull scan under the edit conditions. Also I need to set the other conditions to as follows...Please see pic below:

NjEvcpc.png


So which is right? setting the edit condition to true or setting the conditions to cross below or above depending on bull or bear scan as per TOS instructions.

Not to further complicate things...but TOS also has their own Hull Average Change option under Study ---> Price Performance ---> Hull_Average_Change. Please see pic below:

cjYLquR.png


The weird part about all this is when I run the custom scan under the same parameters such as 15 length 1 hour scan...I get different results between the Hull Average Change TOS scanner vs the Hull Moving Average Scan that I found here...Please see pic below: Why is that IF all parameters are the same?

uuazxrV.png


Lastly...I heard and or experienced that when scanning for moving average cross overs not so much a Hull Moving Average scan...that the results can be delayed anywhere from 2-3 bars depending on the timeframe. Meaning that if you select a 1 hour time frame...such a delay can be 2-3 hours...Is this true? If so do I need to scan lets say on a 15 min timeframe to get the results desired for a 1 hour time frame? I thought that such results would be in real time or with a 3 min delay as per TOS scanner updates once the condition of Hull Moving Average were met on a 1 hour timeframe...

Perhaps I am doing something wrong here...anyone with experience can you please clarify this? I have read over the section that @markos wrote on the scanner...but none of these questions pertain to what I am experiencing here. Thanks in advance.

Code:
# Basic Hull Ma Pack tinkered by InSilico
# Original Port from https://www.tradingview.com/script/hg92pFwS-Hull-Suite

input modeSwitch = {default "Hma", "Thma", "Ehma"}; #Hull Variation
input length = 55; #Length(180-200 for floating S/R , 55 for swing entry)
input src = close; #Source

def hma;
switch (modeSwitch) {
case "Hma":
    hma = wma(2 * wma(src, length / 2) - wma(src, length), round(sqrt(length)));
case "Ehma":
    hma = expAverage(2 * expAverage(src, length / 2) - expAverage(src, length), round(sqrt(length)));
case "Thma":
    hma = wma(wma(src,(length/2) / 3) * 3 - wma(src, (length/2) / 2) - wma(src, (length/2)), (length/2));
}

def hull = hma;
def transition = hull > hull[2];

# Delete (#) the plot not needed

#plot scanBull = !transition[1] and transition;
plot scanBear = transition[1] and !transition;

# End Basic Hull Ma Pack Scan
 

BenTen

Administrative
Staff
VIP
You should use the "True" statement when there is an arrow or an indication on the chart. For example, if there is a function in the code that plot an arrow every time the price crosses above or below the moving average, then in the Scanner, you would want to use the "True" option. If there isn't such a thing, you will have to use "crosses," "crosses above," or "crosses below" in the Scanner.

Looking at the source code, it already include the scan snippet for you.

As far as delay time, it's between 5-10 mins; it doesn't matter which timeframe you're using.
 

mcfaul100

New member
Does anyone know how to run a Zig Zag step pattern scan in think or swim? I haven't been able to do so myself. It always timesout. thanks
 

toopoor88

Member
I don't know why I don't get how to use it but how do you make a scanner that will just scan stocks that either closed above or below 1 moving average. Like for example, how do I scan stocks that closed or below an EMA set to 200? All I see in the scanner is crossover of two moving averages. Can anybody assit me on how to do this?
 

Trading51

Active member
2019 Donor
Guys I need some help, I need some basic info on how to set up a scan, like where to put the code and all, etc please thanks a bunch.
 

MarkB

New member
I am looking for User interface (UI) help with Custom Study Filters for Stock Hacker.
Mainly, I am trying to figure out how to get Stock hacker to display the user input (UI) controls for my custom study filters instead of just displaying the underlying code.
To illustrate what I am saying, I have included a screen clip which shows 2 filters in Stock Hacker.

maUbLGr.jpg


The filter in top row is the Average_Volume one included with Stock Hacker. As you can see, the row includes
DropDown controls as well as numeric input controls which can be adjusted directly in the row
The filter just below it (i.e. the 2nd row) is actually just a copy of the Average_Volume filter which I
customized slightly. As you can see, it does not have UI controls, it just shows the underlying code (i.e., "#Wizard text...")

I have noticed that as soon as you modify one of the filters they stop showing the UI controls and just show a concatenated string of all the underlying Thinkscript. In the case shown here, even when I modify the 2nd row back to the way it was so it matches the one above it, it still shows just a string of Thinkscript.

Now, if I click the little pencil icon for either, then I get a dialog where I can modify the user inputs.
However, what I would like is to know how to get my custom study rows to show UI controls that I can tune as needed.
This will make it much more user friendly and as well as make the filters much more readable.

I have not been able to find any guidance documentation on "#Wizard Text" or "#Wizard input" and perhaps these are just code comments.
So, essentially, I am trying to figure out how to get stock hacker to display UI controls and labels based on my inputs and text strings.

Can someone tell me how to do this or point me to any Application Programming Interface (API) docs for Thinkscript which might explain this?
I have tried looking at their documentation but I did not find any guidance on this topic.
At first, I thought it was just a limitation of custom filters. However, I have seen that others have shared custom filters and been able
to get theirs to use UI Controls so there must be a way.

Any help with this will be much appreciated. Thanks.
 

allnetbrett

New member
Hey everyone, I am totally drawing a blank. I cannot for the life of me figure out how to load a scan or watchlist after I upload the TOS code into TOS. Can anyone help?

Sorry, I am sure this is remedial, but cant figure it out
 

Similar threads

Top