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.
How do you WRITE a Scan using the moving average of an indicator, as in, the moving average of RSI
I want to write a scan to catch what I see on my charts, which is the Crossover ( X ) of an Indicator, above a specific moving average, in this case KAMA, to assess volitility? Seems there exists no instruction for that that I have been able to find............Thanks in advance for any light shed upon this subject.....DG
0
Comments
and [sma(10, RSI(14)) x sma(50, RSI(14))]
is a valid statement.
For KAMA, it is undocumented as far as I can tell, but it appears you can just add the indicator as a fourth term to the KAMA function, so for instance this line:
// KAMA of indicator crosses above indicator
and [KAMA(10,2,30, RSI(14)) x RSI(14)]
passes syntax.
It may be that the syntax checker isn't coded to check for this, and it's not valid, but give it a try. The charts are coded to include KAMA with indicators, so maybe the scan engine is, too.
If this doesn't work, you might email a suggestion to support asking for a blog feature to explain how it's done.
Interesting idea to apply Stochastics to Force. Never thought of that.
As a result I want to figure how to find X's or cross overs that are less then 4 days old, and add that to my "X over" phrase. Any Input?
Presumably you want to run the scan every day, so if the scan looks for things several days back then your results each day will include symbols you have already seen.
If you want to code it in, it would be an "or" statement
and
[
[KAMA(10,2,30, RSI(14)) x RSI(14)]
or [1 day ago KAMA(10,2,30, RSI(14)) x 1 day ago RSI(14)]
or [2 days ago... ]
]
[type is stock]
and [region is NorthAmerica]
and [Close > .10]
and [group is NOT ETF] and
[ RSI(13) x sma(10, RSI(13)
now here is the Error Msg:
Could not parse "(13" located in the clause "SMA(10, RSI(13)" (an integer was expected)
have spent a lot of hours trying to resolve it but i must be blind cz try as I may differing approaches and others work as well, I cant seem to get past it...........
TIA, DG
RSI also requires two parentheses.
So, when you put RSI inside SMA, you should have two complete sets of parentheses (or four total, two left and two right).
The error message says an integer was expected, but that is misleading. Most of the time, the error messages correctly locate where the error is, but only sometimes correctly identify the error. A more helpful error message would have been "the sma indicator or the rsi indicator is incomplete", meaning the second parenthesis from one of them is missing.