论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
查看:2168回复:5
redreg
注册时间2007-07-21
[MT4指标]求助懂编程的朋友请帮我把这个指标的粗线改成细线!非常感谢!
楼主发表于:2008-03-18 13:36只看该作者倒序浏览
1楼 电梯直达
电梯直达
先谢谢了,我想把这个指标的粗线改成细线!且当切换完周期后细线不会再变回粗线.我试了改指标的属性改完一切换周期就又还原了,所以只能请高手帮改下程序了,谢谢!!!!!!!!! //+------------------------------------------------------------------+ //| AMA.mq4 | //| Copyright ?2004, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright ?2004, by konKop,wellx" #property link "http://www.metaquotes.net" #property indicator_chart_window #property indicator_buffers 3 #property indicator_color1 Sienna #property indicator_color2 DeepSkyBlue #property indicator_color3 Gold //---- input parameters extern int periodAMA=9; extern int nfast=2; extern int nslow=30; extern double G=2.0; extern double dK=2.0; //---- buffers double kAMAbuffer; double kAMAupsig; double kAMAdownsig; //+------------------------------------------------------------------+ int cbars=0, prevbars=0, prevtime=0; double slowSC,fastSC; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE,0,2); SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(1,159); SetIndexStyle(2,DRAW_ARROW); SetIndexArrow(2,159); //SetIndexDrawBegin(0,nslow+nfast); SetIndexBuffer(0,kAMAbuffer); SetIndexBuffer(1,kAMAupsig); SetIndexBuffer(2,kAMAdownsig); IndicatorDigits(4); //slowSC=0.064516; //fastSC=0.2; //cbars=IndicatorCounted(); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int i,pos=0; double noise=0.000000001,AMA,AMA0,signal,ER; double dSC,ERSC,SSC,ddK; if (prevbars==Bars) return(0); //---- TODO: add your code here slowSC=(2.0 /(nslow+1)); fastSC=(2.0 /(nfast+1)); cbars=IndicatorCounted(); if (Bars<=(periodAMA+2)) return(0); //---- check for possible errors if (cbars<0) return(-1); //---- last counted bar will be recounted if (cbars>0) cbars--; pos=Bars-periodAMA-2; AMA0=Close[pos+1]; while (pos>=0) { if(pos==Bars-periodAMA-2) AMA0=Close[pos+1]; signal=MathAbs(Close[pos]-Close[pos+periodAMA]); noise=0.000000001; for(i=0;i (dK*Point) && (ddK > 0)) kAMAupsig[pos] =AMA; else kAMAupsig[pos]=0; if ((MathAbs(ddK)) > (dK*Point) && (ddK < 0)) kAMAdownsig[pos]=AMA; else kAMAdownsig[pos]=0; AMA0=AMA; pos--; }; //---- prevbars=Bars; return(0); }
TK29帖子1楼右侧xm竖版广告90-240
个性签名

