Having some trouble with scan syntax
Good day everyone!
I'm having trouble with some scan syntax, wondering if someone could assist:
1) I'm trying to create a scan that measures divergence from the sma 20 day with a 10% minimum threshold, eg stock at 110, sma at 100.
I tried the following:
[type is stock] and [(price - sma(20))/sma(20) > 0.1)]
but the editor is not happy with the syntax.
2) I'm trying to create a scan that measures reversal in the dotted middle line that is plotted on a Bollinger (8,2) overlay, eg:
if I wanted to create a bullish scan based on the last three dots, let's say 1 being the latest dot and 3 the earliest of the three, the formula to detect a turn would be 1 > 2 and 2 < 3. Meaning a bottom "V" formation of the dots.
And a bearish scan would be 1 < 2, and 2>3, meaning an inverted V formation of the dots.
If anyone could suggest how to code that I would be very appreciative!
Thanks!
I'm having trouble with some scan syntax, wondering if someone could assist:
1) I'm trying to create a scan that measures divergence from the sma 20 day with a 10% minimum threshold, eg stock at 110, sma at 100.
I tried the following:
[type is stock] and [(price - sma(20))/sma(20) > 0.1)]
but the editor is not happy with the syntax.
2) I'm trying to create a scan that measures reversal in the dotted middle line that is plotted on a Bollinger (8,2) overlay, eg:
if I wanted to create a bullish scan based on the last three dots, let's say 1 being the latest dot and 3 the earliest of the three, the formula to detect a turn would be 1 > 2 and 2 < 3. Meaning a bottom "V" formation of the dots.
And a bearish scan would be 1 < 2, and 2>3, meaning an inverted V formation of the dots.
If anyone could suggest how to code that I would be very appreciative!
Thanks!
0
Best Answer
-
What happens when you select the SMA from the dropdown in the workbench?
[type is stock] and [(price - sma(20))/sma(20) > 0.1)]
In your code, you are asking for a SMA20 but the scan engine doesn't know what the SMA20 is for? The price? Price is also something that you need to select from the dropdowns. Price is either a High, Low, Open, Close. You get to decide.
When you use the dropdown and ADD the SMA code to your workbench it defaults to:
and [SMA(50,volume) > 9999999]
You can change the information here, for example, and [SMA(20,close)]
For you crossover question, The middle of the Bollinger Band is a SMA line. You are asking for a crossover of the SMA 8 in your example.
The below link should be an excellent resource for scan questions.
https://support.stockcharts.com/doku.php?id=scans:library:sample_scans
0
Answers
-
thank you so much! got it all sorted out.
0
Categories
- All Categories
- 2.4K StockCharts
- 397 SharpCharts
- 146 Other Charting Tools
- 69 Saved Charts and ChartLists
- 1.5K Scanning
- 74 Data Issues
- 177 Other StockCharts Questions
- 224 Technical Analysis
- 155 Using Technical Analysis
- 6 InterMarket and International
- 19 Market and Breadth Indicators
- 44 Market Analysis
- 109 Trading
- 109 Trading Strategies
- 162 S.C.A.N the StockCharts Answer Network forum
- 64 Using this StockCharts Answer Network forum
- 98 s.c.a.n. archives
- 7 Off-Topic
- 7 The Cogitation & Rumination Emporium
- Forum Test Area
