📅 财经日历 📊 实时波动 📈 大盘云图 📶 行情走势 🆚 投机情绪 🚀 今日热点

    bull等前辈们请进。能帮我在指标里加一个发送Email的语句么

    2011-12-05 · 6187 阅读
    就是那个Top_Stop_v1的指标
      代码如下:

    • #property copyright "Copyright ?2005, TrendLaboratory Ltd."
    • #property link      "E-mail: igorad2004@list.ru"

    • #property indicator_chart_window
    • #property indicator_buffers 6
    • #property indicator_color1 Aqua
    • #property indicator_color2 Magenta
    • #property indicator_color3 Aqua
    • #property indicator_color4 Magenta
    • #property indicator_color5 Aqua
    • #property indicator_color6 Magenta
    • //---- input parameters
    • extern int ChannelPeriod=7;
    • extern double Risk=0.3;
    • extern int Signal=1;
    • extern int Line=1;
    • extern int Nbars=2000;
    • //---- indicator buffers
    • double UpTrendBuffer[];
    • double DownTrendBuffer[];
    • double UpTrendSignal[];
    • double DownTrendSignal[];
    • double UpTrendLine[];
    • double DownTrendLine[];
    • //+------------------------------------------------------------------+
    • //| Custom indicator initialization function                         |
    • //+------------------------------------------------------------------+
    • int init()
    •   {
    •    string short_name;
    • //---- indicator line
    •    SetIndexBuffer(0,UpTrendBuffer);
    •    SetIndexBuffer(1,DownTrendBuffer);
    •    SetIndexBuffer(2,UpTrendSignal);
    •    SetIndexBuffer(3,DownTrendSignal);
    •    SetIndexBuffer(4,UpTrendLine);
    •    SetIndexBuffer(5,DownTrendLine);
    •    SetIndexStyle(0,DRAW_ARROW);
    •    SetIndexStyle(1,DRAW_ARROW);
    •    SetIndexStyle(2,DRAW_ARROW);
    •    SetIndexStyle(3,DRAW_ARROW);
    •    SetIndexStyle(4,DRAW_LINE);
    •    SetIndexStyle(5,DRAW_LINE);
    •    SetIndexArrow(0,159);
    •    SetIndexArrow(1,159);
    •    SetIndexArrow(2,108);
    •    SetIndexArrow(3,108);
    • //---- name for DataWindow and indicator subwindow label
    •    short_name="PriceChannel_Stop_v1("+ChannelPeriod+")";
    •    IndicatorShortName(short_name);
    •    SetIndexLabel(0,"UpTrend Stop");
    •    SetIndexLabel(1,"DownTrend Stop");
    •    SetIndexLabel(2,"UpTrend Signal");
    •    SetIndexLabel(3,"DownTrend Signal");
    •    SetIndexLabel(4,"UpTrend Line");
    •    SetIndexLabel(5,"DownTrend Line");
    • //----
    •    SetIndexDrawBegin(0,ChannelPeriod);
    •    SetIndexDrawBegin(1,ChannelPeriod);
    •    SetIndexDrawBegin(2,ChannelPeriod);
    •    SetIndexDrawBegin(3,ChannelPeriod);
    •    SetIndexDrawBegin(4,ChannelPeriod);
    •    SetIndexDrawBegin(5,ChannelPeriod);
    • //----
    •    return(0);
    •   }
    • //+------------------------------------------------------------------+
    • //| PriceChannel_Stop_v1                                             |
    • //+------------------------------------------------------------------+
    • int start()
    •   {
    •    int    i,shift,trend;
    •    double high, low, price;
    •    double smax[5000],smin[5000],bsmax[5000],bsmin[5000];
    •    
    •    for (shift=Nbars-1;shift>=0;shift--)
    •    {
    •    UpTrendBuffer[shift]=EMPTY_VALUE;
    •    DownTrendBuffer[shift]=EMPTY_VALUE;
    •    UpTrendSignal[shift]=EMPTY_VALUE;
    •    DownTrendSignal[shift]=EMPTY_VALUE;
    •    UpTrendLine[shift]=EMPTY_VALUE;
    •    DownTrendLine[shift]=EMPTY_VALUE;
    •    }
    •    for (shift=Nbars-ChannelPeriod-1;shift>=0;shift--)
    •    {      
    •       high=High[shift]; low=Low[shift]; i=shift-1+ChannelPeriod;
    •       while(i>=shift)
    •         {
    •          price=High;
    •          if(highprice)  low=price;
    •          i--;
    •         }
    •      smax[shift]=high;
    •      smin[shift]=low;
    •      
    •      bsmax[shift]=smax[shift]-(smax[shift]-smin[shift])*Risk;
    •           bsmin[shift]=smin[shift]+(smax[shift]-smin[shift])*Risk;
    •      
    •      if (Close[shift]>bsmax[shift+1])  trend=1;
    •           if (Close[shift]0 && bsmin[shift]0)
    •           {
    •              if (Signal>0 && UpTrendBuffer[shift+1]==-1.0)
    •              {
    •              UpTrendSignal[shift]=bsmin[shift];
    •             
    •              if(Line>0) UpTrendLine[shift]=bsmin[shift];
    •              }
    •              else
    •              {
    •              UpTrendBuffer[shift]=bsmin[shift];
    •              if(Line>0) UpTrendLine[shift]=bsmin[shift];
    •              UpTrendSignal[shift]=-1;            
    •              }
    •           if (Signal==2) UpTrendBuffer[shift]=0;   
    •           DownTrendBuffer[shift]=-1.0;
    •           DownTrendLine[shift]=EMPTY_VALUE;

    •           }
    •           if (trend0 && DownTrendBuffer[shift+1]==-1.0)
    •              {
    •              DownTrendSignal[shift]=bsmax[shift];

    •              if(Line>0) DownTrendLine[shift]=bsmax[shift];
    •              }
    •              else
    •              {
    •              DownTrendBuffer[shift]=bsmax[shift];
    •              if(Line>0)DownTrendLine[shift]=bsmax[shift];
    •              DownTrendSignal[shift]=-1;            
    •              }
    •           if (Signal==2) DownTrendBuffer[shift]=0;   
    •           UpTrendBuffer[shift]=-1.0;
    •           UpTrendLine[shift]=EMPTY_VALUE;
    •           }
    •          
    •          
    •    }
    •    return(0);  }

    复制代码
                  2011-6-23 09:51 上传
      下载附件 (30.83 KB)   
      
      
          
      我想在每次变盘。也就是那个圆圆的图标出现时给我发email,其实发邮件的语句也找到了:SendMail( Symbol()+DoubleToStr(Close[0],Digits),"" );
      可是我不论放在代码哪个位置。。它就是不管不顾的拼命发邮件。。。。一分钟发几十封。。。可我只想在变盘的时候发一封啊。。请各位大侠指点一二啊
    ""
    还没有人打赏,支持一下
    回复

    举报

     

    回答|共 17 个

    火凤凰一辉 LV5

    发表于 2012-11-25 16:59:05 | 显示全部楼层

    EA要好!  

    hate LV6

    发表于 2012-11-25 16:59:05 | 显示全部楼层

    顶的就是你  

    小飞鱼常春 LV6

    发表于 2012-11-25 18:27:51 | 显示全部楼层

    唉,悲催的外汇。。  

    □o□ LV6

    发表于 2012-11-25 18:27:51 | 显示全部楼层

    哪里可以下载到好的EA哦  

    愚人码头 LV4

    发表于 2012-11-25 18:27:51 | 显示全部楼层

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

    liulinqi05 LV5

    发表于 2012-11-25 18:27:51 | 显示全部楼层

    …没我说话的余地…飘走  

    稳赚 LV4

    发表于 2012-11-25 18:27:51 | 显示全部楼层

    这个站不错!!  

    落羽 LV5

    发表于 2012-11-25 18:27:51 | 显示全部楼层

    支持一下吧  

    nord LV5

    发表于 2015-1-24 23:20:47 | 显示全部楼层

    nice!!!!!!!!!!!!
    12下一页
    您需要登录后才可以回帖 登录 | 注册

    提醒: 禁止引战、谩骂、灌水内容

    微信二维码

    有问题联系客服