论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
查看:1523回复:15
草龙
注册时间2004-12-17
[MT4指标]GRFLeadingEdge指标
楼主发表于:2013-12-29 23:14只看该作者倒序浏览
1楼 电梯直达
电梯直达
//+------------------------------------------------------------------+ //| | //| Copyleft 2007, GammaRatForex | //| http://www.gammarat.com/Forex | //+------------------------------------------------------------------+ #property copyright "Copyleft 2007, GammaRatForex" #property link "http://www.gammarat.com/Forex/" //design based on the principles similar to the MetaTrader STD Channel // LSQ line fitting to the a number of samples. // The trendline is the leading point in the fit; // the bands are calculated somewhat differently, check the math below and adapt to // your own needs as appropriate // also the point estimate is given by the geometric mean // MathPow(HCCC,.025) (see function "get_avg" below) rather than // more standard estimates. // It's computationally fairly intensive // //#property indicator_separate_window //#property indicator_minimum 0 //#property indicator_maximum 100 #property indicator_chart_window #property indicator_buffers 5 //---- #property indicator_color1 Aqua #property indicator_color2 Aqua #property indicator_color3 Aqua #property indicator_color4 Red #property indicator_color5 Red #property indicator_style1 0 #property indicator_style2 2 #property indicator_style3 2 #property indicator_style4 2 #property indicator_style5 2 //---- input parameters extern int Samples=60; extern int LookAhead=0; extern double StdLevel1=2; extern double StdLevel2 =4.; //---- buffers double LeadingEdgeBuffer; double LeadingEdgeBufferPlus1; double LeadingEdgeBufferNeg1; double LeadingEdgeBufferPlus2; double LeadingEdgeBufferNeg2; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators if(LookAhead <0)LookAhead=0; SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,LeadingEdgeBuffer); SetIndexShift(0,LookAhead); SetIndexDrawBegin(0,LookAhead+Samples+1); SetIndexLabel(0,"LeadingEdge Trend"); if(MathAbs(StdLevel1) > 0) { SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,LeadingEdgeBufferPlus1); SetIndexShift(1,LookAhead); SetIndexDrawBegin(1,LookAhead+Samples+1); SetIndexLabel(1,"LeadingEdge +" + DoubleToStr(StdLevel1,1) + " STD"); SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(2,LeadingEdgeBufferNeg1); SetIndexShift(2,LookAhead); SetIndexDrawBegin(2,LookAhead+Samples+1); SetIndexLabel(2,"LeadingEdge -" + DoubleToStr(StdLevel1,1) + " STD"); } if(MathAbs(StdLevel2) > 0) { SetIndexStyle(3,DRAW_LINE); SetIndexBuffer(3,LeadingEdgeBufferPlus2); SetIndexShift(3,LookAhead); SetIndexDrawBegin(3,LookAhead+Samples+1); SetIndexLabel(3,"LeadingEdge +" + DoubleToStr(StdLevel2,1) + " STD"); SetIndexStyle(4,DRAW_LINE); SetIndexBuffer(4,LeadingEdgeBufferNeg2); SetIndexShift(4,LookAhead); SetIndexDrawBegin(4,LookAhead+Samples+1); SetIndexLabel(4,"LeadingEdge -" + DoubleToStr(StdLevel2,1) + " STD"); } //compute(); //---- return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { compute(); return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int compute() { int i,j,counted_bars=IndicatorCounted(); static double a[2][2],b[2][2]; double base_det,c0,c1,v1,v2,alpha,beta; static int a_loaded=0; double s0,s1; double c01,c11; //---- if(Bars=0;i--) { if(i >=Bars-Samples) { continue; } c0=0; c1=0; for(j=0;j0) { LeadingEdgeBufferPlus1=LeadingEdgeBuffer+StdLevel1*c0*Point; LeadingEdgeBufferNeg1=LeadingEdgeBuffer-StdLevel1*c1*Point; } if(MathAbs(StdLevel2)>0) { LeadingEdgeBufferPlus2=LeadingEdgeBuffer+StdLevel2*c0*Point; LeadingEdgeBufferNeg2=LeadingEdgeBuffer-StdLevel2*c1*Point; } } } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ double get_avg(int k) { return(MathPow((High[k]*Low[k]*Close[k]*Close[k]),1/4.)/Point); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ double det2(double a) { return(a[0][0]*a[1][1]-a[1][0]*a[0][1]); } //+------------------------------------------------------------------+172_GRFLeadingEdge.jpg172_GRFLeadingEdge.jpg
TK29帖子1楼右侧xm竖版广告90-240
个性签名

阅尽天下指标
搬砖开始,始于2014

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告
woaicr
注册时间2014-11-10
发表于:2014-11-16 02:45只看该作者
2楼
emoji-imageemoji-image
个性签名

韬客社区www.talkfx.co

woaicr
注册时间2014-11-10
发表于:2014-11-16 02:45只看该作者
3楼
emoji-imageemoji-image
个性签名

韬客社区www.talkfx.co

rfvedc
注册时间2014-12-26
zhangdada
注册时间2015-09-30
xinma
注册时间2016-03-19
发表于:2016-04-21 06:04只看该作者
8楼
灌水赚通宝,谢谢分享
ccs
注册时间2016-04-15
xilutou
注册时间2016-02-06
发表于:2016-07-21 14:11只看该作者
10楼
55555555555552222222222222222222222222
xilutou
注册时间2016-02-06
发表于:2016-07-21 14:11只看该作者
11楼
7777777777777777777777777777777777777
个性签名

韬客社区www.talkfx.co

liverpool
注册时间2016-06-27
发表于:2016-07-22 14:44只看该作者
12楼
灌水赚通宝,谢谢分享
hyg
注册时间2016-07-26
hyg
注册时间2016-07-26
goodday
注册时间2016-12-06
发表于:2016-12-07 09:11只看该作者
15楼
谢谢分享
Pzxzx
注册时间2017-08-06
发表于:2017-08-08 07:49只看该作者
16楼
灌水赚通宝,谢谢分享
个性签名

韬客社区www.talkfx.co

本站免责声明:

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

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

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

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

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

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