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.

Add additional scanning code.

Hello, I'm a new subscriber to Stockcharts.com and am very much interested in Joanne Klien's program, "Above the green line". Joanne posted scan coding for stocks / ETFs that meet her characteristics for the program. Here is the code.

" [type = stock] AND [country = US] and [SMA(20,volume) > 1000000]

and [EMA(50,volume) > 1000000] and [SCTR >90]" <------add additional code here.

I would like to add a small bit of additional code at the end of her original code and in plain English I would like the scan to show the stocks / ETFs that have the Slow Stochastic 5,1 between 18 and 20. A buy signal would occur
when the Stochastic rose above 20. Although I'm very code deficient I did try several times but the syntax checker caught me every time. I'm sure there are a lot of sharp coders out there and I would really appreciate it if someone would be so kind as to help me with this.

many thanks,

.........Joestaco




Comments

  • I think if you add this you will be OK.

    If you were attempting to add these lines "freehand", you might try to insert them using the drop downs in the Scan Builder section under the scan window. These came from the Technical Indicators list. They are syntactically correct when you add them. You just modify whatever parts you need - in this case, the parameters to 5,1, the operators to > or < and the level to 18 or 20.

    and [Slow Stoch %K(5,1) > 18]
    and [Slow Stoch %K(5,1) < 20]
  • Hi Markd,

    Many thanks for the feedback. I added the code as you suggested and sure enough the syntax checker was pleased and said "run scan". However the only result of the scan was a blank sheet. I'm now going to try the scan builder and see what happens. I've obviously overlooked something.

    thanks again,

    Joestaco
  • No results can be a valid result if the market is not in the stage where the indicators would be at the levels you are looking for. Most stocks pretty much move together - especially if you have the SCTR condition. If you comment out that line you are more likely to get results.

    To comment out a line -

    first - format your scan so that every line (except the first one) begins with "and" and each line has only one condition (one "and" per line in other words, always at the beginning).

    Then put two slashes at the very start of the line

    //and [SCTR > 90]

    Now the scan engine will ignore that line. To put it back in, just delete the slashes.
Sign In or Register to comment.