如何将指标代码添加到 expertadvisor 代码中? - 页 5

 

我可以发帖。

但请帮助我完成我的项目

好吗?

 

我的项目 只是一个MA程序,并试图在其中加入人字形。

 
albert_lim83:

我可以发帖。

但请帮助我完成我的项目。

好吗?

我不做任何承诺,但当这一切完成后,你应该对RaptorUK说声谢谢,他帮助了你这么久:)
 
albert_lim83:

我可以发帖。

但请帮助我完成我的项目。

好吗?

如果没有看到你的完整代码,很难告诉你是什么原因造成的 . . . "ExistPositions - 全局范围的表达式不允许" 如果你不想发布你的完整代码,那就不要发布,但如果我们能看到问题,而不是猜测,你会得到更准确的建议,这意味着每个人的工作会减少。
 
你为什么不把它附上呢 :)
 

到目前为止,我从1970年到今天进行了回测

结果是烧毁了账户。

 

好的......一些评论......。

      for(shift=Bars-1; shift>=0; shift--)   //  <-----  this loop does nothing at all ! !

      double ZigZagHigh=iCustom(NULL,0,"ZigZag",MODE_HIGH,0);
      double ZigZagLow=iCustom(NULL,0,"ZigZag",MODE_LOW,0);    
      double LowestBar=Low[Lowest(NULL,0,MODE_LOW,ExtDepth,sh

. . .

   bool a=false, b=false;                                  //  Note:  b is a bool . . .
   int shift, BlueArrowIndex, RedArrowIndex, Index = 0;
   double zag, zig; b=0; 
   
   while(a<2) 
      {
      if(zig>0) zag=zig;
      zig=iCustom(NULL, 0, "ZigZag", 0, b);
      if(zig>0) a+=1;
      b++;                                                 //  how can you increment a bool ??

. . .

      if(AccountFreeMargin()<(SafetyPercent/100)*AccountBalance())
         {
         Print("We have no money. Free Margin = ", AccountFreeMargin());
         return(0);
         }
      }
   }                             //  <-----  this is the closing brace of start()
  
 if (!ExistPositions()){         // <-----  so this give this error  'ExistPositions' - expression on global scope not allowed

      if(diClose0<diMA1 && (ZigZagLow) )
      {
         OpenBuy();
         return(0);
 
if(zig>0) {a += 1; b += 1;}

把这一步骤提高

    
    
    

  // <<=== ... here                   
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
if(!ExistPositions())  // <<<==== This goes one step up ....
  {

   if(diClose0<diMA1 && (ZigZagLow))
     {
      OpenBuy();
      return(0);
     }
   else //
     {
      if(diClose2>diMA3 && (ZigZagHigh))
        {
         OpenSell();
         return(0);
        }
     }

  }
 

我想修改 escape ea。

所以我就用了里面的所有代码。

 
albert_lim83:

我想修改 escape ea。

所以我就用了里面的所有代码。

你需要了解你在做什么,如果你想让它工作的话......你不能只是复制和粘贴这里和那里。.你需要学习。