Jump to content

⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

Recommended Posts

Posted (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 by FxNewbie

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

×
×
  • Create New...