#### Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

# Scanning for an Overlay of an Indicator

How would I write the code for an overlay of an indicator?

For instance, if I want to have Bollinger Bands around the 13 day Force Index and use a crossover of the lower Bollinger Band as the signal, how would I write the code for the crossover of the lower BB? Essentially, the concept is this:

[yesterday's FORCE(13) <yesterday's Lower BB(20,2) of FORCE 13] and
[today's FORCE(13) x Lower BB(20,2) of FORCE 13]

Help would be appreciated. Thanks!

• mod
edited January 2015
Well, this passes syntax:

[type = stock] AND [Daily SMA(20,Daily Volume) > 40000]
and [yesterday's FORCE (13) < yesterday's Lower BB(20,2, FORCE(13))]
and [today's FORCE(13) x Lower BB(20,2, FORCE(13))]

BUT,

on the results page, it first says this is the scan interpretation:

• For the last market close:
[TYPE = STOCK] AND [DAILY SMA(20,DAILY VOLUME) > 40000] AND [YESTERDAY'S FORCE(13

then, if you sort by any column, the scan interpretation becomes:

For the last market close:
• All Stocks with...
• Daily FORCE(13) for yesterday is less than Daily Lwr Bollinger Band(20,2) for yesterday
• Daily FORCE(13) for today crosses above Daily Lwr Bollinger Band(20,2) for today

So that does not appear to be what you are really looking for, although I didn't make a chart style to check the results.

So I'm guessing you can't do it. I think Gord will have the definitive answer when he next checks in.
• For reference purposes, here is an example. I believe this is what you are trying to do:

• Kevo, yup, that's exactly what I'm trying to do. Awesome, Markd. That syntax works and it does what I want. Thank you.
• mod
Well, that's a surprise. Good to know. I'll have to check it out when I get the chance.
• mod
edited January 2015
Yes, it does work.

There is a minor error in the scan text above (missing bracket before "yesterday"). Here it is corrected for anyone interested:

and [yesterday's FORCE (13) < yesterday's Lower BB(20,2, FORCE(13))]
and [today's FORCE(13) x Lower BB(20,2, FORCE(13))]

Pretty interesting scan, Chad. Thanks for sharing the idea.
• ✭✭
edited October 2022
Might also be wise to look at ones crossing Upper BB.

and [yesterday's FORCE (13) < yesterday's Upper BB(20,2, FORCE(13))]
and [today's FORCE(13) x Upper BB(20,2, FORCE(13))]