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.

Alerts

Do you have any idea why this scan / alert would have alerted me for SPX and SOX but when I confirm by running a scan, it does not. The alert should not pick either of them for a couple of reasons. One is the high today is not > the low one day ago. Also, 1 day ago MACD Hist(2,3,0) was not > 0.0.

[Favorites List is 23]

and [[MACD Hist(1,2,0) < 1 Day ago MACD Hist(1,2,0)] or [[EMA(1) < 1 Day ago EMA(1)] and [1 Day ago EMA(1) > 2 Day ago EMA(1)]] or [[SMA(1) < 1 Day ago SMA(1)] and [1 Day ago SMA(1) > 2 Day ago SMA(1)]]] and [1 Day ago MACD Hist(2,3,0) > 0.0]

and [High > 1 Day ago Low] and [1 Day ago High > 1 Day ago lower BB(20,1)]

and [[EMA(1) < 1 Day ago EMA(1)] or [SMA(1) < 1 Day ago SMA(1)] or [EMA(1) < SMA(1)]]

and [EMA(14) < SMA(14)] and [EMA(14) < 1 Day ago EMA(14)]

and [[EMA(20,RSI(14)) < SMA(20,RSI(14))] and [EMA(20,RSI(14)) < 1 Day ago EMA(20,RSI(14))] and [SMA(20,RSI(14)) < 1 Day ago SMA(20,RSI(14))]]

and [MACD Hist(48,103,36) < 1 Day ago MACD Hist(48,103,36)] and [MACD Line(48,103,36) < 1 Day ago MACD Line(48,103,36)] and [MACD Hist(72,156,54) < 1 Day ago MACD Hist(72,156,54)] and [MACD Hist(72,156,0) < 1 Day ago MACD Hist(72,156,0)]
«1

