New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.

How do Scan symbol

what is the syntax of scan for $TRIN closes above 1.00 ?


  • markdmarkd mod
    edited June 19

    [symbol = '$TRIN']

    and [close > 1]

    Then again, you could just look at the chart for $TRIN.
  • Thanks markd

    I am writing a scan alert as below:
    Stockcharts do not have S&P TRIN. But I would like to reference S&P to define the trend. Here with 2 different symbols, will the scan run properly?

    [symbol ="SPY"]
    and[close > SMA(200,Close) ]
    and [RSI (2,close) < 50]

    and [symbol = '$TRIN']
    and [symbol = '$TRINQ']
    and [close > 1]
  • Green_DLGreen_DL
    edited June 19
    I have re-drafted the scan as follows :

    [[symbol ="$COMPQ"] and[close > SMA(200,Close) ]and [RSI (2,close) < 50]]

    and [[symbol = '$TRINQ']and [close > 1]]

    the indicator should be aligned with the symbol. SPY do not have TRIN, which cannot be used.

    Am I correct?
  • lmkwinlmkwin ✭✭
    You CAN do this sort of thing for multiple single symbols in a scan but you would have to use syntax that allows one OR the other, or BOTH to be returned.

    [[symbol = '$COMPQ'] and [close > SMA(200,Close)] and [RSI (2,close) < 50]]

    or [[symbol = '$TRINQ'] and [close > 1]]

    This is a method that I use as well for various things. In the last few updates on the StockCharts website they added expanded Alert functionality.

    You can set up 200 price alerts at the Extra membership level. The $TRINQ is an example of a price alert.

    The COMPQ would be an Advanced Alert as it is looking at more than just price considerations. You can set up 100 Advanced Alerts at the Extra membership level.

    [[symbol = '$COMPQ'] and [close > SMA(200,Close)] and [RSI (2,close) < 50]]

    The Advanced Alert is set up with the same scan workbench option showing and you pick and choose what you would like. You don't have to set up the alert for a single symbol either. You can set it to show pretty much any condition for any universe you select. It's extremely flexible.

    I recommend setting Alerts for things that you don't regularly scan for and just want to be alerted to.

    Now, here's the fun part. You can take ANY working Scan that you have and COPY the code into the Advanced Alerts and save the Alert to run daily. You now have Alert Code and Scan code saved. IF you change the Scan code, it does NOT update the Alert code. They are two separate things.

    I would suggest that if you set up an Advanced Alert, that you copy and paste the code into the scan workbench and run it to see if it is producing the results that you like. If it is NOT producing the appropriate results, modify it in the Scan Workbench until you are happy with it. Then Copy the Scan code into the Advanced Alert and save the Alert.

    I actually save the Scan and the Alert with the same name so that I can quickly find and refine and update the codes appropriately.

    IF you were to set your scan up as a Scheduled Scan, and you change your scan code, the Scheduled Scan updates to the new code, but Scheduled Scans have there own idiosyncrasies to consider.

  • Thanks Imkwin

    I use "AND" for the symbols $COMPQ' and '$TRINQ' because I would like to scan the TRINQ indicator of COMPQ. The TRIN of CMPQ closes above 1.00 and with the additional condition of the index is on uptrend. I thought they were referring to the same index of stocks. Am I interpreting correctly?

    What does idiosyncrasies mean?

    I try to google it.
    "What is an example of an idiosyncrasy?
    Putting salt in your hot chocolate or needing the light on to sleep or tapping your head while you think are all idiosyncrasies. A machine such as a DVD player has an idiosyncrasy if you have to do something weird to it to make it work like having to bang it on the back left-hand side to stop it from skipping."

    I still don't have a clue 🤷‍♂️
  • markdmarkd mod
    edited June 20
    The scan engine is designed to return a list of symbols only, like IBM or SPY - anything in its database - but NOT numbers or things like TRUE or FALSE.

    When you use "AND" each symbol the scan engine selects must fit EVERY condition in the scan.

    So, if your scan says


    and [symbol = '$COMPQ']


    and [symbol = $TRINQ']

    well, for symbol $COMPQ the statement "symbol = $TRINQ" is not true - because the symbol for $COMPQ is $COMPQ. And, because it found a statement in the scan that is not true for $COMPQ, it will not return $COMPQ.

    Then, for $TRINQ, the statement "symbol = $COMPQ" is not true, so the scan will not return $TRINQ.

    With "OR", its different.

    If you say

    [ [symbol = '$COMPQ']



    [symbol = $TRINQ']

    ... ]

    then, if the other conditions for $COMPQ (not shown) are true, it will return $COMPQ; the "OR" says that the conditions for $TRINQ do not have to be true for $COMPQ.

    Likewise, if the other conditions for $TRINQ are true it will return $TRINQ.

    If the other conditions for BOTH $COMPQ and $TRINQ are true, the scan will return BOTH symbols.

  • Idiosyncracies: mannerism**, peculiarity, traits. They are little Unique things that make You You
  • People who Always chew Bubble gum with their Mouth WIDE Open at the University Library while you're Trying to study might be an example of idiosyncrasies. It's not always a bad thing; it can be a good thing, Depending on how it is used.
  • What are your specific Traits that are unique to you, and separate you from everyone else?
Sign In or Register to comment.