论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
查看:1534回复:3
草龙
注册时间2004-12-17
[MT4指标]mt4各时区显示插件
楼主发表于:2014-04-14 12:13只看该作者倒序浏览
1楼 电梯直达
电梯直达
主图指标 在图上标注出各个主要交易市场的当地时间情况 是否含有未来函数:无 //+------------------------------------------------------------------+ //| Clock.mq4 | //| Jerome | //| [email protected] | //+------------------------------------------------------------------+ #property copyright "Jerome" #property link "[email protected]" //------------------------------------------------------------------ // Instructions // BrokerTZ - Timezone of your Broker (in hours from GMT) // LocalTz - Your timezone in hours from GMT // DST - Is it daylight savings time? // ShowLocal - Set to tru to show your local time zone // corner - 0 = top left, 1 = top right, 2 = bottom left, 3 = bottom right // topOff - pixels from top to show the clock // labelColor- Color of label // clockColor- Color of clock // #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Red //---- input parameters extern double BrokerTZ=-7; extern double LocalTz=+1; extern bool DST=true; extern bool ShowLocal=true; extern int corner=0; extern int topOff=100; extern color labelColor=Yellow; extern color clockColor=White; //---- buffers double ExtMapBuffer1; int LondonTZ = 1; int TokyoTZ = 9; int NewYorkTZ = -4; //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); //---- int dstDelta=-1; if ( DST ) dstDelta = 0; datetime brokerTime = CurTime(); datetime GMT = brokerTime - (BrokerTZ+dstDelta)*3600; datetime local = GMT + (LocalTz + dstDelta) * 3600; datetime london = GMT + (LondonTZ + dstDelta) * 3600; datetime tokyo = GMT + (TokyoTZ + dstDelta) * 3600; datetime newyork = GMT + (NewYorkTZ + dstDelta) * 3600; //Print( brokerTime, " ", GMT, " ", local, " ", london, " ", tokyo, " ", newyork ); string GMTs = TimeToStr( GMT, TIME_MINUTES ); string locals = TimeToStr( local, TIME_MINUTES ); string londons = TimeToStr( london, TIME_MINUTES ); string tokyos = TimeToStr( tokyo, TIME_MINUTES ); string newyorks = TimeToStr( newyork, TIME_MINUTES ); string brokers = TimeToStr( CurTime(), TIME_MINUTES ); //string timeText = " Local: " + locals + " GMT: " +GMTs + " | London:" +londons + // " | New York: " +newyorks + " | Tokyo: " + tokyos ; //ObjectSetText( "times", timeText, 10, "Arial", clockColor ); if ( ShowLocal ) { ObjectSetText( "locl", "Local:", 10, "Arial", labelColor ); ObjectSetText( "loct", locals, 10, "Arial", clockColor ); } ObjectSetText( "gmtl", "GMT", 10, "Arial", labelColor ); ObjectSetText( "gmtt", GMTs, 10, "Arial", clockColor ); ObjectSetText( "nyl", "New York:", 10, "Arial", labelColor ); ObjectSetText( "nyt", newyorks, 10, "Arial", clockColor ); ObjectSetText( "lonl", "London:", 10, "Arial", labelColor ); ObjectSetText( "lont", londons, 10, "Arial", clockColor ); ObjectSetText( "tokl", "Tokyo:", 10, "Arial", labelColor ); ObjectSetText( "tokt", tokyos, 10, "Arial", clockColor ); ObjectSetText( "brol", "Broker:", 10, "Arial", labelColor ); ObjectSetText( "brot", brokers, 10, "Arial", clockColor ); //---- return(0); } //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int ObjectMakeLabel( string n, int xoff, int yoff ) { ObjectCreate( n, OBJ_LABEL, 0, 0, 0 ); ObjectSet( n, OBJPROP_CORNER, corner ); ObjectSet( n, OBJPROP_XDISTANCE, xoff ); ObjectSet( n, OBJPROP_YDISTANCE, yoff ); ObjectSet( n, OBJPROP_BACK, true ); } int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,ExtMapBuffer1); int top=topOff; if ( ShowLocal ) { ObjectMakeLabel( "locl", 90, top ); ObjectMakeLabel( "loct", 45, top ); } ObjectMakeLabel( "gmtl", 90, top-15 ); ObjectMakeLabel( "gmtt", 45, top-15 ); ObjectMakeLabel( "nyl", 90, top-30 ); ObjectMakeLabel( "nyt", 45, top-30 ); ObjectMakeLabel( "lonl", 90, top-45 ); ObjectMakeLabel( "lont", 45, top-45 ); ObjectMakeLabel( "tokl", 90, top-60 ); ObjectMakeLabel( "tokt", 45, top-60 ); ObjectMakeLabel( "brol", 90, top-75 ); ObjectMakeLabel( "brot", 45, top-75 ); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- ObjectDelete( "locl" ); ObjectDelete( "loct" ); ObjectDelete( "nyl" ); ObjectDelete( "nyt" ); ObjectDelete( "gmtl" ); ObjectDelete( "gmtt" ); ObjectDelete( "lonl" ); ObjectDelete( "lont" ); ObjectDelete( "tokl" ); ObjectDelete( "tokt" ); ObjectDelete( "brol" ); ObjectDelete( "brot" ); //---- return(0); } H%20-%20aligator%20-%20Clock.jpgH%20-%20aligator%20-%20Clock.jpg
TK29帖子1楼右侧xm竖版广告90-240
个性签名

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

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告
ljwlxrll
注册时间2015-02-10
发表于:2015-02-10 13:43只看该作者
2楼
到底好用不好用
netbean
注册时间2008-06-20
实盘大赛亚军
发表于:2015-05-22 15:38只看该作者
3楼
not all control paths return a value timezone.mq4 100 1 ???
votain
注册时间2014-10-02
发表于:2015-05-25 11:56只看该作者
4楼
时间不对哦

本站免责声明:

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

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

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

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

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

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