编码帮助 - 页 202 1...195196197198199200201202203204205206207208209...786 新评论 daytrade5 2013.12.02 11:10 #2011 无法在图表上移动文本输出而不出错? 目前的范围信息文本输出被价格蜡烛所覆盖。我的编码技能不足,每次尝试都以错误告终。我只是试图在图表上移动文本输出,如图所示。谁能帮帮我?非常感谢!!!蚂蚁-突破.mq4 附加的文件: ant-gubreakout.mq4 10 kb screenshot.jpg 105 kb Mladen Rakic 2013.12.02 11:32 #2012 daytrade5: 目前的范围信息文本输出是由价格蜡烛覆盖的。我的编码能力不足,每次尝试都以错误告终。我只是想在图表上移动文本输出,如图所示。谁能帮帮我?非常感谢!!!蚂蚁-突破.mq4 Daytrade5 当使用metatrader 4时,我们不能选择文本类型对象的锚点(metatrader 4总是对这类对象使用固定的锚点,我们不能改变)。附上一个版本,可以修改文本的位置(使用TEXT_OFFSET),但有时你必须改变它的值,而且对齐方式也不是100%完美。 附加的文件: ant-gubreakout_1.mq4 10 kb daytrade5 2013.12.02 12:54 #2013 mladen: daytrade5 当使用metatrader 4时,我们不能选择文本类型对象的锚(metatrader 4总是对这种对象使用一个固定的锚,我们不能改变)。附上一个版本,可以修改文本的位置(使用TEXT_OFFSET),但有时你必须改变它的值,而且对齐方式也不是100%完美。 OK....,非常感谢你。我从来没有想过这个问题。 zigflip 2013.12.03 04:11 #2014 良好的停泊,请帮助解决这个订单警报mq4 - 当一个订单被关闭时,它会发送一个警报,但现在它为每个图表 上打开的每个符号发送警报,而不是只对相关符号采取行动。 请注意。 附加的文件: alertcloseorderen.mq4 2 kb Mladen Rakic 2013.12.03 06:33 #2015 zigflip: 好的停泊,请帮助解决这个订单警报MQ4--当一个订单被关闭时,它会发送一个警报,但现在它为每个图表上打开的每个符号发送警报,而不是只对相关符号采取行动。亲切的问候, zigflip 现在就试试吧 附加的文件: alertcloseorderen_1.01.mq4 2 kb schmidt 2013.12.03 08:29 #2016 不知道如何从4个CIC中获取数值 你好。 我还有一个问题,第一个问题我已经解决了,谢谢你,Mladen 我在这里找到了mladen的4个Cci,我非常喜欢它,我知道它是重绘的,但它对我来说还是非常有用的。 我想把这4个值放到另一个自制的指标中,但我就是找不到方法。 我试着用前一页中的bool线和4cci中的值来做,但它对我不起作用。 我想对于有经验的代码来说,有一个简单的解决方案,但我已经花了很多时间,却没有想出办法。 谢谢你的建议 鲍勃 //------------------------------------------------------------------ #property copyright "mladen"#property link "www.forex-tsd.cm" //------------------------------------------------------------------ #属性 indicator_separate_window #属性 indicator_buffers 8 #属性 indicator_color1 石灰绿 #属性 indicator_color2 PaleVioletRed #属性 indicator_color3 石灰绿 #属性 indicator_color4 淡紫红 #属性 indicator_color4 淡紫红 #属性指示器_color5 青柠绿 #属性指示器_color6 淡紫红色 #属性指示器_color6 淡紫红色 #属性指示器_color7 青柠绿 #属性指示器_color8 淡紫红色 #属性指示器_color8 淡紫红色 #属性指示器_最小值 0 #属性 indicator_maximum 5 // // // // // 外部字符串 TimeFrame1 = "当前时间框架"。 extern string TimeFrame2 = "next1"; extern string TimeFrame3 = "next2"; extern string TimeFrame4 = "next3"; 外置 int Period_CCI = 24; 外部字符串 UniqueID = "4个时间CCI斜率"。 外部int LinesWidth = 0; 外部颜色 LabelsColor = DarkGray; 外置 int LabelsHorizontalShift = 5; 外置双数 LabelsVerticalShift = 1.5; 外部 bool alertsOn = false; 外置 int alertsLevel = 3; 外部bool alertsMessage = FALSE; 外置 bool alertsSound = false; 外置ool alertsEmail = false; // // // // // 双倍gosc1u[]。 双倍gosc1d[]。 双倍gosc2u[]。 双倍gosc2d[]。 双倍gosc3u[]。 双倍gosc3d[]。 双倍gosc4u[]。 双倍gosc4d[]。 int timeFrames[4]; bool returnBars。 字符串 indicatorFileName。 //------------------------------------------------------------------ // //------------------------------------------------------------------ // // // // // int init() { SetIndexBuffer(0,gosc1u); SetIndexBuffer(1,gosc1d); SetIndexBuffer(2,gosc2u); SetIndexBuffer(3,gosc2d); SetIndexBuffer(4,gosc3u); SetIndexBuffer(5,gosc3d); SetIndexBuffer(6,gosc4u); SetIndexBuffer(7,gosc4d); indicatorFileName = WindowExpertName(); returnBars = (TimeFrame1=="returnBars"); if (returnBars) return(0); // // // // // for (int i=0; i<8; i++) { SetIndexStyle(i,DRAW_ARROW,EMPTY,LinesWidth); SetIndexArrow(i,110); } timeFrames[0] = stringToTimeFrame(TimeFrame1); timeFrames[1] = stringToTimeFrame(TimeFrame2); timeFrames[2] = stringToTimeFrame(TimeFrame3); timeFrames[3] = stringToTimeFrame(TimeFrame4); alertsLevel = MathMin(MathMax(alertsLevel,3),4)。 IndicatorShortName(UniqueID)。 返回(0)。 } int deinit() { for (int t=0; t<4; t++) ObjectDelete(UniqueID+t); return(0); } //------------------------------------------------------------------ // //------------------------------------------------------------------ // // // // // double trend[][6]; #define _up 0 #define _dn 1 #define _hl1 2 #define _hl2 3 #define _hl3 4 #define _hl4 5 int start() { int i,r,count,counted_bars=IndicatorCounted()。 if(counted_bars < 0) return(-1); 如果(counted_bars>0) counted_bars--。 int limit = MathMin(Bars-counted_bars,Bars-1); if (returnBars) { gosc1u[0] = limit+1; return(0); } 如果 (timeFrames[0] != Period()) limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrames[0],indicatorFileName, "returnBars",0,0)*timeFrames[0]/Period() )。 如果 (timeFrames[1] != Period()) limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrames[1],indicatorFileName, "returnBars",0,0)*timeFrames[1]/Period() )。 如果 (timeFrames[2] != Period()) limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrames[2],indicatorFileName, "returnBars",0,0)*timeFrames[2]/Period() )。 如果 (timeFrames[3] != Period()) limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrames[3],indicatorFileName, "returnBars",0,0)*timeFrames[3]/Period() )。 如果(ArrayRange(trend,0)!=Bars) ArrayResize(trend,Bars)。 // // // // // bool initialized = false; if (!initialized) { initialized = true。 int window = WindowFind(UniqueID); for (int t=0; t<4; t++) { string label = timeFrameToString(timeFrames[t]); ObjectCreate(UniqueID+t,OBJ_TEXT,window,0,0)。 ObjectSet(UniqueID+t,OBJPROP_COLOR,LabelsColor)。 ObjectSet(UniqueID+t,OBJPROP_PRICE1,t+LabelsVerticalShift)。 ObjectSetText(UniqueID+t,label,8, "Arial")。 } } for (t=0; t<4; t++) ObjectSet(UniqueID+t,OBJPROP_TIME1,Time[0]+Period()*LabelsHorizontalShift*60) 。 // // // // // for(i = limit, r=Bars-i-1; i >= 0; i--, r++) { trend[r][_up] = 0; trend[r][_dn] = 0; trend[r][_hl1] = trend[r-1][_hl1]。 trend[r][_hl2] = trend[r-1][_hl2]; trend[r][_hl3] = trend[r-1][_hl3]; trend[r][_hl4] = trend[r-1][_hl4]。 for (int k=0; k<4; k++) { int y = iBarShift(NULL,timeFrames[k],Time); double cciNow = iCCI(NULL, timeFrames[k], Period_CCI, PRICE_TYPICAL, y); double cciPre = iCCI(NULL, timeFrames[k], Period_CCI, PRICE_TYPICAL, y+1); 如果(ciNow>cciPre) trend[r][k+2] = 1。 如果 (ciNow<cciPre) trend[r][k+2] = -1; switch (k) { case 0 : if (trendy[r][k+2]==1) { gosc1u = k+1; gosc1d = EMPTY_VALUE;} else { gosc1d = k+1; gosc1u = EMPTY_VALUE; } break; case 1 : if (trendy[r][k+2]==1) { gosc2u = k+1; gosc2d = EMPTY_VALUE;} else { gosc2d = k+1; gosc2u = EMPTY_VALUE; } break; case 2 : if (trendy[r][k+2]==1) { gosc3u = k+1; gosc3d = EMPTY_VALUE;} else { gosc3d = k+1; gosc3u = EMPTY_VALUE; } break; case 3 : if (trend[r][k+2]==1) { gosc4u = k+1; gosc4d = EMPTY_VALUE;} else { gosc4d = k+1; gosc4u = EMPTY_VALUE; } break; } 如果(trendice[r][k+2]==1) trend[r][_up] +=1。 否则 trend[r][_dn] += 1; } } manageAlerts()。 return(0); } //+------------------------------------------------------------------- //| //+------------------------------------------------------------------- // // // // // 空白管理提示()。 { 如果(alertsOn) { int whichBar = Bars-1; 如果(趋势[whichBar][_up] >= alertsLevel ||趋势[whichBar][_dn] >= alertsLevel)。 { 如果(trend[whichBar][_up] >= alertsLevel) doAlert("up" ,trend[whichBar][_up])。 如果(trendy[whichBar][_dn] >= alertsLevel) doAlert("down",trendy[whichBar][_dn])。 } } } // // // // // void doAlert(string doWhat, int howMany) { 静态字符串previousAlert="无"。 static datetime previousTime; 字符串信息。 如果(previousAlert != doWhat || previousTime != Time[0]) { previousAlert = doWhat; previousTime = Time[0]; // // // // // message = Symbol()+" at "+TimeToStr(TimeLocal(),TIME_SECONDS)+" "+howMany+" time frames of MA trends are aligned "+doWhat; if (alertsMessage) Alert(message); 如果(alertsEmail)SendMail(Symbol()+" 4个时间框架的MA趋势",message)。 如果(alertsSound) PlaySound("alert2.wav")。 } } //------------------------------------------------------------------- // //------------------------------------------------------------------- // // // // // string sTfTable[] = {"M1", "M5", "M15", "M30", "H1", "H4", "D1", "W1", "MN" }; int iTfTable[] = {1,5,15,30,60,240,1440,10080,43200}; // // // // // int toInt(double value) { return(value); } int stringToTimeFrame(string tfs) { tfs = stringUpperCase(tfs); int max = ArraySize(iTfTable)-1, add=0; int nxt = (StringFind(tfs, "NEXT1")>-1); if (nxt>0) { tfs = ""+Period(); add=1; } nxt = (StringFind(tfs, "NEXT2")>-1); if (nxt>0) { tfs = ""+Period(); add=2; } nxt = (StringFind(tfs, "NEXT3")>-1); if (nxt>0) { tfs = ""+Period(); add=3; } // // // // // for (int i=max; i>=0; i--) if (tfs==sTfTable || tfs==""+iTfTable) return(MathMax(iTfTable[toInt(MathMin(max,i+add))], Period())。 return(Period())。 } string timeFrameToString(int tf) { for (int i=ArraySize(iTfTable)-1; i>=0; i--) if (tf==iTfTable) return(sTfTable); return("")。 } // // // // // stringUpperCase(string str) { string s = str; for (int length=StringLen(str)-1; length>=0; length--) { int char = StringGetChar(s, length); if((char > 96 && char 223 && char < 256)) s = StringSetChar(s, length, char - 32); 否则如果(char > -33 && char < 0) s = StringSetChar(s, length, char + 224); } return(s); } Mladen Rakic 2013.12.03 09:04 #2017 BobMorane1000: 你好。我还有一个问题,第一个问题我已经解决了,谢谢你,Mladen 我在这里找到了mladen的4个Cci,我非常喜欢它,我知道它是重绘的,但它对我来说仍然非常有效。 我想把这4个值放到另一个自制的指标中,但我就是找不到方法。 我试着用前一页中的bool线和4cci中的值来做,但它对我不起作用。 我想对于有经验的代码来说,有一个简单的解决方案,但我已经花了很多时间,却没有想出办法。 谢谢你的建议 鲍勃 BobMorane1000 你为什么不简单地用iCCI() 调用来代替4次呢(即使从代码上看也会简单得多)? schmidt 2013.12.03 10:01 #2018 你是对的,我会这样做的。 再次感谢 kingsleyedeh4re 2013.12.03 11:05 #2019 谁能帮我在这个随机的十字架上添加箭头? 附加的文件: ds_stochastic.mq4 4 kb wolf1210 2013.12.03 12:16 #2020 [ATTACH]187655 嗨,我需要帮助。 我有一个很好的Trendindicatoe,它把蜡烛染成绿色并读出趋势。但它有一个错误:当改变时间框架时,它不能让颜色保持不变。但更糟糕的是,几乎看不到假发,我无法改变这一点。 谁能看一下? 非常感谢。我附上该指标 附加的文件: t3_thv.ex4 5 kb 1...195196197198199200201202203204205206207208209...786 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
无法在图表上移动文本输出而不出错?
目前的范围信息文本输出被价格蜡烛所覆盖。我的编码技能不足,每次尝试都以错误告终。我只是试图在图表上移动文本输出,如图所示。谁能帮帮我?非常感谢!!!蚂蚁-突破.mq4![](https://c.mql5.com/forextsd/forum/124/screenshot.jpg)
目前的范围信息文本输出是由价格蜡烛覆盖的。我的编码能力不足,每次尝试都以错误告终。我只是想在图表上移动文本输出,如图所示。谁能帮帮我?非常感谢!!!蚂蚁-突破.mq4
Daytrade5
当使用metatrader 4时,我们不能选择文本类型对象的锚点(metatrader 4总是对这类对象使用固定的锚点,我们不能改变)。附上一个版本,可以修改文本的位置(使用TEXT_OFFSET),但有时你必须改变它的值,而且对齐方式也不是100%完美。
daytrade5 当使用metatrader 4时,我们不能选择文本类型对象的锚(metatrader 4总是对这种对象使用一个固定的锚,我们不能改变)。附上一个版本,可以修改文本的位置(使用TEXT_OFFSET),但有时你必须改变它的值,而且对齐方式也不是100%完美。
OK....,非常感谢你。我从来没有想过这个问题。
良好的停泊,请帮助解决这个订单警报mq4 - 当一个订单被关闭时,它会发送一个警报,但现在它为每个图表 上打开的每个符号发送警报,而不是只对相关符号采取行动。
请注意。![](https://c.mql5.com/forextsd/smiles/rolleyes2.png)
好的停泊,请帮助解决这个订单警报MQ4--当一个订单被关闭时,它会发送一个警报,但现在它为每个图表上打开的每个符号发送警报,而不是只对相关符号采取行动。亲切的问候,
zigflip
现在就试试吧
不知道如何从4个CIC中获取数值
你好。
我还有一个问题,第一个问题我已经解决了,谢谢你,Mladen![](https://c.mql5.com/forextsd/smiles/smile.png)
我在这里找到了mladen的4个Cci,我非常喜欢它,我知道它是重绘的,但它对我来说还是非常有用的。
我想把这4个值放到另一个自制的指标中,但我就是找不到方法。
我试着用前一页中的bool线和4cci中的值来做,但它对我不起作用。
我想对于有经验的代码来说,有一个简单的解决方案,但我已经花了很多时间,却没有想出办法。
谢谢你的建议
鲍勃
#property copyright "mladen"
#property link "www.forex-tsd.cm"
//------------------------------------------------------------------
#属性 indicator_separate_window
#属性 indicator_buffers 8
#属性 indicator_color1 石灰绿
#属性 indicator_color2 PaleVioletRed
#属性 indicator_color3 石灰绿
#属性 indicator_color4 淡紫红 #属性 indicator_color4 淡紫红
#属性指示器_color5 青柠绿
#属性指示器_color6 淡紫红色 #属性指示器_color6 淡紫红色
#属性指示器_color7 青柠绿
#属性指示器_color8 淡紫红色 #属性指示器_color8 淡紫红色
#属性指示器_最小值 0
#属性 indicator_maximum 5
//
//
//
//
//
外部字符串 TimeFrame1 = "当前时间框架"。
extern string TimeFrame2 = "next1";
extern string TimeFrame3 = "next2";
extern string TimeFrame4 = "next3";
外置 int Period_CCI = 24;
外部字符串 UniqueID = "4个时间CCI斜率"。
外部int LinesWidth = 0;
外部颜色 LabelsColor = DarkGray;
外置 int LabelsHorizontalShift = 5;
外置双数 LabelsVerticalShift = 1.5;
外部 bool alertsOn = false;
外置 int alertsLevel = 3;
外部bool alertsMessage = FALSE;
外置 bool alertsSound = false;
外置ool alertsEmail = false;
//
//
//
//
//
双倍gosc1u[]。
双倍gosc1d[]。
双倍gosc2u[]。
双倍gosc2d[]。
双倍gosc3u[]。
双倍gosc3d[]。
双倍gosc4u[]。
双倍gosc4d[]。
int timeFrames[4];
bool returnBars。
字符串 indicatorFileName。
//------------------------------------------------------------------
//
//------------------------------------------------------------------
//
//
//
//
//
int init()
{
SetIndexBuffer(0,gosc1u);
SetIndexBuffer(1,gosc1d);
SetIndexBuffer(2,gosc2u);
SetIndexBuffer(3,gosc2d);
SetIndexBuffer(4,gosc3u);
SetIndexBuffer(5,gosc3d);
SetIndexBuffer(6,gosc4u);
SetIndexBuffer(7,gosc4d);
indicatorFileName = WindowExpertName();
returnBars = (TimeFrame1=="returnBars"); if (returnBars) return(0);
//
//
//
//
//
for (int i=0; i<8; i++)
{
SetIndexStyle(i,DRAW_ARROW,EMPTY,LinesWidth); SetIndexArrow(i,110);
}
timeFrames[0] = stringToTimeFrame(TimeFrame1);
timeFrames[1] = stringToTimeFrame(TimeFrame2);
timeFrames[2] = stringToTimeFrame(TimeFrame3);
timeFrames[3] = stringToTimeFrame(TimeFrame4);
alertsLevel = MathMin(MathMax(alertsLevel,3),4)。
IndicatorShortName(UniqueID)。
返回(0)。
}
int deinit()
{
for (int t=0; t<4; t++) ObjectDelete(UniqueID+t);
return(0);
}
//------------------------------------------------------------------
//
//------------------------------------------------------------------
//
//
//
//
//
double trend[][6];
#define _up 0
#define _dn 1
#define _hl1 2
#define _hl2 3
#define _hl3 4
#define _hl4 5
int start()
{
int i,r,count,counted_bars=IndicatorCounted()。
if(counted_bars < 0) return(-1);
如果(counted_bars>0) counted_bars--。
int limit = MathMin(Bars-counted_bars,Bars-1);
if (returnBars) { gosc1u[0] = limit+1; return(0); }
如果 (timeFrames[0] != Period()) limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrames[0],indicatorFileName, "returnBars",0,0)*timeFrames[0]/Period() )。
如果 (timeFrames[1] != Period()) limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrames[1],indicatorFileName, "returnBars",0,0)*timeFrames[1]/Period() )。
如果 (timeFrames[2] != Period()) limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrames[2],indicatorFileName, "returnBars",0,0)*timeFrames[2]/Period() )。
如果 (timeFrames[3] != Period()) limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrames[3],indicatorFileName, "returnBars",0,0)*timeFrames[3]/Period() )。
如果(ArrayRange(trend,0)!=Bars) ArrayResize(trend,Bars)。
//
//
//
//
//
bool initialized = false;
if (!initialized)
{
initialized = true。
int window = WindowFind(UniqueID);
for (int t=0; t<4; t++)
{
string label = timeFrameToString(timeFrames[t]);
ObjectCreate(UniqueID+t,OBJ_TEXT,window,0,0)。
ObjectSet(UniqueID+t,OBJPROP_COLOR,LabelsColor)。
ObjectSet(UniqueID+t,OBJPROP_PRICE1,t+LabelsVerticalShift)。
ObjectSetText(UniqueID+t,label,8, "Arial")。
}
}
for (t=0; t<4; t++) ObjectSet(UniqueID+t,OBJPROP_TIME1,Time[0]+Period()*LabelsHorizontalShift*60) 。
//
//
//
//
//
for(i = limit, r=Bars-i-1; i >= 0; i--, r++)
{
trend[r][_up] = 0;
trend[r][_dn] = 0;
trend[r][_hl1] = trend[r-1][_hl1]。
trend[r][_hl2] = trend[r-1][_hl2];
trend[r][_hl3] = trend[r-1][_hl3];
trend[r][_hl4] = trend[r-1][_hl4]。
for (int k=0; k<4; k++)
{
int y = iBarShift(NULL,timeFrames[k],Time);
double cciNow = iCCI(NULL, timeFrames[k], Period_CCI, PRICE_TYPICAL, y);
double cciPre = iCCI(NULL, timeFrames[k], Period_CCI, PRICE_TYPICAL, y+1);
如果(ciNow>cciPre) trend[r][k+2] = 1。
如果 (ciNow<cciPre) trend[r][k+2] = -1;
switch (k)
{
case 0 : if (trendy[r][k+2]==1) { gosc1u = k+1; gosc1d = EMPTY_VALUE;} else { gosc1d = k+1; gosc1u = EMPTY_VALUE; } break;
case 1 : if (trendy[r][k+2]==1) { gosc2u = k+1; gosc2d = EMPTY_VALUE;} else { gosc2d = k+1; gosc2u = EMPTY_VALUE; } break;
case 2 : if (trendy[r][k+2]==1) { gosc3u = k+1; gosc3d = EMPTY_VALUE;} else { gosc3d = k+1; gosc3u = EMPTY_VALUE; } break;
case 3 : if (trend[r][k+2]==1) { gosc4u = k+1; gosc4d = EMPTY_VALUE;} else { gosc4d = k+1; gosc4u = EMPTY_VALUE; } break;
}
如果(trendice[r][k+2]==1)
trend[r][_up] +=1。
否则 trend[r][_dn] += 1;
}
}
manageAlerts()。
return(0);
}
//+-------------------------------------------------------------------
//|
//+-------------------------------------------------------------------
//
//
//
//
//
空白管理提示()。
{
如果(alertsOn)
{
int whichBar = Bars-1;
如果(趋势[whichBar][_up] >= alertsLevel ||趋势[whichBar][_dn] >= alertsLevel)。
{
如果(trend[whichBar][_up] >= alertsLevel) doAlert("up" ,trend[whichBar][_up])。
如果(trendy[whichBar][_dn] >= alertsLevel) doAlert("down",trendy[whichBar][_dn])。
}
}
}
//
//
//
//
//
void doAlert(string doWhat, int howMany)
{
静态字符串previousAlert="无"。
static datetime previousTime;
字符串信息。
如果(previousAlert != doWhat || previousTime != Time[0]) {
previousAlert = doWhat;
previousTime = Time[0];
//
//
//
//
//
message = Symbol()+" at "+TimeToStr(TimeLocal(),TIME_SECONDS)+" "+howMany+" time frames of MA trends are aligned "+doWhat;
if (alertsMessage) Alert(message);
如果(alertsEmail)SendMail(Symbol()+" 4个时间框架的MA趋势",message)。
如果(alertsSound) PlaySound("alert2.wav")。
}
}
//-------------------------------------------------------------------
//
//-------------------------------------------------------------------
//
//
//
//
//
string sTfTable[] = {"M1", "M5", "M15", "M30", "H1", "H4", "D1", "W1", "MN" };
int iTfTable[] = {1,5,15,30,60,240,1440,10080,43200};
//
//
//
//
//
int toInt(double value) { return(value); }
int stringToTimeFrame(string tfs)
{
tfs = stringUpperCase(tfs);
int max = ArraySize(iTfTable)-1, add=0;
int nxt = (StringFind(tfs, "NEXT1")>-1); if (nxt>0) { tfs = ""+Period(); add=1; }
nxt = (StringFind(tfs, "NEXT2")>-1); if (nxt>0) { tfs = ""+Period(); add=2; }
nxt = (StringFind(tfs, "NEXT3")>-1); if (nxt>0) { tfs = ""+Period(); add=3; }
//
//
//
//
//
for (int i=max; i>=0; i--)
if (tfs==sTfTable || tfs==""+iTfTable) return(MathMax(iTfTable[toInt(MathMin(max,i+add))], Period())。
return(Period())。
}
string timeFrameToString(int tf)
{
for (int i=ArraySize(iTfTable)-1; i>=0; i--)
if (tf==iTfTable) return(sTfTable);
return("")。
}
//
//
//
//
//
stringUpperCase(string str)
{
string s = str;
for (int length=StringLen(str)-1; length>=0; length--)
{
int char = StringGetChar(s, length);
if((char > 96 && char 223 && char < 256))
s = StringSetChar(s, length, char - 32);
否则如果(char > -33 && char < 0)
s = StringSetChar(s, length, char + 224);
}
return(s);
}你好。
我还有一个问题,第一个问题我已经解决了,谢谢你,Mladen![](https://c.mql5.com/forextsd/smiles/smile.png)
我在这里找到了mladen的4个Cci,我非常喜欢它,我知道它是重绘的,但它对我来说仍然非常有效。
我想把这4个值放到另一个自制的指标中,但我就是找不到方法。
我试着用前一页中的bool线和4cci中的值来做,但它对我不起作用。
我想对于有经验的代码来说,有一个简单的解决方案,但我已经花了很多时间,却没有想出办法。
谢谢你的建议
鲍勃BobMorane1000
你为什么不简单地用iCCI() 调用来代替4次呢(即使从代码上看也会简单得多)?
你是对的,我会这样做的。
再次感谢
谁能帮我在这个随机的十字架上添加箭头?
[ATTACH]187655
嗨,我需要帮助。
我有一个很好的Trendindicatoe,它把蜡烛染成绿色并读出趋势。但它有一个错误:当改变时间框架时,它不能让颜色保持不变。但更糟糕的是,几乎看不到假发,我无法改变这一点。
谁能看一下?
非常感谢。我附上该指标