论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
  • 1
  • 2
前往
共 23 条
帖子
作者
回复/查看
最后发表
2023-01-06 07:18
#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=0; hhv=0; if(i>rates_total-N) continue; int shift = iLowest(NULL,0,MODE_LOW,N,i); llv = low[shift]; shift = iHighest(NULL,0,MODE_HIGH,N,i); hhv = high[shift]; } for(i=limit; i>=0; i--) { rsv = 0; if(hhv>0 && llv>0 && (hhv-llv)!=0) rsv = (close-llv)/(hhv-llv)*100; } for(i=limit; i>=0; i--) { if(i==rates_total-1) KBuffer=0; else { KBuffer = rsv*p + KBuffer[i+1]*p1; } } for(i=limit; i>=0; i--) { if(i==rates_total-1) DBuffer=0; else { DBuffer = KBuffer*f + DBuffer[i+1]*f1; } } for(i=limit; i>=0; i--) { JBuffer = 3*KBuffer - 2*DBuffer; } //--- return value of prev_calculated for next call return(rates_total); } //+------------------------------------------------------------------+
2023-01-06 06:55
#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=0; hhv=0; if(i>rates_total-N) continue; int shift = iLowest(NULL,0,MODE_LOW,N,i); llv = low[shift]; shift = iHighest(NULL,0,MODE_HIGH,N,i); hhv = high[shift]; } for(i=limit; i>=0; i--) { rsv = 0; if(hhv>0 && llv>0 && (hhv-llv)!=0) rsv = (close-llv)/(hhv-llv)*100; } for(i=limit; i>=0; i--) { if(i==rates_total-1) KBuffer=0; else { KBuffer = rsv*p + KBuffer[i+1]*p1; } } for(i=limit; i>=0; i--) { if(i==rates_total-1) DBuffer=0; else { DBuffer = KBuffer*f + DBuffer[i+1]*f1; } } for(i=limit; i>=0; i--) { JBuffer = 3*KBuffer - 2*DBuffer; } //--- return value of prev_calculated for next call return(rates_total); } //+------------------------------------------------------------------+
2023-01-06 06:52
2008-08-11 08:59
59
3431
2008-08-13 00:37
原帖由 飞猪撞圈 于 2008-8-11 17:07 发表 http://www.talkfx.com/images/common/back.gif 短线一般是1500点 想做长点就3000点嘛
:L :o 汗一个..................
2008-08-11 16:50
2008-07-03 16:07
48
17550
2021-07-14 16:14
2008-08-11 16:29
2008-08-08 03:09
64
11277
2023-11-25 12:20
原帖由 秃鹫 于 2008-8-8 11:24 发表 http://www.talkfx.com/images/common/back.gif 时差与时区名称,可以自由设置
:) 老大..昨天请你帮忙编一个K线在加权平均线组上下的报警指标........不知道你还记不记得呢?
2008-08-08 05:34
2008-03-04 09:40
794
39044
2008-04-24 08:00
2008-03-05 02:44
2005-04-26 14:36
226
70732
2018-08-21 15:25
原帖由 老正 于 2003-10-10 12:00 发表 http://www.talkfx.com/images/common/back.gif ftp://upload:[email protected]/技术操作的万法归宗.zip 我把他整理到一页上了 [ 此消息由 老正 在 2003-10-10.12:01:42 编辑过 ] 次贴地址实效 想看的 去下页 [此帖子已被 老正 在 2004-8-15 23:36 ...
kan kan
2007-11-05 06:13
2007-07-09 12:01
58
8940
2019-01-09 03:02
到期了!不能用了!:L
2007-08-05 01:53
  • 1
  • 2
前往
共 23 条

本站免责声明:

1、本站所有广告及宣传信息均与韬客无关,如需投资请依法自行决定是否投资、斟酌资金安全及交易亏损风险;

2、韬客是独立的、仅为投资者提供交流的平台,网友发布信息不代表韬客的观点与意思表示,所有因网友发布的信息而造成的任何法律后果、风险与责任,均与韬客无关;

3、金融交易存在极高法律风险,未必适合所有投资者,请不要轻信任何高额投资收益的诱导而贸然投资;投资保证金交易导致的损失可能超过您投入的资金和预期。请您考虑自身的投资经验及风险承担能力,进行合法、理性投资;

4、所有投资者的交易帐户应仅限本人使用,不应交由第三方操作,对于任何接受第三方喊单、操盘、理财等操作的投资和交易,由此导致的任何风险、亏损及责任由投资者个人自行承担;

5、韬客不隶属于任何券商平台,亦不受任何第三方控制,韬客不邀约客户投资任何保证金交易,不接触亦不涉及投资者的任何资金及账户信息,不代理任何交易操盘行为,不向客户推荐任何券商平台,亦不存在其他任何推荐行为。投资者应自行选择券商平台,券商平台的任何行为均与韬客无关。投资者注册及使用韬客即表示其接受和认可上述声明,并自行承担法律风险。

版权所有:韬客外汇论坛 www.talkfx.com 联络我们:[email protected]