论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
查看:1270回复:2
草龙
注册时间2004-12-17
[MT4指标]主图显示主要市场时区
楼主发表于:2014-08-04 03:10只看该作者倒序浏览
1楼 电梯直达
电梯直达
主图指标 是否含有未来函数:无 //+------------------------------------------------------------------+ //| Dolly_Trading Times #3.mq4 | //| Copyright ? 2006, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright \"Copyright ? 2006, MetaQuotes Software Corp.\" #property link \"http://www.metaquotes.net\" #property link \"Code used from i-ParamonWorkTime.mq4\" //---- #property indicator_chart_window //---- extern int TradingTimes_NumberOfDays=1; extern string Broker_GMT_Offset =\"02:00\"; extern string EUROPE_Open =\"08:00\"; extern color EUROPE_Color =Purple; extern color EUROPE_TEXT_Color =Violet; extern bool Show_EUROPE_Open =true; //---- extern string LONDON_Open =\"10:00\"; extern color LONDON_Color =MidnightBlue; extern color LONDON_TEXT_Color =DodgerBlue; extern bool Show_LONDON_Open =true; //---- extern string US_Open =\"15:00\"; extern color US_Color =Indigo; extern color US_TEXT_Color =MediumPurple; extern bool Show_US_Open =true; //---- extern string EUROPE1_Close =\"17:00\"; extern color EUROPE1_Color =Maroon; extern color EUROPE1_TEXT_Color =Crimson; extern bool Show_EUROPE1_Close =true; //---- extern bool Show_Daily_Trade_TEXT =true; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ void init() { DeleteObjects(); for(int i=0; i5) dt=decDateTradeDay(dt); } } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void DrawObjects(datetime dt, string TRADETIMES, string tb, string te) { datetime t1, t2; double p1, p2; int b1, b2; //---- t1=StrToTime(TimeToStr(dt, TIME_DATE)+\" \"+tb); t2=StrToTime(TimeToStr(dt, TIME_DATE)+\" \"+te); b1=iBarShift(NULL, 0, t1); b2=iBarShift(NULL, 0, t2); p1=High[Highest(NULL, 0, MODE_HIGH, b1-b2, b2)]; p2=Low [Lowest (NULL, 0, MODE_LOW , b1-b2, b2)]; //---- ObjectSet(TRADETIMES, OBJPROP_TIME1 , t1); ObjectSet(TRADETIMES, OBJPROP_PRICE1, p1); ObjectSet(TRADETIMES, OBJPROP_TIME2 , t2); ObjectSet(TRADETIMES, OBJPROP_PRICE2, p2); //---- if (Show_Daily_Trade_TEXT==true) { ObjectDelete(\"TT1\"); TT1( \"TT1\", 460, 12,4); ObjectSetText( \"TT1\",\"EUROPE Open\" , 9, \"Arial\", EUROPE_TEXT_Color); // ObjectDelete(\"TT2\"); TT2( \"TT2\", 460, 12,4); ObjectSetText( \"TT2\",\"\"+EUROPE_Open+\"\" , 9, \"Arial\", Silver); // ObjectDelete(\"TT3\"); TT3( \"TT3\", 475, 12,4); ObjectSetText( \"TT3\",\"LONDON Open\" , 9, \"Arial\", LONDON_TEXT_Color); // ObjectDelete(\"TT4\"); TT4( \"TT4\", 475, 12,4); ObjectSetText( \"TT4\",\"\"+LONDON_Open+\"\" , 9, \"Arial\", Silver); // ObjectDelete(\"TT5\"); TT5( \"TT5\", 490, 12,4); ObjectSetText( \"TT5\",\"US Open\" , 9, \"Arial\", US_TEXT_Color); // ObjectDelete(\"TT6\"); TT6( \"TT6\", 490, 12,4); ObjectSetText( \"TT6\",\"\"+US_Open+\"\" , 9, \"Arial\", Silver); // ObjectDelete(\"TT7\"); TT7( \"TT7\", 505, 12,4); ObjectSetText( \"TT7\",\"EUROPE Close\" , 9, \"Arial\", EUROPE1_TEXT_Color ); // ObjectDelete(\"TT8\"); TT8( \"TT8\", 505, 12,4); ObjectSetText( \"TT8\",\"\"+EUROPE1_Close+\"\" , 9, \"Arial\", Silver); } } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ datetime decDateTradeDay (datetime dt) { int ty=TimeYear(dt); int tm=TimeMonth(dt); int td=TimeDay(dt); int th=TimeHour(dt); int ti=TimeMinute(dt); td--; if (td==0) { tm--; if (tm==0) { ty--; tm=12; } if (tm==1 || tm==3 || tm==5 || tm==7 || tm==8 || tm==10 || tm==12) td=31; if (tm==2) if (MathMod(ty, 4)==0) td=29; else td=28; if (tm==4 || tm==6 || tm==9 || tm==11) td=30; } return(StrToTime(ty+\".\"+tm+\".\"+td+\" \"+th+\":\"+ti)); } //+------------------------------------------------------------------+ int TT1( string Text, int xOffset, int yOffset,int iCorner) //TITLE { ObjectCreate(Text,OBJ_LABEL , 0, 0, 0 ); ObjectSet (Text,OBJPROP_CORNER , iCorner); ObjectSet (Text,OBJPROP_XDISTANCE , 20); ObjectSet (Text,OBJPROP_YDISTANCE , xOffset ); ObjectSet (Text,OBJPROP_BACK , True ); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int TT2( string Text, int xOffset, int yOffset,int iCorner) //TITLE { ObjectCreate(Text,OBJ_LABEL , 0, 0, 0 ); ObjectSet (Text,OBJPROP_CORNER , iCorner); ObjectSet (Text,OBJPROP_XDISTANCE , 120); ObjectSet (Text,OBJPROP_YDISTANCE , xOffset ); ObjectSet (Text,OBJPROP_BACK , True ); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int TT3( string Text, int xOffset, int yOffset,int iCorner) //TITLE { ObjectCreate(Text,OBJ_LABEL , 0, 0, 0 ); ObjectSet (Text,OBJPROP_CORNER , iCorner); ObjectSet (Text,OBJPROP_XDISTANCE , 20); ObjectSet (Text,OBJPROP_YDISTANCE , xOffset ); ObjectSet (Text,OBJPROP_BACK , True ); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int TT4( string Text, int xOffset, int yOffset,int iCorner) //TITLE { ObjectCreate(Text,OBJ_LABEL , 0, 0, 0 ); ObjectSet (Text,OBJPROP_CORNER , iCorner); ObjectSet (Text,OBJPROP_XDISTANCE , 120); ObjectSet (Text,OBJPROP_YDISTANCE , xOffset ); ObjectSet (Text,OBJPROP_BACK , True ); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int TT5( string Text, int xOffset, int yOffset,int iCorner) //TITLE { ObjectCreate(Text,OBJ_LABEL , 0, 0, 0 ); ObjectSet (Text,OBJPROP_CORNER , iCorner); ObjectSet (Text,OBJPROP_XDISTANCE , 20); ObjectSet (Text,OBJPROP_YDISTANCE , xOffset ); ObjectSet (Text,OBJPROP_BACK , True ); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int TT6( string Text, int xOffset, int yOffset,int iCorner) //TITLE { ObjectCreate(Text,OBJ_LABEL , 0, 0, 0 ); ObjectSet (Text,OBJPROP_CORNER , iCorner); ObjectSet (Text,OBJPROP_XDISTANCE , 120); ObjectSet (Text,OBJPROP_YDISTANCE , xOffset ); ObjectSet (Text,OBJPROP_BACK , True ); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int TT7( string Text, int xOffset, int yOffset,int iCorner) //TITLE { ObjectCreate(Text,OBJ_LABEL , 0, 0, 0 ); ObjectSet (Text,OBJPROP_CORNER , iCorner); ObjectSet (Text,OBJPROP_XDISTANCE , 20); ObjectSet (Text,OBJPROP_YDISTANCE , xOffset ); ObjectSet (Text,OBJPROP_BACK , True ); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int TT8( string Text, int xOffset, int yOffset,int iCorner) //TITLE { ObjectCreate(Text,OBJ_LABEL , 0, 0, 0 ); ObjectSet (Text,OBJPROP_CORNER , iCorner); ObjectSet (Text,OBJPROP_XDISTANCE , 120); ObjectSet (Text,OBJPROP_YDISTANCE , xOffset ); ObjectSet (Text,OBJPROP_BACK , True ); } //+------------------------------------------------------------------+
TK29帖子1楼右侧xm竖版广告90-240
个性签名

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

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告
achilleshuang
注册时间2015-08-30
发表于:2015-08-30 08:30只看该作者
2楼
主图显示主要市场时区
生命的刀锋
注册时间2014-06-27
发表于:2015-09-08 21:17只看该作者
3楼
这个实用,谢谢楼主分享!!

本站免责声明:

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

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

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

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

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

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