Download MetaTrader 5

PlaySound and Alert - page 2

To add comments, please log in or register
Order a robot or an indicator for MetaTrader. The Freelance service will help you!
ma
236
ma 2007.07.26 01: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.
zap
181
zap 2007.07.26 09: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!
ma
236
ma 2007.07.26 18: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);
  }
//+------------------------------------------------------------------+
ma
236
ma 2007.08.10 06:06  
Ok.... I would like to say that the e-mail is working properly now. thank you guys for the help.
ron
154
ron 2009.08.04 03: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.

whroeder1
14495
whroeder1 2010.09.16 22: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];
      ...
   }
12
To add comments, please log in or register