FxNewbie Posted February 18, 2013 Report Share Posted February 18, 2013 (edited) My problem is the pop-up alert happens one time only and will not pop-up an alert for the next cross. Can anyone point out to me how I can solve this problem? The TimeCurrent()-PrevAlertTime being > Period()*60 is to prevent multiple alerts when the signal is true. It certainly does stop multiple alerts but I need to get fresh alerts popping up. I have these declared variables: extern bool Alert_Cross = true; datetime PrevAlertTime=0; and this is the code for the alert if (Alert_Cross == true) { if((Cross_Status == 1) && ((TimeCurrent() - PrevAlertTime) > Period()*60)) { Alert("LONG Cross"); PrevAlertTime=TimeCurrent(); } else if((Cross_Status == -1) && ((TimeCurrent() - PrevAlertTime) > Period()*60)) { Alert("SHORT Cross"); PrevAlertTime=TimeCurrent(); } } Edited February 18, 2013 by FxNewbie Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.