gold 发表于 2011-10-15 02:48:20

请牛大帮忙修改ATR指标,使其能显示3条线

请牛大帮忙修改ATR指标,使其能显示3条线,5日ATR,10ATR,20ATR


//+------------------------------------------------------------------+
//|                                                          ATR.mq4 |
//|                      Copyright ?2005, MetaQuotes Software Corp. |
//|                                       http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright \"Copyright ?2005, MetaQuotes Software Corp.\"
#property link      \"http://www.metaquotes.net/\"

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 DodgerBlue
//---- input parameters
extern int AtrPeriod=14;
//---- buffers
double AtrBuffer[];
double TempBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
    {
   string short_name;
//---- 1 additional buffer used for counting.
   IndicatorBuffers(2);
//---- indicator line
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,AtrBuffer);
   SetIndexBuffer(1,TempBuffer);
//---- name for DataWindow and indicator subwindow label
   short_name=\"ATR(\"+AtrPeriod+\")\";
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);
//----
   SetIndexDrawBegin(0,AtrPeriod);
//----
   return(0);
    }
//+------------------------------------------------------------------+
//| Average True Range                                             |
//+------------------------------------------------------------------+
int start()
    {
   int i,counted_bars=IndicatorCounted();
//----
   if(Bars

guiliu 发表于 2012-11-21 23:00:05

回复一下

liulinqi05 发表于 2012-11-21 23:00:05

不错啊! 一个字牛啊!

好久不见 发表于 2012-11-21 23:00:05

厉害!强~~~~没的说了!

他们 发表于 2012-11-21 23:00:05

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

tat12345 发表于 2012-11-21 23:00:05

我来了~~~~~~~~~ 闪人~~~~~~~~~~~~~~~~

jamestin 发表于 2014-11-12 00:30:29

感谢分享

bxss 发表于 2014-11-13 11:27:04

看看是什么东西啊

分开过奖过 发表于 2014-11-15 13:37:33

EA真的能赚钱么?

kLBxEoOC 发表于 2014-12-20 11:05:15

xiexiefenxiang
页: [1] 2
查看完整版本: 请牛大帮忙修改ATR指标,使其能显示3条线