mt4平台3线kdj指标_三线tⅹt下载

mt4平台3线kdj指标_三线tⅹt下载在MT4上,是没有三线KDJ指标的,分享KDJ指标源码:#propertycopyright”Copyright2020″#propertylink”https://www.mql5.com”#propertyversion”1.00″#propertystrict#propertyindicator_separate_window#propertyindicator_buffers3#propertyindicator_plots3//—p

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

在MT4上,是没有三线KDJ指标的,分享KDJ指标源码:

#property copyright "Copyright 2020"
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_plots 3
//--- plot KLine
#property indicator_label1 "KLine"
#property indicator_type1 DRAW_LINE
#property indicator_color1 clrWhite
#property indicator_style1 STYLE_SOLID
#property indicator_width1 1
//--- plot DLine
#property indicator_label2 "DLine"
#property indicator_type2 DRAW_LINE
#property indicator_color2 clrGold
#property indicator_style2 STYLE_SOLID
#property indicator_width2 1
//--- plot JLine
#property indicator_label3 "JLine"
#property indicator_type3 DRAW_LINE
#property indicator_color3 clrDarkViolet
#property indicator_style3 STYLE_SOLID
#property indicator_width3 1

#property indicator_levelstyle STYLE_DOT
#property indicator_levelcolor clrSilver
#property indicator_level1 0
#property indicator_level2 20
#property indicator_level3 50
#property indicator_level4 80
#property indicator_level5 100


//---- input parameters
input int N =9;//%K 周期
input int M1=3;//%D 周期
input int M2=3;//慢速
//--- indicator buffers
double         KBuffer[];
double         DBuffer[];
double         JBuffer[];
double llv[],hhv[],rsv[];
double p=0,p1=0;
double f=0,f1=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
  { 
   
//--- indicator buffers mapping
   IndicatorBuffers(6);
   SetIndexBuffer(0,KBuffer);
   SetIndexBuffer(1,DBuffer);
   SetIndexBuffer(2,JBuffer);
   SetIndexBuffer(3,llv,INDICATOR_CALCULATIONS);
   SetIndexBuffer(4,hhv,INDICATOR_CALCULATIONS);
   SetIndexBuffer(5,rsv,INDICATOR_CALCULATIONS);

   for(int i=0; i<6; i++)
     { 
   
      SetIndexDrawBegin(i,N+M1+M2);
     }


   SetLevelValue(0,0);
   SetLevelValue(1,20);
   SetLevelValue(2,50);
   SetLevelValue(3,80);
   SetLevelValue(4,100);

   string name = "KDJ("+ (string)N+","+(string)M1+","+(string)M2+")";
   IndicatorShortName(name);

   IndicatorDigits(2);

   if(N<=0||M1<=0||M2<=0)
      return(INIT_FAILED);

   p = 1.0/M1;
   p1 = 1-p;
   f = 1.0/M2;
   f1 = 1-f;



//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  { 
   
//---
   int i,limit=0;
   if(rates_total<=0)
      return(0);
   if(prev_calculated<=0)
      limit=rates_total-1;
   else
      limit = rates_total - prev_calculated +1;

   for(i=limit; i>=0; i--)
     { 
   
      llv[i]=0;
      hhv[i]=0;
      if(i>rates_total-N)
         continue;
      int shift = iLowest(NULL,0,MODE_LOW,N,i);
      llv[i] =  low[shift];
      shift = iHighest(NULL,0,MODE_HIGH,N,i);
      hhv[i] = high[shift];
     }
   for(i=limit; i>=0; i--)
     { 
   
      rsv[i] = 0;
      if(hhv[i]>0 && llv[i]>0 && (hhv[i]-llv[i])!=0)
         rsv[i] = (close[i]-llv[i])/(hhv[i]-llv[i])*100;
     }

   for(i=limit; i>=0; i--)
     { 
   
      if(i==rates_total-1)
         KBuffer[i]=0;
      else
        { 
   
         KBuffer[i] = rsv[i]*p + KBuffer[i+1]*p1;
        }
     }

   for(i=limit; i>=0; i--)
     { 
   
      if(i==rates_total-1)
         DBuffer[i]=0;
      else
        { 
   
         DBuffer[i] = KBuffer[i]*f + DBuffer[i+1]*f1;
        }
     }

   for(i=limit; i>=0; i--)
     { 
   
      JBuffer[i] = 3*KBuffer[i] - 2*DBuffer[i];
     }


//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/170487.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Python–csv文件处理建议收藏

    CSV(Comma-SeparatorValues)逗号分割值,由于是纯文本文件,任何编辑器都可以打开。下面用csv和pandas两种方式进行csv文件操作原始csv文件内容1.csv包操作c

    2021年12月18日
    42
  • springcloud和dubbo区别「建议收藏」

    springcloud和dubbo区别「建议收藏」最大区别SpringCloud抛弃了Dubbo的RPC通信,采用的是基于HTTP的REST方式。这两种方式各有优劣。虽然从一定程度上来说,后者牺牲了服务调用的性能,但也避免了上面提到的原生RPC带来的问题。而且REST相比RPC更为灵活,服务提供方和调用方的依赖只依靠一纸契约,不存在代码级别的强依赖,这在强调快速演化的微服务环境下,显得更加合适。…

    2022年6月5日
    26
  • 图书馆借阅系统「建议收藏」

    图书馆借阅系统一、图书馆借阅系统是对书籍信息操作的信息管理系统。书籍信息包括书名、作者、编号、是否借出。本系统针对两类用户(图书管理员和学生)使用,对于图书馆管理员,可以进行查看书籍列表、查找书籍、新增书籍信息、删除书籍、退出登录操作;对于学生,可以进行查看书籍列表、查找书籍、借阅书籍、归还书籍、退出登录操作。二、代码部分1.book包的建立Book类的建立对于图书馆借阅系统,把书看作一个对象,根据该book所具有的属性,定义一系列书籍的私有属性,以及对这些属性进行操作的访问器(get())和设置器

    2022年4月12日
    46
  • 矩阵可逆的充要条件证明_两个矩阵相乘所得矩阵的秩

    矩阵可逆的充要条件证明_两个矩阵相乘所得矩阵的秩矩阵可逆的充要条件有很多,在此进行总结。设A为n阶矩阵,则矩阵A可逆的充要条件为:|A|≠0;r(A)=n;A的列(行)向量组线性无关;A的特征值中没有0;A可分解为若干初等矩阵的乘积.

    2022年8月5日
    17
  • GTA5快速进入线上模式

    GTA5快速进入线上模式话不多说,上资源:链接:https://pan.baidu.com/s/1oWE6L0J1s33R_2zfcxiG_A提取码:b9tf解压后,先启动GTA5,进入游戏菜单界面然后打开Xenos(32位)或者Xenos64(64位)将文件夹下的GTAO_Booster.dll拖动进列表框内Process选择GTAV.exe(每次启动游戏进程ID会有所不同)最后点击Add将加速模块注入近gtaji…

    2022年6月14日
    106
  • 二叉树计算叶子节点的计算问题

    二叉树计算叶子节点的计算问题题目如下:计算方法需要使用两个结论:1:总结点数=树中的边数+1。见下图可以清晰明白。2:叶子节点数=总结点数-度数非零的节点数(戒子节点度为0)所以本题目解法:总结点数=20*4+10

    2022年8月1日
    4

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号