PlaySound and Alert

Back to topics list  | 1 2 To post a new topic, please log in or register
avatar
87
brspMA 2007.07.26 03:40 #
 
Thanks Zap,

I really appreciate that. Actually, this is an EA. I am just trying to send an e-mail, or play a sound in the middle of my EA, but looks like it is impossible:) If I write this small program in a script it works fine, but when I write it in an EA, it doesn't work.

Might have something I am missing here. Any clue would be must welcome.

Thanks again folks.




 
avatar
126
Zap 2007.07.26 11:59 #
 
Well, keep in mind that EAs run on incoming ticks. Put a counter to a comment, in order to monitor tick flow. There are periods (like US nigth time) when there are no new ticks for 10s of minutes, and there are no ticks on weekends at all.
Init() runs whenever you attach your EA (this is the point of it), but start() will only run first on the first new tick: this is important!
 
avatar
87
brspMA 2007.07.26 20:20 #
 
Thanks again. I see what is the problem. But how I can fix that?

Let's say I want to send an e-mail every time a new H4 bar starts. That seems very simple, but I have no clue how to do it. Please, which code should I put in my EA? Thanks again all of you folks.


//+------------------------------------------------------------------+
//|                                                    H4 e-mail.mq4 |
//|                      Copyright © 2007, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
   
 
CODE FOR SENDING ONE E-MAIL EACH FOUR HOUR AT THE BEGINNING OF A H4 BAR. THANKS 
 
 
//----
   return(0);
  }
//+------------------------------------------------------------------+

 
avatar
87
brspMA 2007.08.10 08:06 #
 
Ok.... I would like to say that the e-mail is working properly now. thank you guys for the help.
 
avatar
57
rortiz77 2009.08.04 05:18 #
 
brspMA:
Ok.... I would like to say that the e-mail is working properly now. thank you guys for the help.

How did you get the email to work??? I have yet to see a documented "How to..." for setting up the email function.

 
avatar
13009
WHRoeder 2010.09.17 00:21 #
 
brspMA:
Let's say I want to send an e-mail every time a new H4 bar starts. That seems very simple, but I have no clue how to do it.
int start(){
   static datetime Time0;    bool new.bar    = Time0 < Time[0];
   if (!new.bar) return;                       Time0 = Time[0];
   ...
or
int start(){
   static datetime Time0;    if (Time0 < Time[0]){  Time0 = Time[0];
      ...
   }

Back to topics list   | 1 2  

To add comments, please log in or register