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.
Alert for OGIG when Aroon(12) crosses 8 day SMA
Having trouble with a simple script for an alert for OGIG.
I'm trying to write an alert for OGIG for when Aroon(12) value equals the 8 day SMA for Aroon(12).
Just cant seem to get the syntax right.
Any thoughts?
0
Comments
You can read about the crossover operator here:
https://support.stockcharts.com/doku.php?id=scans:advanced_scan_syntax:crossover_scans
Also, your scan would need to specify which Aroon value you want. There are three - Aroon Up( ), Aroon Down( ) and Aroon Osc( ). You can select the one you want from the "Technical Indicators" drop down under the alert writing window on the Alert Workbench.
I'll assume you want Aroon Osc. If you want one of the others, just substitute.
and [Aroon Osc(12) x sma(8, Aroon Osc(12))]
That says the Aroon crossed above it's sma.
If you change the order,
and [ sma(8, Aroon Osc(12)) x Aroon Osc(12)]
it says the Aroon crossed below the sma.
(Actually, it says the sma crossed above Aroon, which is the same thing, but since the Aroon moves faster, on the chart it looks like the Aroon is doing the crossing from above to below).
If you want to include the "equals" case, just to be thorough, you need an "or" statement, which would look like this if you want to include both crossovers as well:
and [
[Aroon Osc(12) x sma(8, Aroon Osc(12))] // cross above
or [ sma(8, Aroon Osc(12)) x Aroon Osc(12)] // cross below
or [ sma(8, Aroon Osc(12)) = Aroon Osc(12)] // equal
]
You need the bracket after "and" and the bracket by itself on the last line.
[symbol is 'ogig'] and [sma(8, Aroon Osc(12)) x Aroon Osc(12)]
syntax checked fine.... here's an image of what i'm trying to catch:
You can check using the regular scan workbench. Instead of [symbol is 'ogig'] put in something like
[exchange is NYSE]
You should get hits for the current date. If not, try another date. Save the results to a list and apply your chart style that includes Aroon Osc (unless Aroon Osc is in your default chart style). Then look at the charts to see if its what you want.