论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
查看:1566回复:12
草龙
注册时间2004-12-17
[MT4指标]Hamyar Zones支撑阻力指标
楼主发表于:2014-08-25 00:25只看该作者倒序浏览
1楼 电梯直达
电梯直达
主图指标 mt4指标类型:震荡指标 是否能用在mt4手机版上:否 是否含有未来函数:无 Hamyar Zones支撑阻力指标 按照日图区间标注前三天的阻力支持位 //+------------------------------------------------------------------+ //| Hamyar Zones.mq4 | //| Copyright ? 2010,Farshad Saremifar | //| www.4xline.com | //+------------------------------------------------------------------+ #property copyright \"Copyright ? 2010,Farshad Saremifar\" #property link \"www.4xline.com\" #property indicator_chart_window #property indicator_buffers 7 #property indicator_color1 Green #property indicator_style1 STYLE_DASH #property indicator_width1 1 #property indicator_color2 Red #property indicator_width2 4 #property indicator_color3 DodgerBlue #property indicator_width3 4 #property indicator_color4 Red #property indicator_style4 2 #property indicator_color5 DodgerBlue #property indicator_style5 2 #property indicator_color6 Red #property indicator_style6 2 #property indicator_color7 DodgerBlue #property indicator_style7 2 //---- input parameters extern string Copyright=\"Copyright ? 2010,Farshad Saremifar,www.4xline.com\"; extern int NumberOfDays=5; extern int ATR_Period=25; extern int StartHour=9; extern int Quarter=0; extern bool DayLightSaving=true; extern int GMT_Shift=210; int GMT_SHIFT=210; int StartMinute=0; int LondonTZ = 0; int Tehran = 210; int TokyoTZ = 540; int NewYorkTZ = -300; double BuyZone, Pivot, SellZone; double Buytp1, Buytp2, Selltp1, Selltp2; double PDayHigh, PDayLow; datetime PivotDayStartTime; int Tehranshift; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators IndicatorDigits(Digits); SetIndexBuffer( 0, Pivot); SetIndexBuffer( 1, SellZone); SetIndexBuffer( 2, BuyZone); SetIndexBuffer(3, Selltp1); SetIndexBuffer( 4, Buytp1); SetIndexBuffer(5, Selltp2); SetIndexBuffer( 6, Buytp2); SetIndexStyle(0, DRAW_LINE); SetIndexStyle(1, DRAW_LINE); SetIndexStyle(2, DRAW_LINE); SetIndexStyle(3, DRAW_LINE); SetIndexStyle(4, DRAW_LINE); SetIndexStyle(5, DRAW_LINE); SetIndexStyle(6, DRAW_LINE); SetIndexEmptyValue( 0, EMPTY_VALUE ); SetIndexEmptyValue( 1, EMPTY_VALUE ); SetIndexEmptyValue( 2, EMPTY_VALUE ); SetIndexEmptyValue( 3, EMPTY_VALUE ); SetIndexEmptyValue( 4, EMPTY_VALUE ); SetIndexEmptyValue( 5, EMPTY_VALUE ); SetIndexEmptyValue( 6, EMPTY_VALUE ); SetIndexLabel( 0, \"Pivot\" ); SetIndexLabel( 1, \"SellZone\" ); SetIndexLabel( 2, \"BuyZone\" ); SetIndexLabel( 3, \"Selltp1\" ); SetIndexLabel( 4, \"Buytp1\" ); SetIndexLabel( 5, \"Selltp2\" ); SetIndexLabel( 6, \"Buytp2\" ); switch (Quarter) { case 1: StartMinute=0;break; case 2: StartMinute=15;break; case 3: StartMinute=30;break; case 4: StartMinute=45;break; default: StartMinute=0;break; } PivotDayStartTime = 0; //---- int dst; if(DayLightSaving==false) {dst=1;GMT_SHIFT=GMT_Shift;} if(DayLightSaving==true) {dst=2;GMT_SHIFT=GMT_Shift+60;} datetime brokerTime = CurTime(); datetime GMT = TimeLocal()- GMT_SHIFT * 60; datetime london = GMT + (LondonTZ + (dst*60 - 1*60)) * 60; datetime tokyo = GMT + (TokyoTZ) * 60; datetime newyork = GMT + (NewYorkTZ + (dst*60 - 1*60)) * 60; datetime tehran=GMT + (Tehran + (dst*60 - 1*60)) * 60; Tehranshift=tehran-brokerTime; GlobalVariableSet(\"Tehranshift\"+WindowHandle(Symbol(),Period())+Symbol()+Period(),Tehranshift); GlobalVariableSet(\"GMT_SHIFT\"+WindowHandle(Symbol(),Period())+Symbol()+Period(),GMT_SHIFT); GlobalVariableSet(\"DayLightSaving\"+WindowHandle(Symbol(),Period())+Symbol()+Period(),DayLightSaving); return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- GlobalVariablesDeleteAll(); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { GlobalVariableSet(\"StartHour\"+WindowHandle(Symbol(),Period())+Symbol()+Period(),StartHour); GlobalVariableSet(\"StartMinute\"+WindowHandle(Symbol(),Period())+Symbol()+Period(),StartMinute); GlobalVariableSet(\"ATR_Period\"+WindowHandle(Symbol(),Period())+Symbol()+Period(),ATR_Period); GlobalVariableSet(\"NumberOfDays\"+WindowHandle(Symbol(),Period())+Symbol()+Period(),NumberOfDays); GlobalVariableSet(\"Quarter\"+WindowHandle(Symbol(),Period())+Symbol()+Period(),Quarter); GlobalVariableSet(\"Tehranshift\"+WindowHandle(Symbol(),Period())+Symbol()+Period(),Tehranshift); GlobalVariableSet(\"GMT_SHIFT\"+WindowHandle(Symbol(),Period())+Symbol()+Period(),GMT_SHIFT); GlobalVariableSet(\"DayLightSaving\"+WindowHandle(Symbol(),Period())+Symbol()+Period(),DayLightSaving); int i, j,Count; double Range; i =((NumberOfDays*1440)/Period())+((1440)/Period()); //---- while(i >=0) { if( PivotDay( Time[i+1]+Tehranshift-StartHour*60*60-StartMinute*60)!=PivotDay( Time+Tehranshift-StartHour*60*60-StartMinute*60)) { double pip15,pip30,pip60; Pivot=iCustom(NULL,0,\"Hamyar Calculate\",\"\",\"\",ATR_Period,0,i); pip15=iCustom(NULL,0,\"Hamyar Calculate\",\"\",\"\",ATR_Period,2,i); pip30=iCustom(NULL,0,\"Hamyar Calculate\",\"\",\"\",ATR_Period,3,i); pip60=iCustom(NULL,0,\"Hamyar Calculate\",\"\",\"\",ATR_Period,4,i); BuyZone =Pivot+ pip15; SellZone = Pivot - pip15; Selltp1 = Pivot - (pip30+pip15); Buytp1 = Pivot + (pip30+pip15); Selltp2 = SellZone - (pip15+pip60); Buytp2 = BuyZone + (pip15+pip60); SellZone[i+1] =EMPTY_VALUE; BuyZone[i+1] =EMPTY_VALUE; Pivot[i+1] =EMPTY_VALUE; Selltp1[i+1] = EMPTY_VALUE; Buytp1[i+1] = EMPTY_VALUE; Selltp2[i+1] =EMPTY_VALUE; Buytp2[i+1] = EMPTY_VALUE; SellZone[i+2] =EMPTY_VALUE; BuyZone[i+2] =EMPTY_VALUE; Pivot[i+2] =EMPTY_VALUE; Selltp1[i+2] =EMPTY_VALUE; Buytp1[i+2] = EMPTY_VALUE; Selltp2[i+2] =EMPTY_VALUE; Buytp2[i+2] = EMPTY_VALUE; PivotDayStartTime=Time; } else { BuyZone = BuyZone[i+1]; SellZone = SellZone[i+1]; Selltp1 = Selltp1[i+1]; Buytp1 = Buytp1[i+1]; Selltp2 = Selltp2[i+1]; Buytp2 = Buytp2[i+1]; Pivot = Pivot[i+1]; } i--; if (i==0)GlobalVariableSet(\"PivotDayStartTime\"+WindowHandle(Symbol(),Period())+Symbol()+Period(),PivotDayStartTime); } //---- return(0); } //+------------------------------------------------------------------+ //-------------------- int PivotDay( datetime BarTime ) { int PDay = TimeDayOfWeek( BarTime); if( PDay == 0 ) PDay = 5; if( PDay == 6 ) PDay = 5; return( PDay ); }
TK29帖子1楼右侧xm竖版广告90-240
个性签名

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

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告
ljwlxrll
注册时间2015-02-10
发表于:2015-02-10 13:20只看该作者
2楼
到底好用不好用
tanqingyuye
注册时间2015-04-02
ccs
注册时间2016-04-15
发表于:2016-07-18 13:52只看该作者
5楼
多谢分享
ccs
注册时间2016-04-15
krislei
注册时间2016-07-13
黄金分割法
注册时间2015-03-28
fellygun
注册时间2016-09-02
发表于:2016-09-07 20:02只看该作者
9楼
感谢分享
warden
注册时间2016-09-20
车厘子
注册时间2016-05-31
车厘子
注册时间2016-05-31
发表于:2016-09-22 05:59只看该作者
12楼
能不能直接给个指标啊 不会弄啊
Pzxzx
注册时间2017-08-06

本站免责声明:

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

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

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

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

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

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