Download MetaTrader 5

Trading: Sound Alerts in Indicators

To add comments, please log in or register
Enable MQL5 Storage to store your source codes. It is free!
MetaQuotes Software Corp.
Moderator
181059
MetaQuotes Software Corp. 2007.05.03 10:06 

New article Sound Alerts in Indicators has been published:

How to create "voice" indicators for daily usage.

Though automated trading becomes more and more popular, many traders still practice manual trading. So, where an Expert Advisor needs some milliseconds to evaluate the current market situation, a human will spend much time, power and - which is most important - attention.

As a couple of years before, many traders use one or more Technical Indicators. Some strategies consider indicator values on several timeframes simultaneously.

So, how can one "catch" an important signal? There are several choices:

  • write an Expert Advisor that would analyze the market and alert about important events;
  • sit in front of the monitor and , switching between tens of charts, try to analyze the information from all of them;
  • add an alerting system into all indicators used.

The first choice is, in my opinion, the most proper. But it demands either programming skills or money to pay for realization. The second way is very time consuming, tiring, and inefficient. The third choice is a cross between the former two ways. One needs much fewer skills and less time to implement it, but it can really better the lot of the user trading manually.

It is the implementation of the third choice that the article is devoted to. After having read it, every trader will be able to add convenient alerts into indicators.

Author: Andrey Khatimlianskii

Linuxser
102
Linuxser 2007.06.29 02:18  
Thanks Andrey. Pretty Clear.
MQL4 Comments
16319
MQL4 Comments 2007.07.27 02:13  
Hi Andrey, I am new to MT4 and would like to set up an email alert when the Heiken Ashi close (open+close+high+low/4) crosses the smoothed MA 5. I have started reading through the help files but still have a ways to go before I can do this myself. Can you help me ? thank you
MQL4 Comments
16319
MQL4 Comments 2007.08.20 19:24  

Andrey,

thank for your indications, I really can't do it because I don't understand the codes, can you help me to get ADXcrosses with alerts signals????, can you help me in this way???

Really, thank a lot.

Best regards,

Ricardo

Ricardo Portugau

ricardo.portugau@gmail.com

Mehmet Bastem
240
Mehmet Bastem 2008.08.29 19:50  

how do using in EA?. for sParabolic Sub.mq4

Please a sample .

string result=iCustom(.....);

if result=="BUY" ...

if result =="sell"..

nozzgile
24
nozzgile 2011.08.03 09:25  
//+------------------------------------------------------------------+
//| DPC Market Range Alert.mq4 |
//| Copyright © 2010, MetaQuotes Software Corp. |
//| http://wwwDeltaPrimeCapital.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, MetaQuotes Software Corp."
#property link "http://wwwDeltaPrimeCapital.com"


extern int ATR = 26;
extern int ATRtf = PERIOD_D1;
extern int Range = 100;

int PrevAlertTime = 0;

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
int limit=Bars-counted_bars;
if(counted_bars>0) limit++;counted_bars--;
for(int i=0; i<limit; i++)
double ADR = iATR(NULL,ATRtf,ATR,i)/Point;
double DR = ( iHigh(NULL,ATRtf,0) - iLow(NULL,ATRtf,0) )/Point;
double DPR = (DR/ADR)*100;
double alertTag;
if ( (DPR*Point) > (Range*Point) )
{if ( alertTag!=Time[0])
{PlaySound("news.wav");// buy wav
Alert(Symbol()," M",Period()," ", Symbol(), " Reach ",Range, " %" );}alertTag = Time[0];}
//----
return(0);
}

//+------------------------------------------------------------------+

I have minor coding experience, this indicator always beep per tick, can you help me to fix it? thanks

MQL4 Comments
16319
MQL4 Comments 2011.12.31 07:18  

hi ricardo can you do me a favour do you have an ADX with sound alert..is it done are you willing to share it with me ???

happy new year!!

MQL4 Comments
16319
MQL4 Comments 2013.03.09 15:14  

help   plz     alert

 

 

 

#property copyright "?2007 RickD"
#property link      "http://www.e2e-fx.net/"

#define major   1
#define minor   0

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Yellow
#property indicator_width1  1
#property indicator_width2  1


extern int Fr.Period = 6;
extern int MaxBars = 500;


double upper_fr[];
double lower_fr[];

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

void init() {
  SetIndexBuffer(0, upper_fr);
  SetIndexBuffer(1, lower_fr);
 
  SetIndexEmptyValue(0, 0);
  SetIndexEmptyValue(1, 0);
 
  SetIndexStyle(0, DRAW_ARROW);
  SetIndexArrow(0, 234);

  SetIndexStyle(1, DRAW_ARROW);
  SetIndexArrow(1, 233); 
}

void start()
{
  int counted = IndicatorCounted();
  if (counted < 0) return (-1);
  if (counted > 0) counted--;
 
  int limit = MathMin(Bars-counted, MaxBars);
 
  //-----
 
  double dy = 0;
  for (int i=1; i <= 20; i++) {
    dy += 0.3*(High[i]-Low[i])/20;
  }
 
  for (i=0+Fr.Period; i <= limit+Fr.Period; i++)
  {
    upper_fr[i] = 0;
    lower_fr[i] = 0;
 
    if (is_upper_fr(i, Fr.Period)) upper_fr[i] = High[i]+dy;
    if (is_lower_fr(i, Fr.Period)) lower_fr[i] = Low[i]-dy;
  }
}

bool is_upper_fr(int bar, int period)
{
  for (int i=1; i<=period; i++)
  {
    if (bar+i >= Bars || bar-i < 0) return (false);

    if (High[bar] < High[bar+i]) return (false);
    if (High[bar] < High[bar-i]) return (false);
  }
 
  return (true);
}

bool is_lower_fr(int bar, int period)
{
  for (int i=1; i<=period; i++)
  {
    if (bar+i >= Bars || bar-i < 0) return (false);
   
    if (Low[bar] > Low[bar+i]) return (false);
    if (Low[bar] > Low[bar-i]) return (false);
  }
 
  return (true);
}
 

To add comments, please log in or register