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.

Positive candle

Hello to Everyone,

Is there a scan syntax to display a positive candle crossing over an ema? In the url refer to Dec. 13/2023 as an example of a hollow, positive candle crossing over an EMA.

Best, John Train


  • and [close x ema(21,close)]
  • Hi Mark,

    Your suggested syntax works well!
    Is there a syntax to scan for a hollow, positive candle that closes or opens above an ema?

    John Train
  • See Dec. 17, 2023 on the AA chart for an example.
  • markdmarkd mod
    edited March 2
    All possible scan language terms are available on the Advanced Scan Workbench in dropdowns under the scan writing window. It's easier to find things using Stockcharts own terminology - e.g. Long Body vs. hollow.

    The meaning and usage of each term (or probably most terms) is available by searching the term in Support Articles. If the term is an indicator, in depth explanation is likely available in Chart School.

    It's probably worthwhile if you intend to write custom scans to spend some time getting familiar with items in the dropdowns.

    This may work:

    and [close x ema(21,close)]
    and [Long Body is true]

    If you don't like the default definitions of candle types, you have to write your own, which takes some thought and effort.

    P.S. Dec 17 2023 is a Sunday. The dates below the chart seem to represent Mondays, or possibly Tuesday if Monday is a holiday.

    If you want the first bar to close completely above the EMA, you would test for the low crossing the EMA of the close:

    and [low x ema(21,close)]
  • Thanks again Mark for your syntax help and scan writing suggestion.
  • Hi Mark,

    For the Pfizer chart below, what scan syntax do I require to bring up Pfizer in the scan results? I have tried using syntax but no luck. This time I am scanning for the black candle when the price was $28.69 per the chart.

    John Train
  • markdmarkd mod
    edited March 15
    I assume you mean 3/13, the next to last bar on the chart.

    Before you write a scan, you have to identify what specific combination of elements on the chart you see that you think are significant. You need a reason(s) for why what you see is a trade. You need to think about what your are seeing on the chart in terms of what the scan engine can understand. As I suggested, the scan engine's "vocabulary" for talking about charts is in the drop downs under the scan writing window.

    Some choices are indicators above, below or crossing some level; price above, below or crossing some moving average, close or high or low (don't say just price, say which price) is max or min over some period of time, some specific candle type, etc. You would probably have to play around with these on your charts to see what seems to work best most often.

    Your choice of indicators or moving averages, channels, etc., should be on your chart style to verify the results of your scan.

    Most scans turn up junk as well as what you are actually looking for. The less specific the scan, the more junk. The more specific the scan the less junk, but also the more likely you miss set ups you would go for. That's the trade off.
  • Thanks Mark for your reply. Would the following syntax bring up a black candle above EMA(9)?

    [open > ema(9,close)] or [open x ema(9,close)]
  • You could do it this way:

    [group is sp500]

    and [ [open > ema(9,close)] or [open x ema(9,close)] ]

    The "x ema" is redundant, since if it crossed over it is also "> ema". But it doesn't hurt.

    This scan will work for any day the open is above the ema, not just 3/13 - also 3/12, 3/11, 3/8 etc.
  • Once again, thx Mark for your input!!!
Sign In or Register to comment.