论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
查看:1242回复:1
草龙
注册时间2004-12-17
[MT4指标]趋势阻力区间指标
楼主发表于:2014-09-09 11:46只看该作者倒序浏览
1楼 电梯直达
电梯直达
主图指标 趋势阻力区间指标 mt4指标类型:趋势指标 是否能用在mt4手机版上:否 是否含有未来函数:无 可以用在韬客外汇返佣网的平台上 #property copyright "[email protected]" #property indicator_chart_window extern int HistoryDay=5; extern int timeshift=0; //+------------------------------------------------------------------+ int deinit() { ObjectsDeleteAll(0,EMPTY); return(0); } //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { } return(0); //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { double x; int h,m,s,k; m=Time[0]+Period()*60-CurTime(); x=m/60.0; s=m%60; m=(m-m%60)/60; h=x/60; k=m-(h*60); for (int i=HistoryDay;i>=0;i--) { datetime TokyoStart=StrToTime(TimeToStr(iTime(Symbol(),PERIOD_D1,i),TIME_DATE)+" 01:00"); TokyoStart=StrToTime(TimeToStr(TokyoStart,TIME_DATE)+" "+(TimeHour(TokyoStart)+timeshift)); datetime TokyoEnd=StrToTime(TimeToStr(iTime(Symbol(),PERIOD_D1,i),TIME_DATE)+" 09:00"); TokyoEnd=StrToTime(TimeToStr(TokyoEnd,TIME_DATE)+" "+(TimeHour(TokyoEnd)+timeshift)); int tokyo_bs=iBarShift(Symbol(),15,TokyoStart); int tokyo_be=iBarShift(Symbol(),15,TokyoEnd); int ibl_tokyo = iLowest(Symbol(),15,MODE_LOW,tokyo_bs-tokyo_be,tokyo_be); int ibh_tokyo = iHighest(Symbol(),15,MODE_HIGH,tokyo_bs-tokyo_be,tokyo_be); double vHigh_tokyo =High[ibh_tokyo]; double vLow_tokyo =Low[ibl_tokyo]; double vMid_tokyo =(vHigh_tokyo+vLow_tokyo)/2; double sum_tokyo=(vHigh_tokyo-vLow_tokyo)/Point; ObjectCreate ("TokyoStart"+i,OBJ_VLINE,0,TokyoStart,0);ObjectSet("TokyoStart"+i,OBJPROP_COLOR,SteelBlue); ObjectCreate ("TokyoEnd"+i,OBJ_VLINE,0,TokyoEnd,0);ObjectSet("TokyoEnd"+i,OBJPROP_COLOR,SteelBlue); if (ibl_tokyo>ibh_tokyo) {double fibo_0= vHigh_tokyo;double fibo_100=vLow_tokyo; string strfibo382="S H O R T";string strfibo618="L O N G"; } else {fibo_100= vHigh_tokyo;fibo_0=vLow_tokyo; strfibo382="L O N G";strfibo618="S H O R T";} string objname = "FIBO Tokyo"+i; ObjectCreate(objname,OBJ_FIBO,0,TokyoEnd,fibo_100,TokyoEnd+2000,fibo_0); ObjectSet(objname,OBJPROP_COLOR,Gray); ObjectSet(objname,OBJPROP_RAY,false); ObjectSet(objname,OBJPROP_TIMEFRAMES,OBJ_PERIOD_M15); ObjectSet(objname,OBJPROP_LEVELCOLOR,SteelBlue); ObjectSet(objname,OBJPROP_FIBOLEVELS,21); ObjectSet(objname,OBJPROP_LEVELSTYLE,STYLE_DOT); ObjectSet(objname,OBJPROP_FIRSTLEVEL,0); ObjectSet(objname,OBJPROP_FIRSTLEVEL+1,0.382); ObjectSet(objname,OBJPROP_FIRSTLEVEL+2,0.618); ObjectSet(objname,OBJPROP_FIRSTLEVEL+3,1); ObjectSet(objname,OBJPROP_FIRSTLEVEL+4,1.309); ObjectSet(objname,OBJPROP_FIRSTLEVEL+5,1.618); ObjectSet(objname,OBJPROP_FIRSTLEVEL+6,2); ObjectSet(objname,OBJPROP_FIRSTLEVEL+7,2.618); ObjectSet(objname,OBJPROP_FIRSTLEVEL+8,-0.382); ObjectSet(objname,OBJPROP_FIRSTLEVEL+9,-0.618); ObjectSet(objname,OBJPROP_FIRSTLEVEL+10,-1); ObjectSet(objname,OBJPROP_FIRSTLEVEL+11,-1.309); ObjectSet(objname,OBJPROP_FIRSTLEVEL+12,-1.618); ObjectSet(objname,OBJPROP_FIRSTLEVEL+13,-2); ObjectSet(objname,OBJPROP_FIRSTLEVEL+14,-2.618); ObjectSet(objname,OBJPROP_FIRSTLEVEL+15,0.236); ObjectSet(objname,OBJPROP_FIRSTLEVEL+16,-0.236); ObjectSet(objname,OBJPROP_FIRSTLEVEL+17,0.764); ObjectSet(objname,OBJPROP_FIRSTLEVEL+18,-0.764); ObjectSet(objname,OBJPROP_FIRSTLEVEL+19,4.237); ObjectSet(objname,OBJPROP_FIRSTLEVEL+20,-4.237); ObjectSetFiboDescription(objname,0,"0%% . %$%"); ObjectSetFiboDescription(objname,1,strfibo618+" . "+"%$%"); ObjectSetFiboDescription(objname,2,strfibo382+" . "+"%$%"); ObjectSetFiboDescription(objname,3,"100%% . %$%"); ObjectSetFiboDescription(objname,4,"130.9%% . %$%"); ObjectSetFiboDescription(objname,5,"Liber Abaci"+" . "+"%$%"); ObjectSetFiboDescription(objname,6,"200%% . %$%"); ObjectSetFiboDescription(objname,7,"261.8%% . %$%"); ObjectSetFiboDescription(objname,8,strfibo382+" . "+"%$%"); ObjectSetFiboDescription(objname,9,strfibo618+" . "+"%$%"); ObjectSetFiboDescription(objname,10,"E 100%% . %$%"); ObjectSetFiboDescription(objname,11,"E 130.9%% . %$%"); ObjectSetFiboDescription(objname,12,"Liber Abaci"+" . "+"%$%"); ObjectSetFiboDescription(objname,13,"E 200%% . %$%"); ObjectSetFiboDescription(objname,14,"E 261.8%% . %$%"); ObjectSetFiboDescription(objname,15,"23.6%% . %$%"); ObjectSetFiboDescription(objname,16,"E 23.6%% . %$%"); ObjectSetFiboDescription(objname,17,"76.4%% . %$%"); ObjectSetFiboDescription(objname,18,"E 76.4%% . %$%"); ObjectSetFiboDescription(objname,19,"423.7%% . %$%"); ObjectSetFiboDescription(objname,20,"E 423.7%% . %$%"); datetime LondonStart=StrToTime(TimeToStr(iTime(Symbol(),PERIOD_D1,i),TIME_DATE)+" 09:00"); LondonStart=StrToTime(TimeToStr(LondonStart,TIME_DATE)+" "+(TimeHour(LondonStart)+timeshift)); datetime LondonEnd=StrToTime(TimeToStr(iTime(Symbol(),PERIOD_D1,i),TIME_DATE)+" 14:00"); LondonEnd=StrToTime(TimeToStr(LondonEnd,TIME_DATE)+" "+(TimeHour(LondonEnd)+timeshift)); int London_bs=iBarShift(Symbol(),0,LondonStart); int London_be=iBarShift(Symbol(),0,LondonEnd); int ibl_London = iLowest(Symbol(),0,MODE_LOW,London_bs-London_be,London_be); int ibh_London = iHighest(Symbol(),0,MODE_HIGH,London_bs-London_be,London_be); double vHigh_London =High[ibh_London]; double vLow_London =Low[ibl_London]; double sum_london=(vHigh_London-vLow_London)/Point; ObjectCreate ("LondonStart"+i,OBJ_VLINE,0,LondonStart,0);ObjectSet("LondonStart"+i,OBJPROP_COLOR,LimeGreen); ObjectCreate ("LondonEnd"+i,OBJ_VLINE,0,LondonEnd,0);ObjectSet("LondonEnd"+i,OBJPROP_COLOR,LimeGreen); if (ibl_London>ibh_London) {double fibo_1= vHigh_London;double fibo_200=vLow_London; string strfiboL382="S H O R T";string strfiboL618="L O N G"; } else {fibo_200= vHigh_London;fibo_1=vLow_London; strfiboL618="S H O R T";strfiboL382="L O N G";} string objnameL = "FIBO London"+i; ObjectCreate(objnameL,OBJ_FIBO,0,LondonEnd,fibo_200,LondonEnd+3000,fibo_1); ObjectSet(objnameL,OBJPROP_COLOR,Gray); ObjectSet(objnameL,OBJPROP_RAY,false); ObjectSet(objnameL,OBJPROP_TIMEFRAMES,OBJ_PERIOD_M15); ObjectSet(objnameL,OBJPROP_LEVELCOLOR,LimeGreen); ObjectSet(objnameL,OBJPROP_FIBOLEVELS,21); ObjectSet(objnameL,OBJPROP_LEVELSTYLE,STYLE_DOT); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL,0); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+1,0.382); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+2,0.618); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+3,1); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+4,1.309); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+5,1.618); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+6,2); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+7,2.618); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+8,-0.382); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+9,-0.618); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+10,-1); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+11,-1.309); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+12,-1.618); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+13,-2); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+14,-2.618); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+15,0.236); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+16,-0.236); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+17,0.764); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+18,-0.764); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+19,4.237); ObjectSet(objnameL,OBJPROP_FIRSTLEVEL+20,-4.237); ObjectSetFiboDescription(objnameL,0,"0%% . %$%"); ObjectSetFiboDescription(objnameL,1,strfiboL618+" . "+"%$%"); ObjectSetFiboDescription(objnameL,2,strfiboL382+" . "+"%$%"); ObjectSetFiboDescription(objnameL,3,"100%% . %$%"); ObjectSetFiboDescription(objnameL,4,"130.9%% . %$%"); ObjectSetFiboDescription(objnameL,5,"Liber Abaci"+" . "+"%$%"); ObjectSetFiboDescription(objnameL,6,"200%% . %$%"); ObjectSetFiboDescription(objnameL,7,"261.8%% . %$%"); ObjectSetFiboDescription(objnameL,8,strfiboL382+" . "+"%$%"); ObjectSetFiboDescription(objnameL,9,strfiboL618+" . "+"%$%"); ObjectSetFiboDescription(objnameL,10,"E 100%% . %$%"); ObjectSetFiboDescription(objnameL,11,"E 130.9%% . %$%"); ObjectSetFiboDescription(objnameL,12,"Liber Abaci"+" . "+"%$%"); ObjectSetFiboDescription(objnameL,13,"E 200%% . %$%"); ObjectSetFiboDescription(objnameL,14,"E 261.8%% . %$%"); ObjectSetFiboDescription(objnameL,15,"23.6%%% . %$%"); ObjectSetFiboDescription(objnameL,16,"E 23.6%% . %$%"); ObjectSetFiboDescription(objnameL,17,"76.4%% . %$%"); ObjectSetFiboDescription(objnameL,18,"E 76.4%% . %$%"); ObjectSetFiboDescription(objnameL,19,"423.7%% . %$%"); ObjectSetFiboDescription(objnameL,20,"E 423.7%% . %$%"); datetime NewyorkStart=StrToTime(TimeToStr(iTime(Symbol(),PERIOD_D1,i),TIME_DATE)+" 14:00"); NewyorkStart=StrToTime(TimeToStr(NewyorkStart,TIME_DATE)+" "+(TimeHour(NewyorkStart)+timeshift)); datetime NewyorkEnd=StrToTime(TimeToStr(iTime(Symbol(),PERIOD_D1,i),TIME_DATE)+" 22:00"); NewyorkEnd=StrToTime(TimeToStr(NewyorkEnd,TIME_DATE)+" "+(TimeHour(NewyorkEnd)+timeshift)); int Newyork_bs=iBarShift(Symbol(),0,NewyorkStart); int Newyork_be=iBarShift(Symbol(),0,NewyorkEnd); int ibl_Newyork = iLowest(Symbol(),0,MODE_LOW,Newyork_bs-Newyork_be,Newyork_be); int ibh_Newyork = iHighest(Symbol(),0,MODE_HIGH,Newyork_bs-Newyork_be,Newyork_be); double vHigh_Newyork =High[ibh_Newyork]; double vLow_Newyork =Low[ibl_Newyork]; double sum_NY=(vHigh_Newyork-vLow_Newyork)/Point; ObjectCreate ("NewYorkStart"+i,OBJ_VLINE,0,NewyorkStart,0);ObjectSet("NewYorkStart"+i,OBJPROP_COLOR,DarkOrange); ObjectCreate ("NewYorkEnd"+i,OBJ_VLINE,0,NewyorkEnd,0);ObjectSet("NewYorkEnd"+i,OBJPROP_COLOR,DarkOrange); if (ibl_Newyork>ibh_Newyork) {double fibo_3= vHigh_Newyork;double fibo_300=vLow_Newyork; string strfiboN382="S H O R T";string strfiboN618="L O N G";} else {fibo_300= vHigh_Newyork;fibo_3=vLow_Newyork; strfiboN382="L O N G";strfiboN618="S H O R T"; } string objnameN = "FIBO New York"+i; ObjectCreate(objnameN,OBJ_FIBO,0,NewyorkEnd,fibo_300,NewyorkEnd+4000,fibo_3); ObjectSet(objnameN,OBJPROP_COLOR,Gray); ObjectSet(objnameN,OBJPROP_RAY,false); ObjectSet(objnameN,OBJPROP_TIMEFRAMES,OBJ_PERIOD_M15); ObjectSet(objnameN,OBJPROP_LEVELCOLOR,DarkOrange); ObjectSet(objnameN,OBJPROP_FIBOLEVELS,21); ObjectSet(objnameN,OBJPROP_LEVELSTYLE,STYLE_DOT); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL,0); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+1,0.382); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+2,0.618); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+3,1); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+4,1.382); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+5,1.618); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+6,2); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+7,2.618); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+8,-0.382); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+9,-0.618); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+10,-1); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+11,-1.382); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+12,-1.618); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+13,-2); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+14,-2.618); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+15,0.236); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+16,-0.236); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+17,0.764); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+18,-0.764); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+19,4.237); ObjectSet(objnameN,OBJPROP_FIRSTLEVEL+20,-4.237); ObjectSetFiboDescription(objnameN,0,"0%% . %$%"); ObjectSetFiboDescription(objnameN,1,strfiboN618+" . "+"%$%"); ObjectSetFiboDescription(objnameN,2,strfiboN382+" . "+"%$%"); ObjectSetFiboDescription(objnameN,3,"100%% . %$%"); ObjectSetFiboDescription(objnameN,4,"130.9%% . %$%"); ObjectSetFiboDescription(objnameN,5,"Liber Abaci"+" . "+"%$%"); ObjectSetFiboDescription(objnameN,6,"200%% . %$%"); ObjectSetFiboDescription(objnameN,7,"261.8%% . %$%"); ObjectSetFiboDescription(objnameN,8,strfiboN382+" . "+"%$%"); ObjectSetFiboDescription(objnameN,9,strfiboN618+" . "+"%$%"); ObjectSetFiboDescription(objnameN,10,"E 100%% . %$%"); ObjectSetFiboDescription(objnameN,11,"E 130.9%% . %$%"); ObjectSetFiboDescription(objnameN,12,"Liber Abaci"+" . "+"%$%"); ObjectSetFiboDescription(objnameN,13,"E 200%% . %$%"); ObjectSetFiboDescription(objnameN,14,"E 261.8%% . %$%"); ObjectSetFiboDescription(objnameN,15,"23.6%%% . %$%"); ObjectSetFiboDescription(objnameN,16,"E 23.6%% . %$%"); ObjectSetFiboDescription(objnameN,17,"76.4%% . %$%"); ObjectSetFiboDescription(objnameN,18,"E 76.4%% . %$%"); ObjectSetFiboDescription(objnameN,19,"423.7%% . %$%"); ObjectSetFiboDescription(objnameN,20,"E 423.7%% . %$%"); } if (TimeHour(TimeCurrent())>13) { ObjectCreate("SD_Newyork",OBJ_STDDEVCHANNEL,0,LondonStart,0,LondonEnd,0); ObjectSet("SD_Newyork",OBJPROP_RAY,true);ObjectSet("SD_Newyork",OBJPROP_DEVIATION,2); ObjectSet("SD_Newyork",OBJPROP_BACK,true);ObjectSet("SD_Newyork",OBJPROP_COLOR,Brown); ObjectSet("SD_Newyork",OBJPROP_TIMEFRAMES,OBJ_PERIOD_M30); ObjectSet("SD_Newyork",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("SD_Newyork",OBJPROP_SCALE,1.618); } if (TimeHour(TimeCurrent())>8) { ObjectCreate("SD_London",OBJ_STDDEVCHANNEL,0,TokyoStart,0,TokyoEnd,0); ObjectSet("SD_London",OBJPROP_RAY,true);ObjectSet("SD_London",OBJPROP_DEVIATION,2); ObjectSet("SD_London",OBJPROP_BACK,true);ObjectSet("SD_London",OBJPROP_COLOR,Green); ObjectSet("SD_London",OBJPROP_TIMEFRAMES,OBJ_PERIOD_M30); ObjectSet("SD_London",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("SD_London",OBJPROP_SCALE,1.618); } if (TimeHour(TimeCurrent())>22) { ObjectCreate("SD_Tokyo",OBJ_STDDEVCHANNEL,0,NewyorkStart,0,NewyorkEnd,0); ObjectSet("SD_Tokyo",OBJPROP_RAY,true);ObjectSet("SD_Tokyo",OBJPROP_DEVIATION,2); ObjectSet("SD_Tokyo",OBJPROP_BACK,true);ObjectSet("SD_Tokyo",OBJPROP_COLOR,Navy); ObjectSet("SD_Tokyo",OBJPROP_TIMEFRAMES,OBJ_PERIOD_M30); ObjectSet("SD_Tokyo",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("SD_Tokyo",OBJPROP_SCALE,1.618); } double sumAll= (sum_NY+sum_london+sum_tokyo )/3; Comment( k + " minutes " + s + " second ", "\n", "Tokyo : "+ DoubleToStr(sum_tokyo,0)+" pips", "\n", "London : "+DoubleToStr(sum_london,0)+" pips", "\n", "Newyork : "+ DoubleToStr(sum_NY,0)+" pips", "\n", "Average : "+ DoubleToStr(sumAll,0)+" pips"); return(0); } //+------------------------------------------------------------------+Liber_Abaci.jpgLiber_Abaci.jpg
TK29帖子1楼右侧xm竖版广告90-240
个性签名

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

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告
alenchou
注册时间2015-04-10

本站免责声明:

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

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

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

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

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

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