打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
KDJ

//+------------------------------------------------------------------+
//|                                                      KDJ共振.mq4 |
//|                                       Copyright ? 2009, wyd95968 |
//+------------------------------------------------------------------+
#property copyright "Copyright ? 2009, wyd95968"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_width1 1
#property indicator_color2 Blue
#property indicator_width2 1

 

extern int kperiod_5 = 5;
extern int dperiod_5 = 1;
extern int slowing_5 = 3;
extern int kperiod_30 = 30;
extern int dperiod_30 = 1;
extern int slowing_30 = 18;


/*
extern int
kperiod, dperiod, slowing*/

int MAMethod    = 0;
int PriceField  = 0;
int tt=10;

double s[];
double b[];
double b1[];
double b2[];
double b3[];
double b4[];
double b5[];

int init()  {
   IndicatorBuffers(7);
   SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,1);
   SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,1);
   SetIndexArrow(1,233);
   SetIndexArrow(0,234);
   SetIndexBuffer(0,s);
   SetIndexBuffer(1,b);
   SetIndexEmptyValue(0,0.0);
   SetIndexEmptyValue(1,0.0);
   SetIndexBuffer(2,b1);
   SetIndexBuffer(3,b2);
   SetIndexBuffer(4,b3);
   SetIndexBuffer(5,b4);
   SetIndexBuffer(6,b5);
//   Comment("p1="+p1+"\np2="+p2+"\np3="+p3);
   return(0);
}

void deinit()
{
   Comment("");
}

int start() {
   int counted_bars=IndicatorCounted();
   int i,limit;
  
   if (counted_bars<0) return(-1);
   if (counted_bars>0) counted_bars--;
   limit=Bars-1;
   if(counted_bars>=1) limit=Bars-counted_bars-1;
   if (limit<0) limit=0;

   for (i=0;i<=limit;i++)                    
   {
       b1[i]=iStochastic(NULL,0,kperiod_5,dperiod_5, slowing_5,MAMethod,PriceField,0,i);
       b2[i]=iStochastic(NULL,0,kperiod_5,dperiod_5, slowing_5,MAMethod,PriceField,0,i+1);
       b3[i]=iStochastic(NULL,0,kperiod_5,dperiod_5, slowing_5,MAMethod,PriceField,0,i+2);
      
       b4[i]=iStochastic(NULL,0,30,1,18,MAMethod,PriceField,0,i);
       b5[i]=iStochastic(NULL,0,30,1,18,MAMethod,PriceField,0,i+1);     
       if((b1[i]>b2[i])&&(b2[i]<b3[i])&&(b3[i]<40)&&(b4[i]>b5[i])&&(b4[i]<40))b[i]=Low[i]-tt*Point;//上
       if((b1[i]<b2[i])&&(b2[i]>b3[i])&&(b3[i]>60)&&(b4[i]<b5[i])&&(b4[i]>60))s[i]=High[i]+tt*Point; 

      

    
     
   }
   return(0);
}

  /*     
       if((b1[i]>b2[i])&&(b2[i]<b3[i])&&(b3[i]<40)&&(b4[i]<50))b[i]=Low[i]-tt*Point;//上
       if((b1[i]<b2[i])&&(b2[i]>b3[i])&&(b3[i]>60)&&(b4[i]>50))s[i]=High[i]+tt*Point; 
             
              if((b1[i]>b2[i])&&(b2[i]<b3[i])&&(b3[i]<40))b[i]=Low[i]-tt*Point;//上
       if((b1[i]<b2[i])&&(b2[i]>b3[i])&&(b3[i]>60))s[i]=High[i]+tt*Point;
              double h = High[Highest(0,0,MODE_HIGH,5,i+5)];
       double l = Low[Lowest(0,0,MODE_LOW,5,i+5)];
       double x = h - Open[i+5];
       double y = Close[i] - l;
       b4[i] = ((x+y)*100) / ((h-l)*2);
       */
       //Print(DoubleToStr(b4[i]));
      
      

       //b4[i]=iStochastic(NULL,0,kperiod_30,dperiod_30, slowing_30,MAMethod,PriceField,0,i);

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
关于MT4里BIAS的问题
双均线交叉报警指标源码公布!
双线MACD指标算法原理
(8)外汇MT4编程:MACD背离指标
看MT4代码,学编程 一
《MQL4实用编程》读书笔记(8)
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服