MT4的迪马克序列指标

阅读 作者:股海网时间 2013-09-08 益盟操盘手公式

#property indicator_chart_window
 #property indicator_buffers 1
 #property indicator_color1 LimeGreen
 //#property indicator_color2 Red
 //---- input parameters
 //int shift=0;
 int i;
 int num=0;
 int num1=0;
 string textVar;
 //---- buffers
 double ExtMapBuffer1[];
 //double ExtMapBuffer2[];
 
//double b4plusdi,b4minusdi,nowplusdi,nowminusdi;
 
//+------------------------------------------------------------------+
 //| Custom indicator initialization function |
 //+------------------------------------------------------------------+
 int init()
 {
 //---- indicators
 
SetIndexStyle(0,DRAW_ARROW);
 SetIndexArrow(0,159);
 SetIndexBuffer(0, ExtMapBuffer1);
 /*
 SetIndexStyle(1,DRAW_ARROW,EMPTY);
 SetIndexArrow(1,234);
 SetIndexBuffer(1, ExtMapBuffer2);
 */
 //----
 return(0);
 }
 //+------------------------------------------------------------------+
 //| Custor indicator deinitialization function |
 //+------------------------------------------------------------------+
 int deinit()
 {
 //---- TODO: add your code here
 int limit;
 limit=1500;
 for(int i=limit; i>=0; i--)
 {
  ObjectDelete(""+i);
 }
 
//----
 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=1500-counted_bars;
 //---- macd counted in the 1-st buffer
 
for(int i=limit; i>=0; i--)
 {
 if(Close[i+1]<Close[i+5])num = num + 1;
else num = 0;
  if (num > 0 && num < 10) {
   textVar = num;
   ObjectCreate(""+i, OBJ_TEXT, 0, Time[i+1],Low[i+1]-5*Point );
       ObjectSetText(""+i, ""+DoubleToStr(num,0), 10, "Arial", Red);
   }
   if (num == 9) {
   ObjectCreate(""+i, OBJ_TEXT, 0, Time[i+1],Low[i+1]-5*Point );
       ObjectSetText(""+i, ""+DoubleToStr(num,0), 16, "Arial", Red);
       }   
   else if((Close[i+1]<Close[i+5])&& num>=10)
   {
   ObjectCreate(""+i, OBJ_TEXT, 0, Time[i+1],Low[i+1]-5*Point );
       ObjectSetText(""+i, ""+DoubleToStr(num,0), 10, "Arial", Orange);   
   }
 
 
if(Close[i+1]>Close[i+5]) num1 = num1 + 1;
else num1 = 0;
 
 if (num1 > 0 && num1 < 10)
    {
   textVar = num1;
   ObjectCreate(""+i, OBJ_TEXT, 0, Time[i+1],High[i+1]+10*Point );
       ObjectSetText(""+i, ""+DoubleToStr(num1,0), 10, "Arial", RoyalBlue);
   }
   if (num1 == 9) {
   ObjectCreate(""+i, OBJ_TEXT, 0, Time[i+1],High[i+1]+10*Point );
       ObjectSetText(""+i, ""+DoubleToStr(num1,0), 16, "Arial", RoyalBlue);
       }   
   else if((Close[i+1]>Close[i+5])&& num1>=10)
   {
   ObjectCreate(""+i, OBJ_TEXT, 0, Time[i+1],High[i+1]+10*Point );
       ObjectSetText(""+i, ""+DoubleToStr(num1,0), 10, "Arial", LightSkyBlue);
     
   }
  
  
 }
 
//----
 return(0);
 }

收藏
全部看法共 0 条
上传会员: 
股海网
上传时间: 
2013-09-08
下载积分: 
-
免责申明: 
请仔细阅读并同意后才能下载
本附件为用户分享上传,股海网没有对文件进行验证,不能保证下载资源的准确性、安全性和完整性,也不保证下载资源能正常安装和使用,且下载后扣除的积分无法退还,除非您充分理解并完全接受本声明,否则您无权下载。
本站对提供下载的软件、指标、资料等不拥有任何权利,其版权归该下载资源的合法拥有者所有。本附件仅供学习和研究,不得用于商业或非法用途,如有侵犯您的版权,请参看 《侵权处理流程》《免责声明条款》
点击下载无反应时,更换手机自带浏览器重登录操作,如华为浏览器,苹果Safari浏览器,第三方浏览器有不兼容现象,或先收藏再到电脑端下载。
同意以上声明才能下载,扣除积分无法退还!
我已知晓! 点我同意 所有条款自愿下载!
如有问题请点关闭提交问题反馈→
关闭

问题反馈 取消