Comments

  • I have the alert to run continuously all day every day.
  • IWM just alerted using the exact same alert and scan. If I copy and paste the alert into a scan, it does not pick any of these three. As best that I can tell, the alert system is using the data differently than the scan does.
  • markdmarkd mod
    edited August 2
    I don't have the time to decipher your whole scan, but it's possible your "or" brackets are a problem.

    As you know, if your "or" brackets are not grouped and/or isolated correctly, then only one condition in the entire scan has to be true to trigger a hit.

    Also, scans run at different times can have different results because the data has changed.

  • Thanks, I don't think that the or is what is wrong because I copied and pasted what is in the alert into a scan and tried it. The timing difference might be it but I also noticed that price did not match what the alert is asking for. As one example, I require today's high to be > yesterday's low and none of the three that alerted meet that requirement. On all three today's high < yesterday's low
  • This particular scan / alert is the only one where I have not enclosed the whole thing in brackets. Is it possible that I need to enclose the whole scan inside some brackets?
  • markdmarkd mod
    edited August 3
    A "logically" incorrect grouping of "or" statements" is not the same as a "grammatically" incorrect grouping.

    A grammatically incorrect grouping (odd number of brackets) will trigger a warning and the scan won't run.

    A logically incorrect (or maybe I should say unintended) grouping can be grammatically correct, so the scan will run.

    You say you require today's high to be above yesterday's low, but if your "or" groupings are off, you can get a hit if even if that's not true, but a different "or" alternative is true.

    The results you get could be a clue to where the problem is in your scan.

    If you require high > 1 day ago low, but that requirement is not in the results, then the scan engine believes it can ignore that requirement because it has met an alternative requirement, so (because its an "open" "or" statement) it can return a result.

    You can see which lines are getting read by checking off which conditions ARE met on the charts in the results.

    Another possibility is the scan has more conditions than the scan engine can resolve in one scan. I don't know the limits, so that could be wrong.

    Incidentally, ema(1) and sma(1) and "close" are all the same thing. You can test this:

    [group is sp500]
    and [ema(1) = close]

    You will get 500 results, or every stock in the index. So close and ema(1) are the same. Same with sma(1).

    So you can simplify your code (and processing by the scan engine) by substituting "close" wherever those terms occur.
  • Thank you. As you know, I am not very good at writing scans, but I do understand what you're trying to explain.
  • markdmarkd mod
    edited August 4
    So, I've gone through the scan and updated sma(1) and ema(1) to "close", and edited the brackets and added "plain english" notes above each line that explains what each line is doing.

    The brackets may or may not be where you really want them, and the notes, while they say what the code says, may or may not be what you actually want the line to do. I'm not sure if this helps or not, but worth at try.


    [group is sp500]

    // Hist 1 is down, or close is down

    and [[MACD Hist(1,2,0) < 1 Day ago MACD Hist(1,2,0)] or [close < 1 Day ago close]]

    // yesterday's close is down, or today's close is down

    and [[1 Day ago close > 2 Day ago close] or [close < 1 Day ago close]]

    // yesterday's close is down

    and [1 Day ago close > 2 Day ago close]

    // yesterday's Hist 2 was above zero
    and [1 Day ago MACD Hist(2,3,0) > 0.0]

    // today's high is greater than yesterday's low

    and [High > 1 Day ago Low]

    // yesterday's high is above yesterday's lower BB

    and [1 Day ago High > 1 Day ago lower BB(20,1)]

    // today's close is down or today's close is down or close is less than close (this needs attention)

    and [[close < 1 Day ago close] or [close < 1 Day ago close] or [close < close]]

    // ema is less than sma

    and [EMA(14) < SMA(14)]

    // ema is down
    and [EMA(14) < 1 Day ago EMA(14)]

    // ema RSI is less than sma RSI
    and [EMA(20,RSI(14)) < SMA(20,RSI(14))]

    // ema RSI and sma RSI are down
    and [EMA(20,RSI(14)) < 1 Day ago EMA(20,RSI(14))]
    and [SMA(20,RSI(14)) < 1 Day ago SMA(20,RSI(14))]

    // MACD Line and Hist 48 are down

    and [MACD Hist(48,103,36) < 1 Day ago MACD Hist(48,103,36)]
    and [MACD Line(48,103,36) < 1 Day ago MACD Line(48,103,36)]

    // MACD Line and Hist 72 are down

    and [MACD Hist(72,156,54) < 1 Day ago MACD Hist(72,156,54)]
    and [MACD Hist(72,156,0) < 1 Day ago MACD Hist(72,156,0)]


    It seems like you are looking for a tick down that moves all the indicators down also. Am I close?
  • Whew, thank you very much for that. I'll study what you've done. You can probably tell that I am constantly trying a new idea very often. Yes, this one is an attempt to find a scan that will identify a quick short play that may be profitable more times that it's not. Because I anticipate the gains to be very small, I think that this one needs to win more times than it loses. Again, thank you. You guys are great
  • I run these scans and alerts on the indexes only, no stocks. Since you have looked at this one so closely, do you happen to see anything that might make it send me an alert but when I run the scan engine it choses nothing? As you can imagine, I have a ton of scans and alerts set up. When I am alerted, I always run the scan for the alert. I have learned that the scan engine is not as fast as the alerts but in the case of this one the scan did not pick up anything all day long even when price penetrated the price level at the time of the alert. I have tested this one by running each line separately and then again, all together. I don't know if it will make any difference, but I have added brackets around the whole scan. Back testing it doesn't seem to make any difference tho
  • markdmarkd mod
    edited August 4
    Brackets around the whole scan do no harm. It passes syntax because the number of brackets is an even number. But it doesn't change the logic of the scan or the order of execution in any way, so extra brackets really just clutter up the scan.

    As far as I know, brackets only affect the logic and execution of the scan when "or" statements are involved.

    If you have say 10 "and" statements and you put brackets around them to make two groups of five "and" statements, it does not affect how those statements get executed, as far as I know.

    If you use brackets to group things for yourself, so you know what goes together, you could use lines that start with "//" between the groups. The scan engine ignore any line that starts with //.

    You can put actual comments on those lines, e.g.

    // Hist 48 is lower

    or just symbols,

    // ******

    or anything that helps you know what goes with what in your scheme of things.

    I'm not really well versed on how alerts work in practice because I don't actually use them. But, as I understand it, they are meant to trigger the FIRST time the alert conditions change from false to true. The alert conditions can go back and forth from false to true a number of times during the session, but the alert will only trigger once.

    For instance, if the alert is close > 50, and at the session start the close (meaning the price as of the first update) is 49, and some time during the session an update close gets to 50.01, you should get an alert.

    But suppose on later updates in that same session the close drops back to 49.99. If you run the alert as a scan right after the later updates, it will not pick up the hit that triggered the alert because close > 50 is not true anymore.

    Since your scans reference the close, that may be what is happening. But the same thing (the data has changed) could be true of the indicators, too, so that some part of the scan that was true is not longer true when you run the scan.

    I'm not sure what happens if the alert condition is already true. For instance, if the alert is close > 50, and yesterday the stock closed above 50 and today it opened above 50 and stayed there all day, I'm not sure if you would get an alert.
  • Thanks. From experience using alerts I have experienced all of what you mention. I can tell you from experience that if you ask for > 50 it will alert every day that it's above 50 unless you add criteria that limits it. That's when I try to use 1 day ago < 50 or maybe I use a crossing X to help limit how many times it alerts. BTW, because of what you told me some time ago, I do use // and some kind of description to remind why or what I tried to accomplish. Thanks for that, it is very handy. As far as my last question goes, I just don't know why I would get alerts, but the scan would not eventually pick up the same as the alerts.
  • I use the close a lot because in the scan or the alert it's the current price at that moment
  • markdmarkd mod
    edited August 5
    Remember, too, that the chart is created separately from the scan. So there are three events - the alert, your scan, and the chart creation. All occur at different times, and if the session is open, the data is different for all three. So at the moment the alert runs, the conditions are true, but when the scan is run and the chart is created, the data may have changed so the condition is untrue.

    You could look at the chart as soon as you get the alert, take a snapshot of it (a print screen, although it may have already changed) and see if it still fits the alert. Or, take a snapshot of the chart before you run the scan to see if it should fit the scan before you run it. Of course, it's changing all the time, so it may not help.
  • Thank you. Yes, I have noticed that once an alert is triggered, price usually pulls back, either up or down, just a tiny bit by the time it takes me to pull up the same scan, just a few seconds normally, and the scan will not pick up what the alert did until price gets back to that same spot or beyond. I have noticed also that sometimes the scan will not pick it up until price has exceeded the price where the alert triggered so I assume that something else, a MA or a MACD line etc., within the scan has changed a tiny bit during that few seconds time and the math for it doesn't work until price moves a little bit more. In this particular case, a quick look at the chart and I could see that price did not overlap the previous day's price, there was a gap. I want the high to be > yesterday's low just to prevent my entering on a gap situation. From experience again I have learned that It's not too uncommon to get a false alert within the first two minutes of the open and that is why I always run the same scan as a confirmation to the alert. In this case I got three separate false alerts spread out over the day. None of them met several of the requirements but the easy check looking at the chart was the gap. Further analysis of the chart showed a couple of other problems with the alert that should have prevented all three of these. I don't know it if will help but the only thing that I can think of to do is to enclose the whole scan inside brackets which I have done. Maybe it's just a one day, one time anomaly but I as you know, I am not very good at this kind of thing, so my first assumption is that I have made a mistake.
  • This morning is another good example of something that I can't figure out. Using a different scan than the one we have been talking about for an hour I was getting a long signal for XLK. It alerted me properly, I ran the scan and they both chose XLK, Now, and even though price is well above the trigger price, the scan does not select XLK. Don't understand it when this happens
  • If your other scan includes indicators (like the one above) those may have moved enough - or not enough - to fail one or more scan conditions.
  • Yes sir, thank you
  • FYI, I am leaning toward false alerts now. I just got another alert that could not possibly have alerted. IMO, it's imperative to run the scan immediately after I get an alert to confirm. Somehow the alert is misreading some of the data somehow.
  • I have been watching closely for a few days. I am immediately running the identical scan as I get an alert. I am also dissecting the scan one piece at a time when it does not confirm the alert trying to figure it out. As you know, I am not smart enough to make this call but so far it appears that I am getting some false alerts in case anyone is interested. As long as I confirm my alerts with the scan, it's not too big of a deal but I am very curious about why. Thanks for helping
  • lmkwinlmkwin ✭✭
    Just a thought. Try changing the Alert to run "At market close" and then compare with your scan after the close. As @markd mentioned, the Alert may be picking up some values at the open and during the day that are not valid by the end of day, or even a couple minutes after the Alert triggered.
  • Yes, this alert is the only one that I have set up to run continuously all day. I am actually trying to use these alerts to make real trades, and it is no good if I wait until the close, but I may change it to an hourly alert just to see. Thanks
  • Update for anyone interested. After watching pretty closely now for a couple of weeks I believe that I can definitely say that there are some false alerts sent out. From what I can see here using my scans pasted into an alert, it only happens to the alerts set up to run continuously all day long. FYI, when I get an alert I confirm it by running the alert via a scan and if price continues to move in the right direction and the scan still doesn't pick up the alert, I start to dissect the thing to see what might be happening.
  • FYI, after I continue to watch the alerts for a while longer, I have decided to change the setting to alert hourly instead of continuous. I don't seem to be having the same issue with any other settings. I'll try to keep you posted
  • FYI, I have the exact same alert set up to trigger continuously all day and also set up to trigger hourly during the day. The hourly has triggered while the continuous all day has not. When I run the scan, it triggers.
  • Send the scan and the alerts to Support along with the time(s) the hourly triggered and the scan was run. Also the dates/times the alerts and scans were last modified.
  • I don't think that they look at anything that I send them now. When I have, they don't even acknowledge that I have sent them something. There's no way to tell if they have even seen it. And, I don't have all of that information to give them. Not knowing what is happening, it could be me somehow, it appears that the continuous all-day alerts are the one's not doing what I have expected them to do. I am convinced enough to change them all to hourly or EOD alerts.
  • FYI, If anyone is interested, I may have figured out at least one reason for the seemingly false alerts. After you have built the scan, you have to enclose the whole thing inside a set of brackets. I think that if have a list of criteria, it may select one or some of the criteria and not the whole scan. Hope that makes sense.
  • If you have any "or" statements in the alerts, yes it does make sense.

  • FYI, I got another false alert just now this morning and it was an alert set to run continuously all day long. I don't know if that setting has anything to do with it but those are the only one's issuing a false alert, at least so far. I have changed my shortest alert to the hourly.
Sign In or Register to comment.