[MT4指标]不同均线交叉指示,主图mt4指标
不同均线交叉指示,主图mt4指标
可以节省下图表空间
//+------------------------------------------------------------------+
//| Alert SMA-EMA CrossOver.mq4 |
//| Copyright ? 2007, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ? 2007, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 Aqua
#property indicator_color3 DodgerBlue
#property indicator_color4 Magenta
//---- Variables Externes
extern int SMAPeriod = 13;
extern int EMAPeriod = 6;
extern int TimeFrame = 240;
extern bool Email = True;
//---- Indicateurs
double SMACurrent, SMAPrevious, EMACurrent, EMAPrevious;
int nShift, digit, digits;
int i,j,limit,counted_bars;
//---- Buffers
double ExtMapBuffer1; //SMA
double ExtMapBuffer2; //EMA
double ExtMapBuffer3; //Fleche Haut
double ExtMapBuffer4; //Fleche Bas
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
//---- Styles et couleur des Lignes
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2);
//---- Styles et couleur des Fleches
SetIndexStyle(2, DRAW_ARROW, 0, 1); // Fleche vers le haut
SetIndexArrow(2, 233);
SetIndexBuffer(2, ExtMapBuffer3);
SetIndexStyle(3, DRAW_ARROW, 0, 1); // Fleche vers le bas
SetIndexArrow(3, 234);
SetIndexBuffer(3, ExtMapBuffer4);
//----
switch(Period())
{
case 1: nShift = 1; break;
case 5: nShift = 3; break;
case 15: nShift = 5; break;
case 30: nShift = 10; break;
case 60: nShift = 15; break;
case 240: nShift = 20; break;
case 1440: nShift = 80; break;
case 10080: nShift = 100; break;
case 43200: nShift = 200; break;
}
//----
digits = MarketInfo(Symbol(),MODE_DIGITS);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
counted_bars=IndicatorCounted();
//----
if(counted_bars<0)
return(-1);
if(counted_bars>0)
counted_bars--;
limit=Bars-counted_bars;
for(i=0; i SMACurrent+ digit*Point) && ( EMAPrevious <= SMACurrent)) // Croisement WMA8 up bord sup閞ieur du tunnel
{
ExtMapBuffer3 = Low - nShift*Point;
Alert("SMA-EMA CrossOver Going for a BUY Trend Sesion ",SMACurrent," Price ",Close[1]," for ", Symbol(),"-",Period());
PlaySound("alert.wav");
if (Email)
{
SendMail("SMA-EMA CrossOver", "SMA-EMA CrossOver Going for a BUY Trend Sesion "+DoubleToStr(SMACurrent, digits)+" Price "+DoubleToStr(Close[1], digits)+" for "+Symbol()+"-"+Period());
}
}
//---- Sell
if((SMACurrent > EMACurrent+ digit*Point) && ( EMAPrevious >= SMACurrent)) // Croisement WMA8 down bord inf閞ieur du tunnel
{
ExtMapBuffer4 = High + nShift*Point;
Alert("SMA-EMA CrossOver Going for a SELL Trend Sesion ",SMACurrent," Price ",Close[1]," for ", Symbol(),"-",Period());
PlaySound("alert.wav");
if (Email)
{
SendMail("SMA-EMA CrossOver", "SMA-EMA CrossOver Going for a SELL Trend Sesion "+DoubleToStr(SMACurrent, digits)+" Price "+DoubleToStr(Close[1], digits)+" for "+Symbol()+"-"+Period());
}
}
}
//----
return(0);
}
//+------------------------------------------------------------------+Alert%20SMA-EMA%20CrossOver1.jpg
遇到矛盾 先站在对方的立场上想想问题,先试着去理解别人
● 如何使用WinMTR查询平台连接流畅度
发表于:2014-04-11 12:29只看该作者
2楼
看看看看看看看看。。。。
发表于:2015-04-21 15:59只看该作者
4楼
这个只是sma和ema交叉报警啊
韬客社区www.talkfx.co
发表于:2015-04-23 15:04只看该作者
5楼
好像不错啊。。
韬客社区www.talkfx.co
发表于:2015-04-28 03:11只看该作者
6楼
缺钱,灌水赚通宝,谢谢分享!!
韬客社区www.talkfx.co
发表于:2015-04-30 08:13只看该作者
7楼
灌水赚通宝,谢谢
韬客社区www.talkfx.co
发表于:2015-05-02 17:15只看该作者
8楼
灌水赚通宝,谢谢
韬客社区www.talkfx.co
发表于:2018-01-06 15:26只看该作者
9楼
谢谢朋友分享
韬客社区www.talkfx.co
发表于:2018-02-13 15:49只看该作者
11楼
让波动更明显
韬客社区www.talkfx.co