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.

scan

I'm struggling with trying write a scan to scan my chart lists, I want to scan my lists for sma50 crossing sma200 .
can anyone give me some help I write them now but they are never accurate. I will ask for stocks under $15.00 and I will get them for $40. not sure what I'm doing wrong...

Comments

  • lmkwinlmkwin ✭✭
    edited July 2020
    It's often easier to assist/ troubleshoot if you paste the scan code you have to the forum.

    To scan against your Chartlists, add the ChartLists using the ChartLists dropdown.

    Then add your crossing code.

    Select the SMA from the Technical Indicators dropdown
    It defaults like this

    and [SMA(50,volume) > 9999999]

    change it to be looking at a price. I changed it to look at the SMA50 of the Close price

    and [SMA(50,Close) > 9999999]

    Then change it to look for the cross

    and [SMA(50,Close) X SMA(200,Close]

    If you are getting unexpected results, it's often due to the sequence of the scan lines OR the placement of the brackets OR an issue with the use of AND and OR.

    Like I said, it's easier to assist with troubleshooting actual scan language.



  • lmkwinlmkwin ✭✭
    syntax error in the original post

    and [SMA(50,Close) X SMA(200,Close)]
  • lmkwin is right - it's hard to diagnose a problem without seeing the code.

    If you have MULTIPLE chartlists, those need to be in an or statement. An "or" statement is two or more conditions connected by "or", with a pair of brackets around ALL the "or" conditions. So,

    [
    [ favorites list is MyEnergyStocks]
    or
    [ favorites list is MyMaterialsStocks]
    or
    [ favorites list is MyHealthStockds]
    ]

    and [close < 15]

    and [sma(50,close) x sma(200, close)]

    If your brackets around the or statement are not correct, then you would get ANY stock that meets ANY of the conditions you specify in the entire scan. So that would be all the stocks in all of your lists, whether there was an sma crossover or not, and whether price was below 15 or not.

    If this doesn't help, post what you have.
  • Ok I copied the last scan I tried, thx you both Imkwin and Mark for all the help ...


    [type=stock]
    And[volume >750000]
    and [country is us] AND [CLOSE <15.00]And [CLOSE >5.00]
    and [ group is not etf ]


    and [today's sma (50) > today's sma (200) ]
    and [yesterday's sma (50) <yesterday's sma (200) ]

    and [today's low < yesterday's daily min(10,low)]


    or[[favorites list is 10]
    or [favorites list is 9]
    or [favorites list is 5]
    or [favorites list is 7]
    or [favorites list is 12]
    or [favorites list is 13]]
  • Almost.

    For the first "or", substitute "and"

    or and [[favorites list is 10]
    or [favorites list is 9]
    or [favorites list is 5]
    or [favorites list is 7]
    or [favorites list is 12]
    or [favorites list is 13]]
  • markdmarkd mod
    edited July 2020
    That will work, but it would more efficient to re-organize the scan so lists come first.

    // begin scan
    // look in these lists

    [
    [favorites list is 10]
    or [favorites list is 9]
    or [favorites list is 5]
    or [favorites list is 7]
    or [favorites list is 12]
    or [favorites list is 13]
    ]


    // note: if all the stocks in your lists meet these criteria, you don't need the ticker properties section

    // for these ticker properties

    and [type=stock]
    and[volume >750000]
    and [country is us] AND [CLOSE <15.00]And [CLOSE >5.00]
    and [ group is not etf ]

    // and theses price-indicator conditions

    and [today's sma (50) > today's sma (200) ]
    and [yesterday's sma (50) <yesterday's sma (200) ]

    and [today's low < yesterday's daily min(10,low)]

    // end scan
  • Thank you mark that did help.
Sign In or Register to comment.