Awesome_Signal_Alert

boa_conflictor

Master Trader
Aug 5, 2016
75
9
69
This is an interesting indicator, and with the right strategy can give reliable signals.

It's giving alarm and sound signals, and an improvement would be if it could also send email alert.
It would be nice if one of the wizards here could add this feature?

Since this indi was coded in 2005 maybe can have a little update too if this is not to much work?
It is still working like it should, but i can imagine that with future builds bugs could surface...

Thanks in advance!
 

Attachments

  • Awesome_Signal_Alert.mq4
    4.1 KB · Views: 64
  • 👍
Reactions: Mandar

boa_conflictor

Master Trader
Aug 5, 2016
75
9
69
Enivid,

Since the indi had already pop-up and sound alerts, i assumed it would be best to keep it this way.
So i tried to only add the email alert function.

When i compiled it said no errors, when i add it to the charts in the indicator window i see the feature " enable email alerts", but the email function is not working?
(I already enabled and configured email alerts in my platform via menu Tools->Options->Email. This was already working....).
In the journal is also nothing visible when the signal is activated that mail was sended, or failed to be sended.

Could you please check it for me?
 

Attachments

  • Awesome_Signal_Alert_Modified_1.mq4
    11 KB · Views: 20
  • 👍
Reactions: Enivid

Enivid

Administrator
Staff member
Nov 30, 2008
18,607
1,366
144
Odesa
www.earnforex.com
Good job at trying this! There is a small problem with the code though.

You did not need to add a separate block for email alerts. You can just move these lines:
MQL4:
       Text = AlertText + "..." + Symbol() + " - " + EnumToString((ENUM_TIMEFRAMES)Period()) + " - AO CROSSED Signal (BUY)";
       if (EnableEmailAlerts) SendMail(AlertEmailSubject + "....", Text);

Just above your current line 117 and it will do the emails for the case of "AO CROSSED Signal (BUY)".

Move the lines:
MQL4:
       Text = AlertText + " ... " + Symbol() + " - " + EnumToString((ENUM_TIMEFRAMES)Period()) + " - AO CROSSED Signal (SELL)";
       if (EnableEmailAlerts) SendMail(AlertEmailSubject + "...", Text);

Just above your current line 112 and it will take care of the "AO CROSSED Signal (SELL)" case.

You can do the "AO CROSSED ZERO LINE (SELL)" and "AO CROSSED ZERO LINE (BUY)" in a similar way.

This whole block of code can be removed:
MQL4:
    if (((AlertEmailSubject > 0) && (Time[0] > LastAlertTime)) || (AlertEmailSubject == 0))
{
    string Text;
    // Up-Line Crosses Down-Line from Below
    if (((SignalBuffer[TriggerCandle] > SignalBuffer[TriggerCandle]) && (SignalBuffer[TriggerCandle+ 1] <= SignalBuffer[TriggerCandle+ 1])) && ((TriggerCandle > 0) || ((TriggerCandle == 0) && (LastAlertDirection != 1))))
    {
        Text = AlertText + "..." + Symbol() + " - " + EnumToString((ENUM_TIMEFRAMES)Period()) + " - AO CROSSED Signal (BUY)";
        if (EnableEmailAlerts) SendMail(AlertEmailSubject + "....", Text);
        LastAlertTime = Time[0];
        LastAlertDirection = 1;
    }
    // Up-Line Crosses Down-Line from Above
    if ((SignalBuffer[TriggerCandle] <SignalBuffer[TriggerCandle]) && (SignalBuffer[TriggerCandle+ 1] >=SignalBuffer [TriggerCandle+ 1]) && ((TriggerCandle > 0) || ((TriggerCandle == 0) && (LastAlertDirection != -1))))
    {
        Text = AlertText + " ... " + Symbol() + " - " + EnumToString((ENUM_TIMEFRAMES)Period()) + " - AO CROSSED Signal (SELL)";
        if (EnableEmailAlerts) SendMail(AlertEmailSubject + "...", Text);
        LastAlertTime = Time[0];
        LastAlertDirection = -1;
    }
}

