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

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

Comments

  • markdmarkd mod
    edited August 26
    What do the warning messages say?

    I don't think "Close($VIX)" is legal, but on its own it doesn't generate any errors.



  • cedy1cedy1
    edited August 26
    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.
  • 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.
  • cedy1cedy1
    edited August 26
    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.
  • lmkwinlmkwin ✭✭
    edited August 29
    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.






  • Thanks i'll check I'll look at that.
Sign In or Register to comment.