编码帮助 - 页 754

 
1225113:
谢谢你的意见。有更多的需求,这个指标(附件)可以在EA中关闭所有未结订单和挂单吗?

如果你的意思是一个指标可以处理订单,它不能 ...

如果你的意思是该指标的值可以用于此,那么,是的,它们可以。你必须使用一些逻辑来使用你的指标值,然后将该逻辑纳入你的EA中。但仅仅堆积指标是没有用的。定义你的严格规则,然后使用这些规则。


第三个问题:该指标会重绘。如果你试图从EA(任何EA)中使用它,你很快就会发现,试图从EA中使用该指标来获得任何形式的信号都是无用的。
 

能否为这两个指标增加一个警报?

谢谢

团队投资者(TEAMTRADER

附加的文件:
 

嗨。

我使用MT5。

我需要一个显示增量评论的函数,使用FIFO

showcomment("EA开始")。

showcomment ("buy at xxxx") ;

showcomment ("sell close at xxxx") ;

等等......等等。

showcomment ("EA Finished at 23:00")。

 
baraozemo:

嗨。

我使用MT5。

我需要一个显示增量评论的函数,使用FIFO

showcomment("EA开始")。

showcomment ("buy at xxxx") ;

showcomment ("sell close at xxxx") ;

等等......等等。

showcomment ("EA Finished at 23:00")。

试试这样的方法。

#define _maxLinesInComment 20
string _commentLines[_maxLinesInComment];
void incrementalComment(string line)
{
   static int linesCount=0;
      if (linesCount==_maxLinesInComment) for (int i=0; i<linesCount-1; i++) _commentLines[i]=_commentLines[i+1];
                                                                             _commentLines[MathMin(linesCount,_maxLinesInComment-1)] = line; linesCount=MathMin(linesCount+1,_maxLinesInComment-1);
   string comment = ""; for (int i=0; i<linesCount; i++) comment += _commentLines[i]+"\n";
   Comment(comment);                                                    
}
 
mladen:

试试这样的方法:

#define _maxLinesInComment 20
string _commentLines[_maxLinesInComment];
void incrementalComment(string line)
{
   static int linesCount=0;
      if (linesCount==_maxLinesInComment) for (int i=0; i<linesCount-1; i++) _commentLines[i]=_commentLines[i+1];
                                                                             _commentLines[MathMin(linesCount,_maxLinesInComment-1)] = line; linesCount=MathMin(linesCount+1,_maxLinesInComment-1);
   string comment = ""; for (int i=0; i<linesCount; i++) comment += _commentLines[i]+"\n";
   Comment(comment);                                                    
}

Mladen 谢谢你的回答。

填充20行后,代码没有 "向上滚动 "注释...
最老的一行注释应该被删除,以进入新的注释。

 
baraozemo:

Mladen 谢谢你的回答。

填完20行后,代码没有 "滚动 "注释......。
最早的一行注释应该被删除,以进入新的注释。

试试这个。

#define _maxLinesInComment 20
string _commentLines[_maxLinesInComment];
void incrementalComment(string line)
{
   static int linesCount=0;
      if (linesCount==_maxLinesInComment-1) for (int i=0; i<_maxLinesInComment-1; i++) _commentLines[i]=_commentLines[i+1];
                                                                                       _commentLines[linesCount] = line; linesCount=MathMin(linesCount+1,_maxLinesInComment-1);
   string comment = ""; for (int i=0; i<linesCount; i++) comment += _commentLines[i]+"\n";
   Comment(comment);                                                    
}
 
谢谢,效果很好
 
mladen:

试试这个。

#define _maxLinesInComment 20
string _commentLines[_maxLinesInComment];
void incrementalComment(string line)
{
   static int linesCount=0;
      if (linesCount==_maxLinesInComment-1) for (int i=0; i<_maxLinesInComment-1; i++) _commentLines[i]=_commentLines[i+1];
                                                                                       _commentLines[linesCount] = line; linesCount=MathMin(linesCount+1,_maxLinesInComment-1);
   string comment = ""; for (int i=0; i<linesCount; i++) comment += _commentLines[i]+"\n";
   Comment(comment);                                                    
}

亲爱的@mladen,

如果可能的话,你能不能在所有方框都是绿色或红色的时候给附件中的趋势指标添加一个警报?

附加的文件:
 
mladen:

如果你的意思是一个指标可以处理订单,它不能 ...

如果你的意思是该指标的值可以用于此,那么,是的,它们可以。你必须使用一些逻辑来使用你的指标值,然后将该逻辑纳入你的EA中。但仅仅堆积指标是没有用的。确定你的严格规则,然后使用这些规则。


第三点:该指标会重绘。如果你试图从EA(任何EA)中使用它,你很快就会发现,试图从EA中使用该指标来获得任何形式的信号都是无用的。
亲爱的mladen。
我非常同意你的观点,如果应用于其他EA的信号,但我只用于手动交易,而平仓单要戴上EA...我需要HH或LL来平仓单,不管我的想法是什么?...或者你有更好的EA,因为我想推荐给我,你能告诉我吗?

谢谢您的关注
 
1225113:
亲爱的mladen。
我非常同意你的观点,如果应用于其他EA的信号,但我只用于手动交易,而平仓单要穿EA...我需要HH或LL来平仓,不管我的想法是什么?...或者你有更好的EA,因为我想推荐给我,你能告诉我吗?

谢谢您的关注

您的原始问题是:

1225113:
谢谢你的意见。有一个更多的需求,这个指标(附件)可以在EA中 关闭所有未结订单和挂单吗?
回答是关于这一点的。在任何情况下,如果你是手动交易,那么就没有必要改变任何东西(甚至是重绘指标)。
原因: