论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
查看:1012回复:0
草龙
注册时间2004-12-17
[MT4指标]4TF HAS2 Bar
楼主发表于:2014-01-03 08:59只看该作者倒序浏览
1楼 电梯直达
电梯直达
这个指标要跟踪下使用才能有作用的 //+------------------------------------------------------------------+ //| 4TF HAS2 Bar.mq4 | //| Add-on to be used with 4TF HAS Bar.mq4 | //| Modified by Matsu, from #MTF Supertrend Bar.mq4 | //| Copyright 2006, Eli hayun | //| http://www.elihayun.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2006, Eli hayun" #property link "http://www.elihayun.com" #property indicator_separate_window #property indicator_minimum 0 #property indicator_maximum 5 #property indicator_buffers 8 #property indicator_color1 Red #property indicator_color2 Blue #property indicator_color3 Red #property indicator_color4 Blue #property indicator_color5 Red #property indicator_color6 Blue #property indicator_color7 Red #property indicator_color8 Blue //---- parameters extern int MaMetod = 2; extern int MaPeriod = 6; extern int MaMetod2 = 3; extern int MaPeriod2 = 2; extern int BarWidth = 0; extern color UpBarColor = Blue; extern color DownBarColor = Red; extern int MaxBars=500; //extern color TextColor = White; double Gap = 1; // Gap between the lines of bars //---- buffers double buf4_up; double buf4_down; double buf3_up; double buf3_down; double buf2_up; double buf2_down; double buf1_up; double buf1_down; double haOpen; double haClose; /* extern int Period_1 = 15; extern int Period_2 = 30; extern int Period_3 = 60; extern int Period_4 = 240; extern bool AutoDisplay = false; */ string shortname = ""; bool firstTime = true; int ArrSize = 112;//167;//158;//159; int UniqueNum = 228; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //SetAutoDisplay(); firstTime = true; //IndicatorShortName(shortname); //---- indicators SetIndexStyle(0,DRAW_ARROW,0,BarWidth,UpBarColor); SetIndexArrow(0,ArrSize); SetIndexBuffer(0,buf4_up); SetIndexEmptyValue(0,0.0); SetIndexStyle(1,DRAW_ARROW,0,BarWidth,DownBarColor); SetIndexArrow(1,ArrSize); SetIndexBuffer(1,buf4_down); SetIndexEmptyValue(1,0.0); SetIndexStyle(2,DRAW_ARROW,0,BarWidth,UpBarColor); SetIndexArrow(2,ArrSize); SetIndexBuffer(2,buf3_up); SetIndexEmptyValue(2,0.0); SetIndexStyle(3,DRAW_ARROW,0,BarWidth,DownBarColor); SetIndexArrow(3,ArrSize); SetIndexBuffer(3,buf3_down); SetIndexEmptyValue(3,0.0); SetIndexStyle(4,DRAW_ARROW,0,BarWidth,UpBarColor); SetIndexArrow(4,ArrSize); SetIndexBuffer(4,buf2_up); SetIndexEmptyValue(4,0.0); SetIndexStyle(5,DRAW_ARROW,0,BarWidth,DownBarColor); SetIndexArrow(5,ArrSize); SetIndexBuffer(5,buf2_down); SetIndexEmptyValue(5,0.0); SetIndexStyle(6,DRAW_ARROW,0,BarWidth,UpBarColor); SetIndexArrow(6,ArrSize); SetIndexBuffer(6,buf1_up); SetIndexEmptyValue(6,0.0); SetIndexStyle(7,DRAW_ARROW,0,BarWidth,DownBarColor); SetIndexArrow(7,ArrSize); SetIndexBuffer(7,buf1_down); SetIndexEmptyValue(7,0.0); SetIndexLabel(0,NULL); SetIndexLabel(1,NULL); SetIndexLabel(2,NULL); SetIndexLabel(3,NULL); SetIndexLabel(4,NULL); SetIndexLabel(5,NULL); SetIndexLabel(6,NULL); SetIndexLabel(7,NULL); IndicatorDigits(0); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //SetAutoDisplay(); // shortname = "# Forex Freedom("+Period_1+","+Period_2+","+Period_3+","+Period_4+")"; //firstTime = true; //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); int i=0, y15m=0, y4h=0, y1h=0, y30m=0, yy; int limit=Bars-counted_bars; int Period_1, Period_2, Period_3, Period_4; switch(Period()) { case 1: Period_1=1; Period_2=5; Period_3=15; Period_4=30; break; case 5: Period_1=5; Period_2=15; Period_3=30; Period_4=60; break; case 15: Period_1=15; Period_2=30; Period_3=60; Period_4=240; break; case 30: Period_1=30; Period_2=60; Period_3=240; Period_4=1440; break; case 60: Period_1=60; Period_2=240; Period_3=1440; Period_4=10080; break; case 240: Period_1=240; Period_2=1440; Period_3=10080; Period_4=43200; break; case 1440: Period_1=1440; Period_2=10080; Period_3=43200; Period_4=43200; break; case 10080: Period_1=10080; Period_2=43200; Period_3=43200; Period_4=43200; break; case 43200: Period_1=43200; Period_2=43200; Period_3=43200; Period_4=43200; break; } shortname = "MTF HAS 2("+Period_1+","+Period_2+","+Period_3+","+Period_4+")"; IndicatorShortName(shortname); datetime TimeArray_4H, TimeArray_1H, TimeArray_30M, TimeArray_15M; //---- // if (firstTime || NewBar()) if (firstTime) { firstTime = false; /* int win = UniqueNum; // WindowFind(shortname); double dif = Time[0] - Time[1]; for (int ii=ObjectsTotal()-1; ii>-1; ii--) { if (StringFind(ObjectName(ii),"FF_"+win+"_") >= 0) ObjectDelete(ObjectName(ii)); else ii=-1; } double shift = 0.2; for (ii=0; ii<4; ii++) { string txt = "??"; double gp; switch (ii) { case 0: txt = tf2txt(Period_1); gp = 1 + shift; break; case 1: txt = tf2txt(Period_2); gp = 1 + Gap + shift; break; case 2: txt = tf2txt(Period_3); gp = 1 + Gap*2 + shift; break; case 3: txt = tf2txt(Period_4); gp = 1 + Gap*3 + shift; break; } string name = "FF_"+win+"_"+ii+"_"+txt; ObjectCreate(name, OBJ_TEXT, WindowFind(shortname), iTime(NULL,0,0)+dif*3, gp); ObjectSetText(name, txt,8,"Arial", TextColor); } */ } ArrayCopySeries(TimeArray_4H,MODE_TIME,Symbol(),Period_4); ArrayCopySeries(TimeArray_1H,MODE_TIME,Symbol(),Period_3); ArrayCopySeries(TimeArray_30M,MODE_TIME,Symbol(),Period_2); ArrayCopySeries(TimeArray_15M,MODE_TIME,Symbol(),Period_1); for(i=0, y15m=0, y4h=0, y1h=0, y30m=0;i4%20TF%20HAS%20Bar2.jpg
TK29帖子1楼右侧xm竖版广告90-240
个性签名

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

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告

本站免责声明:

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

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

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

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

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

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