论坛全局菜单下方 - exness285X70 - 韬客社区论坛全局菜单下方 - 荔枝返现285X70 - 韬客社区论坛全局菜单下方 - ThinkMarkets285X70 - 韬客社区论坛全局菜单下方 - TICKMILL 285X70 - 韬客社区
查看:2274回复:9
草龙韬客社区韬客社区
注册时间2004-12-17
[MT4指标]吊灯止损指标
韬客社区
楼主发表于:2014-10-19 23:18只看该作者倒序浏览
1楼 电梯直达
电梯直达
主图指标 mt4指标类型:趋势指标 是否能用在mt4手机版上:否 是否含有未来函数:无 //+------------------------------------------------------------------+ //| ChandelierStops_v1.mq4 | //| Copyright ? 2006, Forex-TSD.com | //| Written by IgorAD,[email protected] | //| http://finance.groups.yahoo.com/group/TrendLaboratory | //+------------------------------------------------------------------+ #property copyright \"Copyright ? 2006, Forex-TSD.com \" #property link \"http://www.forex-tsd.com/\" //---- #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Blue #property indicator_color2 Red //---- input parameters extern int Length=15; extern int ATRperiod=14; extern double Kv=4; extern int Shift=1; //---- indicator buffers double UpBuffer1; double DnBuffer1; double smin; double smax; double trend; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string short_name; //---- indicator line SetIndexStyle(0,DRAW_LINE); SetIndexStyle(1,DRAW_LINE); IndicatorBuffers(5); SetIndexBuffer(0,UpBuffer1); SetIndexBuffer(1,DnBuffer1); SetIndexBuffer(2,smin); SetIndexBuffer(3,smax); SetIndexBuffer(4,trend); //---- name for DataWindow and indicator subwindow label short_name=\"ATRStops(\"+Length+\")\"; IndicatorShortName(short_name); SetIndexLabel(0,\"Up\"); SetIndexLabel(1,\"Dn\"); //---- SetIndexDrawBegin(0,Length); SetIndexDrawBegin(1,Length); //---- return(0); } //+------------------------------------------------------------------+ //| ChandelierStops_v1 | //+------------------------------------------------------------------+ int start() { int shift,limit, counted_bars=IndicatorCounted(); //---- if(counted_bars > 0) limit=Bars-counted_bars; if(counted_bars < 0) return(0); if(counted_bars ==0) limit=Bars-Length-1; //---- for(shift=limit;shift>=0;shift--) { smin[shift]=High[Highest(NULL,0,MODE_HIGH,Length,shift+Shift)] - Kv*iATR(NULL,0,ATRperiod,shift+Shift); smax[shift]=Low[Lowest(NULL,0,MODE_LOW,Length,shift+Shift)] + Kv*iATR(NULL,0,ATRperiod,shift+Shift); trend[shift]=trend[shift+1]; //---- if(Close[shift] > smax[shift+1])trend[shift]= 1; if(Close[shift] < smin[shift+1])trend[shift]=-1; if(trend[shift] >0) { if(smin[shift]smax[shift+1])smax[shift]=smax[shift+1]; UpBuffer1[shift]=EMPTY_VALUE; DnBuffer1[shift]=smax[shift]; } } return(0); } //+------------------------------------------------------------------+
TK29帖子1楼右侧xm竖版广告90-240
个性签名

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

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告
evolution9韬客社区韬客社区
注册时间2014-07-19
softking韬客社区韬客社区
注册时间2014-09-20
韬客社区
发表于:2014-12-19 18:04只看该作者
3楼
愿意把代码都公布出来的必须要顶~
comp韬客社区韬客社区
注册时间2012-09-08
韬客社区
发表于:2015-01-21 05:21只看该作者
4楼
nice...thank you for sharing..........
haoyio韬客社区韬客社区
注册时间2015-04-14
韬客社区
发表于:2015-07-03 13:54只看该作者
5楼
谢谢楼主分享,不买也要顶个!
wsndhy韬客社区韬客社区
注册时间2015-07-06
韬客社区
发表于:2015-07-06 05:39只看该作者
7楼
啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊
rimonky韬客社区韬客社区
注册时间2014-11-29
韬客社区
发表于:2015-07-06 23:47只看该作者
8楼
感谢分享
个性签名

韬客社区www.talkfx.co

WLLYH韬客社区韬客社区
注册时间2016-09-17
版权所有:韬客外汇论坛 www.talkfx.com 联络我们:[email protected]