hnfj 发表于 2011-12-2 02:12:34

请求高人为我这指标加个提醒框和邮件发送功能

当指标完全变色后,再出现提示框和邮件发送。。。
谢谢!!


//+------------------------------------------------------------------+
//|                                             StepMA_Stoch_KV1.mq4 |
//|                           Copyright ?2005, TrendLaboratory Ltd. |
//|                                       E-mail: igorad2004@list.ru |
//|                           modified by Kalenzo -> simone@konto.pl |
//+------------------------------------------------------------------+
#property copyright \"Copyright ?2005, TrendLaboratory Ltd.\"
#property link      \"E-mail: igorad2004@list.ru\"
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Green
//#property indicator_minimum -1
//#property indicator_maximum 1
//---- input parameters
extern int PeriodWATR=10;
extern double Kwatr=1.0000;
extern int HighLow=0;
extern int NumberOfBarsToCalculate = 500;
//---- indicator buffers
double LineMinBuffer[];
double LineMidBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
    int init()
    {
   Comment(\"\");
//---- indicator line
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2);
   SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,2);
   SetIndexBuffer(0,LineMinBuffer);
   SetIndexBuffer(1,LineMidBuffer);
   IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
//---- name for DataWindow and indicator subwindow label
   //short_name=\"StepMA Stoch(\"+PeriodWATR+\",\"+Kwatr+\",\"+HighLow+\")\";
   SetIndexLabel(0,\"StepMA Stoch 1\");
   SetIndexLabel(1,\"StepMA Stoch 2\");
//----
   SetIndexDrawBegin(0,PeriodWATR);
   SetIndexDrawBegin(1,PeriodWATR);
   ArrayInitialize(LineMinBuffer,0);
   ArrayInitialize(LineMidBuffer,0);
   SetIndexEmptyValue(0,0);
   SetIndexEmptyValue(1,0);
//----
   return(0);
    }
//+------------------------------------------------------------------+
//| StepMA_3D_v1                                                         |
//+------------------------------------------------------------------+
int start()
    {
      string short_name;
      short_name = \"Max bars to count: |\"+(Bars-1)+\"| \";
      IndicatorShortName(short_name);
   int      i,shift,TrendMin,TrendMax,TrendMid;
   double   SminMin0,SmaxMin0,SminMin1,SmaxMin1,SumRange,dK,WATR0,WATRmax,WATRmin,WATRmid;
   double   SminMax0,SmaxMax0,SminMax1,SmaxMax1,SminMid0,SmaxMid0,SminMid1,SmaxMid1;
   double   linemin,linemax,linemid,Stoch1,Stoch2,bsmin,bsmax;
   
   double prev_y = 0,prev_b = 0;
      
   for(shift=NumberOfBarsToCalculate-1;shift>=0;shift--)
   {
   SumRange=0;
   for (i=PeriodWATR-1;i>=0;i--)
       {
         dK = 1+1.0*(PeriodWATR-i)/PeriodWATR;
         SumRange+= dK*MathAbs(High-Low);
         }
   WATR0 = SumRange/PeriodWATR;
   
   WATRmax=MathMax(WATR0,WATRmax);
   if (shift==NumberOfBarsToCalculate-1-PeriodWATR) WATRmin=WATR0;
   WATRmin=MathMin(WATR0,WATRmin);
   
   int StepSizeMin=MathRound(Kwatr*WATRmin/Point);
   int StepSizeMax=MathRound(Kwatr*WATRmax/Point);
   int StepSizeMid=MathRound(Kwatr*0.5*(WATRmax+WATRmin)/Point);
   
   if (HighLow>0)
   {
   SmaxMin0=Low+2*StepSizeMin*Point;
   SminMin0=High-2*StepSizeMin*Point;
   
   SmaxMax0=Low+2*StepSizeMax*Point;
   SminMax0=High-2*StepSizeMax*Point;
   
   SmaxMid0=Low+2*StepSizeMid*Point;
   SminMid0=High-2*StepSizeMid*Point;
   
   if(Close>SmaxMin1) TrendMin=1;
   if(CloseSmaxMax1) TrendMax=1;
   if(CloseSmaxMid1) TrendMid=1;
   if(CloseSmaxMin1) TrendMin=1;
   if(CloseSmaxMax1) TrendMax=1;
   if(CloseSmaxMid1) TrendMid=1;
   if(Close0 && SminMin00 && SminMax00 && SminMid00) linemin=SminMin0+StepSizeMin*Point;
   if (TrendMin0) linemax=SminMax0+StepSizeMax*Point;
   if (TrendMax0) linemid=SminMid0+StepSizeMid*Point;
   if (TrendMid

严守一 发表于 2012-11-22 01:36:01

谢谢分享了!

whyhui 发表于 2012-11-22 01:36:01

呵呵,明白了

huashoasjf 发表于 2012-11-22 01:36:01

嘿嘿

信和赢汇1 发表于 2012-11-22 01:36:01

给推荐一个好的平台,这样EA才能很好的发挥啊

纸老虎 发表于 2012-11-22 01:36:01

小心大家盯上你哦

小妖精 发表于 2012-11-22 01:36:01

呵呵 那就好好玩吧~~~~

QAZ123 发表于 2015-1-19 16:45:54

gggggggggrrrrrrr

why 发表于 2015-1-19 16:45:56

依百分hq 发表于 2015-1-19 23:04:41

页: [1] 2
查看完整版本: 请求高人为我这指标加个提醒框和邮件发送功能