[警告关闭!]任何新手问题,为了不给论坛添乱。专业人士,不要走过。没有你,哪里都不能去。 - 页 703

 
我已经写过了,我意识到字符串不起作用,但它怎么办?
 
Infinity:
我已经写过了,我意识到字符串不起作用,但怎么办呢?
使用if语句
 
OneDepo:
使用if语句

我一开始也是这么想的,我只是想让代码更短))))),太多的ifs我会得到)
 
odiseif:
SetIndexStyle(0, DRAW_NONE); SetIndexStyle(1, DRAW_LINE,EMPTY); SetIndexStyle(2, DRAW_NONE); SetIndexStyle(3, DRAW_NONE); SetIndexStyle(4, DRAW_NONE); 这里是 .......我想把线宽设为0,但我不想费心设置 ...... 我不知道怎么做 .... 我不是程序员 .... 帮助我 ))))





奥德赛,有两个选择。首先,在指标代码的最开始,将这一行的末尾的数字,改为所需的厚度。

#property  indicator_width1  1

或者通过 方法 SetIndexStyle()

SetIndexStyle(1, DRAW_LINE, EMPTY, 2); 

线条厚度,在这种方法中,是第四个参数。

 
ToLik_SRGV:

奥德赛,有两个选择。首先,在指标代码的最开始,将这一行的末尾的数字,改为所需的厚度。

或者通过 方法 SetIndexStyle()

在这种方法中,线的厚度是第四个参数。

 IndicatorBuffers(7);
   SetIndexBuffer(0, MACDBuffer);
   SetIndexBuffer(1, SignalBuffer);
   SetIndexBuffer(2, FastEMABuffer);
   SetIndexBuffer(3, SlowEMABuffer);
   SetIndexBuffer(4, SignalEMABuffer);
   SetIndexBuffer(5, Buffer1);
   SetIndexBuffer(6, Buffer2);
   SetIndexStyle(0, DRAW_NONE);
   SetIndexStyle(1, EMPTY);
   SetIndexStyle(2, DRAW_NONE );
   SetIndexStyle(3, DRAW_NONE );
   SetIndexStyle(4, DRAW_NONE);
   SetIndexStyle(5, DRAW_HISTOGRAM);
   SetIndexStyle(6, DRAW_HISTOGRAM);
   SetIndexDrawBegin(0, SlowEMA);
   SetIndexDrawBegin(1, SlowEMA);
这里有一段代码......我在教程中找到了它,但不明白....,我应该改变它还是粘贴它?
 
Poushkine:

我根本不知道什么是编程。我想让CCI过滤器(https://www.forex-tsd.com/indicators-metatrader-4/3356-cci-filter.html)与WPR相同,将CCI改为WPR,并改变条形图着色条件中的水平(不是像CCI那样的-100、0、100,而是-60、-50和-40,因为在MT中WPR的范围是-100到0,我想,对吗)。但由于某些原因,它在编译时出现了错误,屏幕上显示了一个单色的指示器。有什么问题吗?预先感谢

我不完全明白你到底改了什么,因为你必须在你提供的地址注册,才能看到CCI 过滤器 源代码。
只发现一个错误,iWPR 没有applied_price 参数,所以这个是正确的。

WPR0=iWPR(NULL,0,PeriodWPR,shift);
 
odiseif:
这里有一段代码......我在教程中找到了它,但我想不出来....,我应该改变它还是粘贴它?

在代码的开头不是有这样一行吗。

#property  indicator_width1  1

如果没有,那就试试这个。

SetIndexStyle(5, DRAW_HISTOGRAM, EMPTY, 2);
SetIndexStyle(6, DRAW_HISTOGRAM, EMPTY, 2);
 

还有奥德修斯,在前面的例子中,你是这样的。

SetIndexStyle(0, DRAW_NONE);
SetIndexStyle(1, DRAW_LINE,EMPTY);
SetIndexStyle(2, DRAW_NONE);
SetIndexStyle(3, DRAW_NONE);
SetIndexStyle(4, DRAW_NONE);

而现在是这样的。

SetIndexStyle(0, DRAW_NONE);
SetIndexStyle(1, EMPTY);
SetIndexStyle(2, DRAW_NONE );
你没有删除任何东西,还是我在幻想?
 
ToLik_SRGV:

在代码的开头不是有这样一行吗。

如果没有,那就试试这个。

没有这样的线。
#property  indicator_width1  1

 

我把它改成了这样,但它没有正常工作......直方图在终端中以新的参数变化,但当我在图表上拉出一个新的指标时,它显示的参数和以前一样......。


 IndicatorBuffers(7);
   SetIndexBuffer(0, MACDBuffer);
   SetIndexBuffer(1, SignalBuffer);
   SetIndexBuffer(2, FastEMABuffer);
   SetIndexBuffer(3, SlowEMABuffer);
   SetIndexBuffer(4, SignalEMABuffer);
   SetIndexBuffer(5, Buffer1);
   SetIndexBuffer(6, Buffer2);
   SetIndexStyle(0, DRAW_NONE);
   SetIndexStyle(1, DRAW_LINE,EMPTY);
  SetIndexStyle(2, DRAW_LINE,EMPTY,2 );
   SetIndexStyle(3, DRAW_NONE,EMPTY,2);
   SetIndexStyle(4, DRAW_NONE);
   SetIndexStyle(5, DRAW_HISTOGRAM,EMPTY, 2);
   SetIndexStyle(6, DRAW_HISTOGRAM,EMPTY, 2);
   SetIndexDrawBegin(0, SlowEMA);
   SetIndexDrawBegin(1, SlowEMA);
   IndicatorShortName("ZeroLag MACD Colored(" + FastEMA + "," + SlowEMA + "," + SignalEMA + ")");
   SetIndexLabel(0, "MACD");
   SetIndexLabel(1, "Signal");
   SetIndexLabel(5, "MACD");
   SetIndexLabel(6, "MACD");
原因: