How to prevent out of date Alerts from showing in the Alerts tab
Author: Panache
Creation Date: 11/3/2018 5:55 PM
profile picture

Panache

#1
I was testing my new class library, and the Strategy generated an alert on September 11, 2018 to buy XL, which was it's last trading day. Therefore, XL was never purchased, but the Alert continues to be displayed in the Alerts tab.

I can remove the alert for XL (and any other stale alerts) from Alerts at the end of the Strategy:
CODE:
Please log in to see this code.

but the alert still displays in the Alerts tab.

Is there any way to prevent stale alerts from being displayed in the Alerts tab?
profile picture

Eugene

#2
What you can do is close out the symbol XL (or not open the trade):

How to close all active trades on the last trading day?
profile picture

Panache

#3
QUOTE:
close out the symbol XL

Obviously, it isn't practical to hard code in all the symbols that are going to generate an alert (and what kind of alert) on the last trading day. Therefore, I'd like to be able to close them out from the Alerts object. However, this isn't stopping the stale alerts from being displayed in the Alerts tab:
CODE:
Please log in to see this code.

Is there something I'm missing here?

QUOTE:
or not open the trade

Actually, the problem is the trade is never opened. The alert is generate on Bars.Count - 1 to buy (or sell) on Bars.Count.

Moreover, it can't be known in advance whether Bars.Count - 1 is the last day the stock will trade.
profile picture

Eugene

#4
QUOTE:
However, this isn't stopping the stale alerts from being displayed in the Alerts tab:

And it shouldn't: an Alert cannot be removed from the Visualizer (too late). If that matters to you, the idea is to hard code such symbols so that no trade is generated.
profile picture

Panache

#5
QUOTE:
an Alert cannot be removed from the Visualizer

Can a custom Visualizer be programmed to only display alerts if the alert.AlertDate is after some date? Before I try to recode it, I thought I'd find out if it is even possible.
profile picture

Eugene

#6
Certainly you can do it in a custom Visualizer. It's completely up to you what to display in a ListView there.
profile picture

kelvinyip

#7
Eugene

So, there is no way to clear out old Alerts ? I have literally thousands of them ....
profile picture

Eugene

#8
When asking questions, especially in somebody else's topics (well formulated), it would be beneficial to provide enough details. There's no need to hesitate if questions seem more verbose than usual. In particular, knowing this might be helpful:

1. What "old Alerts" are? Why do you have so many of them?
2. Wealth-Lab tool in use (Strategy Window, Strategy Monitor)?
3. Which steps have been taken to alleviate your problem?
profile picture

kelvinyip

#9
For 1, I have these strategies doing bar+1 to generate buy/sell alerts and they went all the way back to 2018 or 2012
For 2, strategy monitor was used to generate them
For 3, after a while, I just write them to a flat file but recently, I want to use the alert and order window again so I am trying to clean up my old trades in papertradingaccount1 and my alerts... for papertradingaccount1, I realized that I can just delete the account and recreate it and all the old positions are gone...

Oh, I scan the entire universe and generate a least 100 alerts so I can go through them manually in the morning.
profile picture

Eugene

#10
Unfortunately, there is no way to clear out the Alerts view of the Strategy Monitor (if you mean that).
profile picture

kelvinyip

#11
uninstall/reinstall ?? if someone has been using it for many years... wouldn't that be strange to see all prior alerts ??
profile picture

Eugene

#12
This is by design: the SM has always kept old Alerts. When this behavior had been changed in a first 6.4 build (old Alerts to be purged), the opposite views (sometimes expressed emotionally) made the development team change their mind and revert the change. But from a programmer's point of view, deleting outdated Alerts as volatile content is the correct behavior. Alas, the majority of SM users had a different opinion. Also, having too many Alerts (like dozens of thousands) will most likely cause delays in SM (or even hang it) which may corrupt its configuration file.

To get rid of prior Alerts without deleting all Strategy entries, simply rerun your Strategy. It purges old Alerts and creates new ones. What can be simpler??

Re: uninstall. You signed up on our website some 18 years ago. This gives quite enough time to stumble upon this FAQ, now 11 year old: I have a problem. Tried to reinstall Wealth-Lab, but it didn't help! ;)
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).