论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
查看:1807回复:5
草龙
注册时间2004-12-17
[MT4指标]LabTrend1变色k线指标
楼主发表于:2014-09-04 08:21只看该作者倒序浏览
1楼 电梯直达
电梯直达
主图指标 mt4指标类型:震荡指标 是否能用在mt4手机版上:否 是否含有未来函数:无 可以用在韬客外汇返佣网的平台上 //+------------------------------------------------------------------+ //| LabTrend1_v2.mq4 | //| Copyright ? 2006, TrendLaboratory Ltd. | //| http://finance.groups.yahoo.com/group/TrendLaboratory | //| E-mail: [email protected] | //+------------------------------------------------------------------+ #property copyright "Copyright ? 2006, TrendLaboratory Ltd." #property link "http://finance.groups.yahoo.com/group/TrendLaboratory" //---- #property indicator_chart_window #property indicator_buffers 6 #property indicator_color1 Blue #property indicator_color2 Red #property indicator_color3 Blue #property indicator_color4 Red #property indicator_width3 0 #property indicator_width4 0 //---- input parameters extern double Risk =3; //Price Channel narrowing factor (1..10) extern int TimeFrame =0; //TimeFrame in min extern int Signal =1; //Display signals mode extern int ColorBar =1; //Display color bars mode: 0-no,1-yes extern int SoundAlertMode=0; //Sound Alert switch //---- indicator buffers double UpTrendSignal; double DownTrendSignal; double UpTrendBar; double DownTrendBar; double smax; double smin; double trend; int Length=9, time[2]; bool Expert=true; double BSMAX[2],BSMIN[2]; bool UpTrendAlert=false, DownTrendAlert=false; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string short_name; //---- indicator line IndicatorBuffers(7); SetIndexBuffer(0,UpTrendSignal); SetIndexBuffer(1,DownTrendSignal); SetIndexBuffer(2,UpTrendBar); SetIndexBuffer(3,DownTrendBar); SetIndexBuffer(4,smax); SetIndexBuffer(5,smin); SetIndexBuffer(6,trend); SetIndexStyle(0,DRAW_ARROW); SetIndexStyle(1,DRAW_ARROW); SetIndexStyle(2,DRAW_HISTOGRAM); SetIndexStyle(3,DRAW_HISTOGRAM); SetIndexArrow(0,108); SetIndexArrow(1,108); //---- name for DataWindow and indicator subwindow label short_name="LabTrend1("+DoubleToStr(Risk,2)+")"; IndicatorShortName(short_name); SetIndexLabel(0,"UpTrend Signal"); SetIndexLabel(1,"DownTrend Signal"); SetIndexLabel(2,"UpTrend Bar"); SetIndexLabel(3,"DownTrend Bar"); //---- SetIndexEmptyValue(0,0.0); SetIndexEmptyValue(1,0.0); SetIndexEmptyValue(2,0.0); SetIndexEmptyValue(3,0.0); SetIndexDrawBegin(0,Length); SetIndexDrawBegin(1,Length); SetIndexDrawBegin(2,Length); SetIndexDrawBegin(3,Length); //---- return(0); } //+------------------------------------------------------------------+ //| LabTrend1_v2 | //+------------------------------------------------------------------+ int start() { datetime TimeArray; int i,shift,y=0,MaxBar,limit,counted_bars=IndicatorCounted(); double high, low, price, sum, UpBar,DnBar; double bsmax[1],bsmin[1]; double LowArray,HighArray; int Line=0; //Display line mode: 0-no,1-yes //---- if (Bars-10) counted_bars--; //---- MaxBar=Bars-1-Length-1; limit=Bars-counted_bars-1 + TimeFrame/Period(); //---- if (limit>MaxBar) { for(shift=limit;shift>=MaxBar;shift--) { smax[Bars-shift]=0.0; smin[Bars-shift]=0.0; UpTrendSignal[Bars-shift]=0.0; DownTrendSignal[Bars-shift]=0.0; UpTrendBar[Bars-shift]=0.0; DownTrendBar[Bars-shift]=0.0; } limit=MaxBar; } if(ArrayResize(bsmin,limit+2)!=limit+2)return(-1); if(ArrayResize(bsmax,limit+2)!=limit+2)return(-1); int Tnew=Time[limit+1]; //---- if (limittime[1])Print("Error1"); else Print("Error2"); return(-1); } // Draw price channel boards + calculation : Channel middle, half channel width, ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame); ArrayCopySeries(LowArray,MODE_LOW,Symbol(),TimeFrame); ArrayCopySeries(HighArray,MODE_HIGH,Symbol(),TimeFrame); for(shift=0,y=0;shift=0;i--) { smin[shift]=MathMin(smin[shift],LowArray[y+i]); smax[shift]=MathMax(smax[shift],HighArray[y+i]); } } for(shift=limit;shift>=0;shift--) { UpTrendSignal[shift]=0.0; DownTrendSignal[shift]=0.0; UpTrendBar[shift]=0.0; DownTrendBar[shift]=0.0; // Calculation channel stop values bsmax[shift]=smax[shift]-(smax[shift]-smin[shift])*(33.0-Risk)/100.0; bsmin[shift]=smin[shift]+(smax[shift]-smin[shift])*(33.0-Risk)/100.0; // Signal area : any conditions to trend determination: // 1. Price Channel breakout trend[shift]=trend[shift+1]; if(trend[shift+1]<0 && Close[shift]>bsmax[shift]) trend[shift]=1; if(trend[shift+1]>0 && Close[shift]labtrend1_v2.jpg
TK29帖子1楼右侧xm竖版广告90-240
个性签名

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

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告
hlbb
注册时间2014-09-18
发表于:2014-09-18 09:53只看该作者
2楼
职业交易者的交易之路
HONGCHUN
注册时间2014-06-19
rimonky
注册时间2014-11-29
发表于:2015-07-08 00:56只看该作者
4楼
感谢分享
玉中幽灵
注册时间2016-03-10
发表于:2016-04-29 09:12只看该作者
5楼
下载测试一下先
个性签名

韬客社区www.talkfx.co

广告
论坛谏言--外汇交易不应是你投资的全部,交易外汇也不应是你生活的全部
Pzxzx
注册时间2017-08-06
发表于:2017-08-09 00:41只看该作者
6楼
缺钱,灌水赚通宝,谢谢分享!!

本站免责声明:

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

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

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

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

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

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