论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
查看:1475回复:13
草龙
注册时间2004-12-17
[MT4指标]依据均线做斐波那契阻力支撑
楼主发表于:2014-09-28 18:38只看该作者倒序浏览
1楼 电梯直达
电梯直达
主图指标 mt4指标类型:趋势指标 是否能用在mt4手机版上:否 是否含有未来函数:无 //+------------------------------------------------------------------+ //| Critical Points.mq4 | //| emsjoflo | //| automaticforex.invisionzone.com | //+------------------------------------------------------------------+ #property copyright \"emsjoflo\" #property link \"automaticforex.invisionzone.com\" #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Red //---- input parameters extern int MAPeriod=157; extern int MAType = 0; extern int Fib1=21; extern int Fib2=34; extern int Fib3=55; extern int Fib4=89; extern int Fib5=144; extern int Fib6=233; extern int Fib7=377; extern int Fib8=610; extern color Color1=Khaki; extern color Color2=LightGreen; extern color Color3=LightSkyBlue; extern color Color4=Plum; extern color Color5=LightSalmon; extern color Color6=Tomato; extern color Color7=Magenta; extern color Color8=Aqua; double Line1,Line_1,Line2,Line_2,Line3,Line_3,Line4,Line_4,Line5,Line_5,Line6,Line_6,Line7,Line_7,Line8,Line_8,MAVal,MAValOld; //---- buffers double ExtMapBuffer1; //---- variables int MAMode; string strMAType; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,ExtMapBuffer1); //---- switch (MAType) { case 1: strMAType=\"EMA\"; MAMode=MODE_EMA; break; case 2: strMAType=\"SMMA\"; MAMode=MODE_SMMA; break; case 3: strMAType=\"LWMA\"; MAMode=MODE_LWMA; break; case 4: strMAType=\"LSMA\"; break; default: strMAType=\"SMA\"; MAMode=MODE_SMA; break; } return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- ObjectDelete(\"cp1\"); ObjectDelete(\"cp2\"); ObjectDelete(\"cp3\"); ObjectDelete(\"cp4\"); ObjectDelete(\"cp5\"); ObjectDelete(\"cp6\"); ObjectDelete(\"cp7\"); ObjectDelete(\"cp8\"); ObjectDelete(\"cp_1\"); ObjectDelete(\"cp_2\"); ObjectDelete(\"cp_3\"); ObjectDelete(\"cp_4\"); ObjectDelete(\"cp_5\"); ObjectDelete(\"cp_6\"); ObjectDelete(\"cp_7\"); ObjectDelete(\"cp_8\"); //---- return(0); } double LSMA(int Rperiod, int shift) { int i; double sum; int length; double lengthvar; double tmp; double wt; length = Rperiod; sum = 0; for(i = length; i >= 1 ; i--) { lengthvar = length + 1; lengthvar /= 3; tmp = 0; tmp = ( i - lengthvar)*Close[length-i+shift]; sum+=tmp; } wt = sum*6/(length*(length+1)); return(wt); } //+------------------------------------------------------------------+ //| 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 = Bars - counted_bars; for(int i=limit; i>=0; i--) { if (MAType == 4) { MAVal = LSMA(MAPeriod,i); } else { MAVal=iMA(NULL,0,MAPeriod,0,MAMode,PRICE_CLOSE,i); } ExtMapBuffer1 = MAVal; } Line1=MAVal+Fib1*Point; Line2=MAVal+Fib2*Point; Line3=MAVal+Fib3*Point; Line4=MAVal+Fib4*Point; Line5=MAVal+Fib5*Point; Line6=MAVal+Fib6*Point; Line7=MAVal+Fib7*Point; Line8=MAVal+Fib8*Point; Line_1=MAVal-Fib1*Point; Line_2=MAVal-Fib2*Point; Line_3=MAVal-Fib3*Point; Line_4=MAVal-Fib4*Point; Line_5=MAVal-Fib5*Point; Line_6=MAVal-Fib6*Point; Line_7=MAVal-Fib7*Point; Line_8=MAVal-Fib8*Point; if(ObjectFind(\"cp1\") != 0) { ObjectCreate(\"cp1\", OBJ_HLINE, 0, Time[20], Line1); ObjectSet(\"cp1\", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet(\"cp1\", OBJPROP_COLOR, Color1); } else { ObjectMove(\"cp1\", 0, Time[20], Line1); } if(ObjectFind(\"cp2\") != 0) { ObjectCreate(\"cp2\", OBJ_HLINE, 0, Time[20], Line2); ObjectSet(\"cp2\", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet(\"cp2\", OBJPROP_COLOR, Color2); } else { ObjectMove(\"cp2\", 0, Time[20], Line2); } if(ObjectFind(\"cp3\") != 0) { ObjectCreate(\"cp3\", OBJ_HLINE, 0, Time[20], Line3); ObjectSet(\"cp3\", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet(\"cp3\", OBJPROP_COLOR, Color3); } else { ObjectMove(\"cp3\", 0, Time[20], Line3); } if(ObjectFind(\"cp4\") != 0) { ObjectCreate(\"cp4\", OBJ_HLINE, 0, Time[20], Line4); ObjectSet(\"cp4\", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet(\"cp4\", OBJPROP_COLOR, Color4); } else { ObjectMove(\"cp4\", 0, Time[20], Line4); } if(ObjectFind(\"cp5\") != 0) { ObjectCreate(\"cp5\", OBJ_HLINE, 0, Time[20], Line5); ObjectSet(\"cp5\", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet(\"cp5\", OBJPROP_COLOR, Color5); } else { ObjectMove(\"cp5\", 0, Time[20], Line5); } if(ObjectFind(\"cp6\") != 0) { ObjectCreate(\"cp6\", OBJ_HLINE, 0, Time[20], Line6); ObjectSet(\"cp6\", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet(\"cp6\", OBJPROP_COLOR, Color6); } else { ObjectMove(\"cp6\", 0, Time[20], Line6); } if(ObjectFind(\"cp7\") != 0) { ObjectCreate(\"cp7\", OBJ_HLINE, 0, Time[20], Line7); ObjectSet(\"cp7\", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet(\"cp7\", OBJPROP_COLOR, Color7); } else { ObjectMove(\"cp7\", 0, Time[20], Line7); } if(ObjectFind(\"cp8\") != 0) { ObjectCreate(\"cp8\", OBJ_HLINE, 0, Time[20], Line8); ObjectSet(\"cp8\", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet(\"cp8\", OBJPROP_COLOR, Color8); } else { ObjectMove(\"cp8\", 0, Time[20], Line8); } if(ObjectFind(\"cp_1\") != 0) { ObjectCreate(\"cp_1\", OBJ_HLINE, 0, Time[20], Line_1); ObjectSet(\"cp_1\", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet(\"cp_1\", OBJPROP_COLOR, Color1); } else { ObjectMove(\"cp_1\", 0, Time[20], Line_1); } if(ObjectFind(\"cp_2\") != 0) { ObjectCreate(\"cp_2\", OBJ_HLINE, 0, Time[20], Line_2); ObjectSet(\"cp_2\", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet(\"cp_2\", OBJPROP_COLOR, Color2); } else { ObjectMove(\"cp_2\", 0, Time[20], Line_2); } if(ObjectFind(\"cp_3\") != 0) { ObjectCreate(\"cp_3\", OBJ_HLINE, 0, Time[20], Line_3); ObjectSet(\"cp_3\", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet(\"cp_3\", OBJPROP_COLOR, Color3); } else ObjectMove(\"cp_3\", 0, Time[20], Line_3); if(ObjectFind(\"cp_4\") != 0) { ObjectCreate(\"cp_4\", OBJ_HLINE, 0, Time[20], Line_4); ObjectSet(\"cp_4\", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet(\"cp_4\", OBJPROP_COLOR, Color4); } else ObjectMove(\"cp_4\", 0, Time[20], Line_4); if(ObjectFind(\"cp_5\") != 0) { ObjectCreate(\"cp_5\", OBJ_HLINE, 0, Time[20], Line_5); ObjectSet(\"cp_5\", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet(\"cp_5\", OBJPROP_COLOR, Color5); } else { ObjectMove(\"cp_5\", 0, Time[20], Line_5); } if(ObjectFind(\"cp_6\") != 0) { ObjectCreate(\"cp_6\", OBJ_HLINE, 0, Time[20], Line_6); ObjectSet(\"cp_6\", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet(\"cp_6\", OBJPROP_COLOR, Color6); } else { ObjectMove(\"cp_6\", 0, Time[20], Line_6); } if(ObjectFind(\"cp_7\") != 0) { ObjectCreate(\"cp_7\", OBJ_HLINE, 0, Time[20], Line_7); ObjectSet(\"cp_7\", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet(\"cp_7\", OBJPROP_COLOR, Color7); } else { ObjectMove(\"cp_7\", 0, Time[20], Line_7); } if(ObjectFind(\"cp_8\") != 0) { ObjectCreate(\"cp_8\", OBJ_HLINE, 0, Time[20], Line_8); ObjectSet(\"cp_8\", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet(\"cp_8\", OBJPROP_COLOR, Color8); } else { ObjectMove(\"cp_8\", 0, Time[20], Line_8); } //---- return(0); } //+------------------------------------------------------------------+
TK29帖子1楼右侧xm竖版广告90-240
个性签名

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

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告
风声加色
注册时间2016-05-14
尘缘在此
注册时间2016-03-13
发表于:2016-06-19 11:41只看该作者
3楼
非常感谢
个性签名

韬客社区www.talkfx.co

xhengde
注册时间2016-06-07
一笑置之
注册时间2011-01-25
发表于:2016-09-01 06:43只看该作者
5楼
谢谢楼主分享
albertK
注册时间2016-04-23
sinechen
注册时间2015-12-01
Pzxzx
注册时间2017-08-06
发表于:2017-08-08 23:13只看该作者
8楼
谢谢楼主分享
个性签名

韬客社区www.talkfx.co

广告
论坛谏言--外汇交易不应是你投资的全部,交易外汇也不应是你生活的全部
wuyummm
注册时间2017-08-17
taokefeng
注册时间2017-09-02
lyzlxy
注册时间2017-08-25
发表于:2017-11-05 11:10只看该作者
11楼
谢谢!收藏了
changkong
注册时间2017-10-02
发表于:2017-11-05 13:45只看该作者
12楼
学习了,谢谢分享
Jerrybaba
注册时间2017-12-28
uihnkljoi
注册时间2018-02-05
发表于:2018-06-12 12:40只看该作者
14楼
看不到效果图

本站免责声明:

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

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

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

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

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

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