Buy Sell Alerts

chilgu

Active Member
#1
I request to add Buy Sell alerts on screen with sound and email in appended meta trader 4 file.

It is also requested to convert it to Amibroker AFL



//+------------------------------------------------------------------+
//| Xma.mq4 |
//| Copyright 2009, XrustSolution. Toys from Vinin.|
//| http://www.xrust.ucoz.net http://www.vinin.ucoz.ru |
//| [email protected] [email protected] [email protected] |
//| , |
//| |
//-------------------------------------------------------------------+
#property copyright "#Copyright 2008, XrustSolution.#"
#property link "#http://www.xrust.ucoz.net#"
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Blue

extern int period=12;
extern int porog =3;
extern int metod =1;
extern int metod2=1;
extern int prise =0;
//---- buffers
double Signal[];
//+------------------------------------------------------------------+
void init(){
SetIndexStyle(0,DRAW_LINE);
SetIndexDrawBegin(0,0);
SetIndexBuffer(0,Signal);
IndicatorShortName("Xma"+period+porog);
return;}
//+------------------------------------------------------------------+
int start() {
int limit;
double tmp1,tmp2;
int counted_bars=IndicatorCounted();
int i;
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for (i = limit;i>=0;i--){
tmp1=iMA(Symbol(),0,period,0,metod,prise,i);
tmp2=iMA(Symbol(),0,period,1,metod2,prise,i);
if(MathAbs(tmp1-tmp2)>=porog*Point){
Signal=tmp2;
}else{
Signal=Signal[i+1];
}
}
return(0);}
//+------------------------------------------------------------------+
 
Last edited:

Similar threads