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.
I am trying to write an chandelier exit alert with a vix modifier. The parameters are more or less place holders. Can anyone give me their opinion on the syntax on it? thx
0
Comments
I don't think "Close($VIX)" is legal, but on its own it doesn't generate any errors.
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.
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.