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.
Help with advanced alert
Comments
-
What do the warning messages say?
I don't think "Close($VIX)" is legal, but on its own it doesn't generate any errors.
0 -
The warnings refer to time periods being different. I'm not sure it's an issue. Maybe it is. The scan as a whole says the syntax is ok. Notice the ATR multiplier rises as the vix does.0
-
I'm pretty sure the " Close($VIX) " is not legal, even though you don't get a syntax error. Probably because "close" is valid, parens ( ) are valid and the symbol is valid - they just aren't valid all together. I remember a long time ago messaging with someone who knows about this stuff (I think it was @Gord) who said, in general, a developer can think of a lot of errors users might make, but rarely all of them. So no error message.
Normally, the parens ( ) indicate a function (like max( ) or min( ) ). As far as I know, there is no Close( ) function - i.e. a function that returns the value of the close of a symbol.
I haven't looked in a while so I checked the valid technical functions - here:
https://help.stockcharts.com/scanning-and-alerts/scan-syntax-reference/technical-functions
Technical functions are not included in the drop downs under the scan writing window and they are hard to find in the documentation, and you didn't get an error message, so I'm not surprised you had a question.
But in general, for all scans (and alerts), all conditions get applied to all symbols in the specified universe ( in this case 'aapl'). It doesn't allow for specifying one condition for one symbol and another for others. So I don't think you can do what you are looking at here.
If you could find something in common with $VIX and AAPL you could put them in a list and specify the list as the universe. Maybe the both cross some variation of Chandler together? Or they trigger extreme readings on some other indicator together? Something normalized with boundary values, like some version of Stochastics or maybe PPO ? Just throwing it out there.
0 -
I agree with your assessment, it wouldn't work for the reasons you gave. I am fairly new to writing scans. Your level of detail is exactly what I wanted. On a side note, I wrote a formula on Google Sheets for the Chandelier Exit which works just fine. I can write another version of it to include the $VIX as a modifier. Whether any of it is actually useful is a guess. Thanks. I'll try to see if I can find I work around like you mentioned.0
-
All you are concerned with in this code example is $VIX. The addition of AAPL in there is not pertinent to the actual scanning requirement.
Using this as the Alert Code or Scan Code does pass syntax and does produce a result if run on the right day.
//Alert
[symbol is '$vix']
and [ [[Close < 15.00]
and [Chandlr(14,2.7,long) x close]]
or [[Close > 15.00] and [Close < 20.00]
and [Chandlr(14,2.7,long) x close]]
or [[Close > 20.00]
and [Chandlr(14,2.7,long) x close]] ]
In the Alert message to send you could put "Check AAPL"
This code came up with a "result" for one of the criteria on April 23 and another prior instance. I'm pretty sure it's the second criteria. I've included a chart to "highlight" the occurences for that in the past year.
0 -
Thanks i'll check I'll look at that.0
Categories
- All Categories
- 2.3K StockCharts
- 395 SharpCharts
- 146 Other Charting Tools
- 69 Saved Charts and ChartLists
- 1.5K Scanning
- 73 Data Issues
- 177 Other StockCharts Questions
- 218 Technical Analysis
- 155 Using Technical Analysis
- 2 InterMarket and International
- 19 Market and Breadth Indicators
- 42 Market Analysis
- 109 Trading
- 109 Trading Strategies
- 163 S.C.A.N the StockCharts Answer Network forum
- 65 Using this StockCharts Answer Network forum
- 98 s.c.a.n. archives
- 5 Off-Topic
- 6 The Cogitation & Rumination Emporium
- Forum Test Area