Be aware that the relevant line numbers will change when you move the code around.

Good luck! Please let me know if something is not clear.
 
  • 👍
Reactions: boa_conflictor

boa_conflictor

Master Trader
Aug 5, 2016
75
9
69
I was hoping i could solve it without bothering you again.

I did move the lines, and removed the complete block of code at the end, but when i now compile, i get 6 errors: 'Text' - undeclared identifier. on line 111, 117 127, 128, 134 and 135.
It seems to struggle with the "text", but i honestly don't have a clue what i should do about it. I tried to remove or change it, but then i will only get more errors.

So again, i need to ask the master to assess...please?
 

Attachments

  • Awesome_Signal_Alert_Modified_1.1.mq4
    10.3 KB · Views: 18
  • 👍
Reactions: Enivid

hayseed

Master Trader
Jul 27, 2010
1,046
262
149
usa
It seems to struggle with the "text", but i honestly don't have a clue what i should do about it
//-----

hey virtuado...... that's because the compiler does not know what "text" is, so it also has no clue what to do about it ...... declare it as a string and it will know...... struggles will end.....

look into pushnotifications if you have a iPhone or similar..... infinitely better than email.....h

//-----
MQL4:
int start()
  {
   int    limit;
   int    counted_bars=IndicatorCounted();
   double prev,current;
 
   string Text = "";  //---- this tells it Text is a string
 
//---- last counted bar will be recounted
 
  • 👍
Reactions: Enivid and boa_conflictor

boa_conflictor

Master Trader
Aug 5, 2016
75
9
69
Thanks for the help Heyseed!

The email alerts are working now...however it needs a little finetuning, because now i receive 100 mails a minute.
I can't stop the indicator from giving alerts, the only option is removing it from the charts.
As i'm writing this message i still receive about 50 mail alerts! LOL

When this will work properly, i will dive into pushnotifications, i agree that this is much better then mail.
 

Attachments

  • Awesome_Signal_Alert_Modified_1.1.mq4
    10.3 KB · Views: 12

boa_conflictor

Master Trader
Aug 5, 2016
75
9
69
I changed the brackets, to me it looks good, compiling is fine too, but still receiving 100 mails a minute when i add the indi to the charts.... :)
 

Attachments

  • Awesome_Signal_Alert_Modified_1.2.mq4
    10.3 KB · Views: 12

boa_conflictor

Master Trader
Aug 5, 2016
75
9
69
Yep! This did the trick.

I thought i had one bracket to much, so i deleted it, but offcourse at that moment i had one bracket short... :)

I changed some little things for what about text what is added in the mail, for me it's good now.

Thanks Enivid and Hayseed!
 

Attachments

  • Awesome_Signal_Alert_2.0.mq4
    10.3 KB · Views: 15
  • 👍
Reactions: Enivid

boa_conflictor

Master Trader
Aug 5, 2016
75
9
69
To make it complete i did add pushnotifications.

When i add the indicator to the charts, i receive non-stop pushnotifications....and the feature, i believe it should be "phone alert" is also not visible in the indicator window.

I think i'm almost there, compiling gives no errors, but not sure how to fix it...
 

Attachments

  • Awesome_Signal_Alert_2.0.1.mq4
    11.2 KB · Views: 15

Enivid

Administrator
Staff member
Nov 30, 2008
18,607
1,366
144
Odesa
www.earnforex.com
One of your SendNotification() calls ("AO CROSSED SIGNAL LINE - (BUY)") was outside the alert condition's curled brackets.

Also, if you want an input to enable and disable push notifications, you have to add it to the list of input variables (see the top of the indicator's code) and specify an if condition before calling SendNotification() each time.

The attached file has this all fixed.
 

Attachments

  • Awesome_Signal_Alert_2.0.2.mq4
    11.7 KB · Views: 81
  • 👍
Reactions: boa_conflictor