查看: 1569|回复: 3

请帮忙改写唐奇安通道

[复制链接]

8

主题

123

回帖

518

积分

积分
518
发表于 2012-1-4 12:44:48 | 显示全部楼层 |阅读模式
本帖最后由 JAMS49 于 2012-1-4 12:47 编辑

请帮忙改写唐奇安通道 MaPeriodHL.ex4 (2.66 KB, 下载次数: 56) 原码是20天收盘价的最高价或收盘价的最低价连线成通道,请帮忙改写成:20天最高价或最低价连线成通道,感谢不已。源码如下:


#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 DarkSalmon
#property indicator_color2 CornflowerBlue
//---- input p***meters
extern int       ExtP***m1=20;
extern int       ExtP***m2=20;
extern int       PriceMode=0;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexDrawBegin(1,ExtP***m1);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexDrawBegin(1,ExtP***m2);
   SetIndexBuffer(1,ExtMapBuffer2);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
//---- check for possible errors
   if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//----
   for(int i=0; i<limit; i++)
      //ExtMapBuffer1=iMA(NULL,0,ExtP***m1,MODE_EMA,0,PRICE_CLOSE,i);
      {
      if(PriceMode == 0) ExtMapBuffer1=Close[iLowest(NULL,0,MODE_CLOSE,ExtP***m1,i)];
      if(PriceMode == 1) ExtMapBuffer1=Low[iLowest(NULL,0,MODE_LOW,ExtP***m1,i)];
      }
//----
   for(i=0; i<limit; i++)
      {
      if(PriceMode == 0) ExtMapBuffer2=Close[iHighest(NULL,0,MODE_CLOSE,ExtP***m2,i)];
      if(PriceMode == 1) ExtMapBuffer2=High[iHighest(NULL,0,MODE_HIGH,ExtP***m2,i)];
      }
//---- done
   return(0);
  }
//+------------------------------------------------------------------+

4

主题

476

回帖

2096

积分

积分
2096
发表于 2013-2-7 15:37:23 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽

1

主题

1963

回帖

4703

积分

积分
4703
发表于 2013-10-20 18:23:46 | 显示全部楼层
意外呀板凳没人坐

1

主题

14

回帖

61

积分

积分
61
发表于 2013-12-9 22:21:26 | 显示全部楼层
这个很简单啊,没人告诉你啊?根本就不用改
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

风险提示:本站内容仅供学习交流,不构成投资建议;禁止开户导流、喊单与代客理财。系统已启用敏感词自动进审/禁发。 · 客服/举报
小黑屋|手机版|Archiver|联系我们|法律声明|智慧网

Powered by Discuz! X5.0 Licensed © 2001-2026 Discuz! Team.|京ICP备15025159号-2

QQ客服返回顶部