I have searched the forum for the answer to this question but can't find one exactly like it and have tried a few things without any success. What I'm trying to do is implement some type of pop up message telling the user something. However, if they have the indicator on 10 different charts, it is currently popping up a MessageBox 10 times. I only want 1 popup for that event regardless of how many instances of the indicator they have running. After doing some research, I have found a few possibilities but I'm not sure which route to take.
- Use an AddOn with a static class. However, I'm not sure of the logic here. If I have a static bool in that class such as IsPopUpShown and set it to true from an indicator, will the value always be correctly in sync when the other indicators check its value?
- Use an AddOn with a static class but instead of the bool idea, it would just have a static method to show a popup. This method would check all open windows to see if a MessageBox was showing, and would not show it if so.
- Use some sort of global variable to be True if a popup is shown. Again I'm wondering whether this variable's value can be trusted to be in sync when the other indicators call it.
- Some other approach? Maybe there's a built in way to do this with MessageBox or the Log() function using the Alert type or something else?
Paul
Comment