长期持仓.

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告
judaise
注册时间2008-03-17
发表于:2008-03-18 15:59只看该作者
2楼
//+------------------------------------------------------------------+ //| AMA.mq4 | //| Copyright ?2004, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright ?2004, by konKop,wellx" #property link "http://www.metaquotes.net" #property indicator_chart_window #property indicator_buffers 3 #property indicator_color1 Sienna #property indicator_color2 DeepSkyBlue #property indicator_color3 Gold //---- input parameters extern int periodAMA=9; extern int nfast=2; extern int nslow=30; extern double G=2.0; extern double dK=2.0; //---- buffers double kAMAbuffer; double kAMAupsig; double kAMAdownsig; //+------------------------------------------------------------------+ int cbars=0, prevbars=0, prevtime=0; double slowSC,fastSC; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE,0,1); SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(1,159); SetIndexStyle(2,DRAW_ARROW); SetIndexArrow(2,159); //SetIndexDrawBegin(0,nslow+nfast); SetIndexBuffer(0,kAMAbuffer); SetIndexBuffer(1,kAMAupsig); SetIndexBuffer(2,kAMAdownsig); IndicatorDigits(4); //slowSC=0.064516; //fastSC=0.2; //cbars=IndicatorCounted(); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int i,pos=0; double noise=0.000000001,AMA,AMA0,signal,ER; double dSC,ERSC,SSC,ddK; if (prevbars==Bars) return(0); //---- TODO: add your code here slowSC=(2.0 /(nslow+1)); fastSC=(2.0 /(nfast+1)); cbars=IndicatorCounted(); if (Bars<=(periodAMA+2)) return(0); //---- check for possible errors if (cbars<0) return(-1); //---- last counted bar will be recounted if (cbars>0) cbars--; pos=Bars-periodAMA-2; AMA0=Close[pos+1]; while (pos>=0) { if(pos==Bars-periodAMA-2) AMA0=Close[pos+1]; signal=MathAbs(Close[pos]-Close[pos+periodAMA]); noise=0.000000001; for(i=0;i (dK*Point) && (ddK > 0)) kAMAupsig[pos] =AMA; else kAMAupsig[pos]=0; if ((MathAbs(ddK)) > (dK*Point) && (ddK < 0)) kAMAdownsig[pos]=AMA; else kAMAdownsig[pos]=0; AMA0=AMA; pos--; } //---- prevbars=Bars; return(0); } [ 本帖最后由 管理员No.6 于 2008-3-19 15:22 编辑 ]
judaise
注册时间2008-03-17
发表于:2008-03-18 16:21只看该作者
3楼
不知道对不对,请正版、风雨无阻、wfl05等高手指正 另外,在我机器上,第88行、第101行,大括号}后的";"分号不能要,否则编译通不过  [ 本帖最后由 judaise 于 2008-3-19 00:26 编辑 ]
redreg
注册时间2007-07-21
楼主发表于:2008-03-19 00:05只看该作者
4楼
啊,太好了 judaise 强! 这么快就搞定,感谢!!!!!!!!!!!!!!!!!!!!!!!!!! judaise朋友 再请教一下,你能不能在你改过的程序上(上面2楼),把那个AMA那条细线上面的两种颜色的小点点去掉,我只想要那条细线不想要那小点点...我不懂,不知你有没办法改一下,我试过改属性为无色但显示效果不好,请您再帮忙一下,感激不尽!!!!!!!!!!!!
judaise
注册时间2008-03-17
发表于:2008-03-19 09:31只看该作者
5楼
//+------------------------------------------------------------------+ //| AMA.mq4 | //| Copyright ?2004, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright ?2004, by konKop,wellx" #property link "http://www.metaquotes.net" #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Sienna #property indicator_color2 DeepSkyBlue #property indicator_color3 Gold //---- input parameters extern int periodAMA=9; extern int nfast=2; extern int nslow=30; extern double G=2.0; extern double dK=2.0; //---- buffers double kAMAbuffer; double kAMAupsig; double kAMAdownsig; //+------------------------------------------------------------------+ int cbars=0, prevbars=0, prevtime=0; double slowSC,fastSC; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE,0,1); SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(1,159); SetIndexStyle(2,DRAW_ARROW); SetIndexArrow(2,159); //SetIndexDrawBegin(0,nslow+nfast); SetIndexBuffer(0,kAMAbuffer); SetIndexBuffer(1,kAMAupsig); SetIndexBuffer(2,kAMAdownsig); IndicatorDigits(4); //slowSC=0.064516; //fastSC=0.2; //cbars=IndicatorCounted(); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int i,pos=0; double noise=0.000000001,AMA,AMA0,signal,ER; double dSC,ERSC,SSC,ddK; if (prevbars==Bars) return(0); //---- TODO: add your code here slowSC=(2.0 /(nslow+1)); fastSC=(2.0 /(nfast+1)); cbars=IndicatorCounted(); if (Bars<=(periodAMA+2)) return(0); //---- check for possible errors if (cbars<0) return(-1); //---- last counted bar will be recounted if (cbars>0) cbars--; pos=Bars-periodAMA-2; AMA0=Close[pos+1]; while (pos>=0) { if(pos==Bars-periodAMA-2) AMA0=Close[pos+1]; signal=MathAbs(Close[pos]-Close[pos+periodAMA]); noise=0.000000001; for(i=0;i (dK*Point) && (ddK > 0)) kAMAupsig[pos] =AMA; else kAMAupsig[pos]=0; if ((MathAbs(ddK)) > (dK*Point) && (ddK < 0)) kAMAdownsig[pos]=AMA; else kAMAdownsig[pos]=0; AMA0=AMA; pos--; } //---- prevbars=Bars; return(0); }
redreg
注册时间2007-07-21
楼主发表于:2008-03-19 10:43只看该作者
6楼
judaise大侠,你真太强了,我试了,真的没小点点了...开心死了.崇拜你! 衷心感谢!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

本站免责声明:

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

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

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

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

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

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