论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
查看:1461回复:8
草龙
注册时间2004-12-17
[MT4指标]Hamyar阻力支撑指标
楼主发表于:2014-04-18 09:19只看该作者倒序浏览
1楼 电梯直达
电梯直达
主图指标 mt4指标类型:趋势指标 是否能用在mt4手机版上:否 是否含有未来函数:无 使用色阶显示出未来阻力支撑的指标 //+------------------------------------------------------------------+ //| This has been coded by MT-Coder | //| | //| Email: [email protected] | //| Website: mt-coder.110mb.com | //| | //| For any strategy you have in mind to be coded into EA | //| For any indicator you have in mind | //| | //| Don't hesitate to contact me at [email protected] | //| Or on the Website: mt-coder.110mb.com | //| | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| | //| The purpose of this indicator is to highlight the price zones | //| that had the most activity : the hottest zones. | //| | //| The indicator shows a gradiant of colors from Cold to Hot | //| | //| Latest issue Aug 05 2010 | //| | //| | //| ** ** ** * ** * *** SETTINGS ** ** **** ** * ** | //| HMPeriod : the number of bars included in the count | //| Scale : the size of each zone. | //| NbZone : the number of zones to create. | //| Cold : the color of the coldest zones. | //| Hot : the color of the hottest zones. | //| | //| -------------------------------------- | //| | //| The two functions rgb2int() and colorgradient() were used from | | //| http://www.thetradingtheory.com/colors-in-mql4/ | //| thanks to zenhop for pointing out to them | //+------------------------------------------------------------------+ #property copyright "Copyright ? 2010, MT-Coder." #property link "http://mt-coder.110mb.com/" #property indicator_chart_window //---- input parameters extern int HMPeriod = 500; extern int Scale = 10; extern int NbZone = 100; extern color Cold = C'151,249,234'; extern color Hot = C'255,87,83'; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ void init() { datetime dt2, dt; dt = Time[0]; dt2 = dt + 3000*Period(); DeleteObjects(); for (int i=1; i<=NbZone; i++) { CreateObjects("zone"+i,dt,Close[0]+(Scale*Point*(i-1)),dt2,Close[0]+(Scale*Point*i)); int m = -i; CreateObjects("zone"+m,dt,Close[0]-(Scale*Point*(i-1)),dt2,Close[0]-(Scale*Point*i)); } return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ void deinit() { DeleteObjects(); return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void CreateObjects(string no, datetime t1, double p1, datetime t2, double p2) { ObjectCreate(no, OBJ_RECTANGLE, 0, t1,p1, t2,p2); ObjectSet(no, OBJPROP_STYLE, STYLE_SOLID); ObjectSet(no, OBJPROP_BACK, True); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void DeleteObjects() { for (int i=1; i<=NbZone; i++) { ObjectDelete("zone"+i); int m=-i; ObjectDelete("zone"+m); } } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { Comment("Heat Map MultiColor\n","Programed By: MT-Coder\n", "** [email protected] **\n", "http://MT-Coder.110mb.com"); init(); double var1, var2; var1=0; var2=0; //---- for(int j=1; j<=NbZone; j++) { int m=-j; for(int i=1; iClose[0]+(Scale*Point*(j-1))) { //---the possible cases of presence of the bar fully or partially within the scale if(High-Low>Scale*Point){ var1 = var1 + 1 ;} //--- if(High>= Bid+(Scale*Point*j) && Low<=Bid+(Scale*Point*(j-1))){ var1 = var1 + ((High-Low)/(Scale*Point));} //--- if(High>Bid+(Scale*Point*j) && Low>Bid+(Scale*Point*(j-1))){ var1 = var1 + ((Bid+(Scale*Point*j)-Low)/(Scale*Point));} //--- if(LowClose[0]+(Scale*Point*m)) { //---the possible cases of presence of the bar fully or partially within the scale if(High-Low>Scale*Point) var2 = var2 + 1; //--- if(High>= Bid+(Scale*Point*(m+1)) && Low<=Bid+(Scale*Point*m)) var2 = var2 + ((High-Low)/(Scale*Point)); //--- if(Low<=Bid+(Scale*Point*m) && High<=Bid+(Scale*Point*(m+1))) var2 = var2 + ((High-(Bid+(Scale*Point*m)))/(Scale*Point)); //--- if(High>Bid+(Scale*Point*(m+1)) && Low>Bid+(Scale*Point*m)) var2 = var2 + ((Bid+(Scale*Point*(m+1))-Low)/(Scale*Point)); } } //----determine the heat and therefore the color //frags1, frags2 will be used to define the class of 'heat' : 1 hottest, 0 coldest double frags1 = var1/(var1+var2); double frags2 = var2/(var1+var2); double min = 0; double max = 100; // color cl1 = colorgradient(GetRed(Hot),GetGreen(Hot),GetBlue(Hot), GetRed(Cold),GetGreen(Cold),GetBlue(Cold), min,max,frags1*100); // color cl2 = colorgradient(GetRed(Hot),GetGreen(Hot),GetBlue(Hot), GetRed(Cold),GetGreen(Cold),GetBlue(Cold), min,max,frags2*100); // //----give the right color to the rectangle DrawObjects("zone"+j, cl1);//give the upper rectangle j the color cl1 DrawObjects("zone"+m, cl2);//give the lower rectangle m=-j the color cl2 } return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void DrawObjects(string no, color col) { ObjectSet(no, OBJPROP_COLOR, col); } /* //--these two functions rgb2int() and colorgradient() were used from http://www.thetradingtheory.com/colors-in-mql4/ //thanks to zenhop for pointing out to them */ int rgb2int(int r, int g, int b) { return (b*65536 + g*256 + r); } int colorgradient(int r, int g, int b, int r2, int g2, int b2, double min, double max, double pos) { double steps = (max-min); pos = max-pos; double stepR = (r-r2)/(steps-1); double stepG = (g-g2)/(steps-1); double stepB = (b-b2)/(steps-1); return (rgb2int((r-(stepR*pos)),(g-(stepG*pos)),(b-(stepB*pos)))); } /* //--these three functions are used to extract the RGB values from the user's external color */ int GetBlue(int clr) { int blue = MathFloor(clr / 65536); return (blue); } int GetGreen(int clr) { int blue = MathFloor(clr / 65536); int green = MathFloor((clr-(blue*65536)) / 256); return (green); } int GetRed(int clr) { int blue = MathFloor(clr / 65536); int green = MathFloor((clr-(blue*65536)) / 256); int red = clr -(blue*65536) - (green*256); return (red); } //+------------------------------------------------------------------+Heat_Map_MultiColor.jpgHeat_Map_MultiColor.jpg
TK29帖子1楼右侧xm竖版广告90-240
个性签名

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

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告
ljwlxrll
注册时间2015-02-10
发表于:2015-02-10 13:41只看该作者
2楼
到底好用不好用
tanqingyuye
注册时间2015-04-02
发表于:2015-05-26 03:37只看该作者
3楼
好东西赞一个。
远静
注册时间2015-09-07
hycen
注册时间2015-11-08
发表于:2015-11-09 10:52只看该作者
5楼
哎,导出都是代码,那些指标好用呢
解药
注册时间2015-11-09
发表于:2015-11-10 06:20只看该作者
6楼
好复杂~~~不懂安阳
个性签名

韬客社区www.talkfx.co

广告
论坛谏言--外汇交易不应是你投资的全部,交易外汇也不应是你生活的全部
goodday
注册时间2016-12-06
发表于:2016-12-07 10:17只看该作者
8楼
谢楼主的分享
个性签名

韬客社区www.talkfx.co

广告
论坛谏言--外汇交易不应是你投资的全部,交易外汇也不应是你生活的全部
Pzxzx
注册时间2017-08-06

本站免责声明:

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

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

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

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

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

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