修復 MT4 EA 中的數組超出範圍錯誤 - Page 2
2 頁面的第 562 頁 FirstFirst 12
Results 11 to 13 of 13

Thread: 修復 MT4 EA 中的數組超出範圍錯誤

  1. #11

    Quote Originally Posted by ;
    我用以下內容製作了一個 EA... extern int IntIndTF1 = 4;外部 int IntInd1S1 = 2;外部 int IntInd1S2 = 14;外部 int IntIndTF2 = 1;外部 int IntInd2S1 = 3;外部 int IntInd2S2 = 9; PerH1 = High[iHighest(SymbolToManage,IntIndTF1,MODE_HIGH,IntInd1S2,IntInd1S1)]; PerL1 = Low[iLowest(SymbolToManage,IntIndTF1,MODE_LOW,IntInd1S2,IntInd1S1)]; PerM1 = NormalizeDouble((PerH1 PerL1)/2,Digits); PerH2 = High[iHighest(SymbolToManage,IntIndTF2,MODE_HIGH,IntInd2S2,IntInd2S1)]; PerL2 = Low[iLowest(SymbolToManage,IntIndTF2,MODE_LOW,IntInd2S2,IntInd2S1)];...
    首先嘗試修復您的 for 循環,在第二個代碼塊中,循環永遠不會運行,因此不會發生錯誤:i=0 但檢查 igt;Bars。隨著 i 遞減應該是: for(int i=Bars-IndicatorCounted()-1;igt;0;i#8212

  2. #12

    Quote Originally Posted by ;
    {quote} 首先嘗試修復你的 for 循環,在第二個代碼塊中,循環永遠不會運行,因此不會發生錯誤:i=0 但檢查 igt;Bars。隨著 i 遞減應該是:for(int i=Bars-IndicatorCounted()-1;igt;0;i—)
    代碼僅在 ea 內,不是指標,IndicatorCounted() 是否仍可在 ea 內工作?

  3. #13

    Quote Originally Posted by ;
    我將 -1 添加到限制條數中,它似乎可以在不影響結果的任何更改的情況下工作,所以這很好。為了確保 iLowest/iHigheset 不返回 -1 我這樣做了,很確定這不是正確的方式 b/c 結果很糟糕... int BarsCounted1 = TFBars1-MathMax(IntInd1S2,IntInd1S1 1); if (BarsCounted1 lt; 0) {return;} int LimitBars1 = TFBars1-BarsCounted1; for (BarCount1 = LimitBars1-1; BarCount1 gt;= 0; BarCount1--) { if ((iHighest(SymbolToManage,IntIndTF1,MODE_HIGH,IntInd1S2,BarCount1 IntInd1S1) lt; 0) || (iLowest(SymbolToManage,IntIndTF1,MODE_LOW ,IntInd1S2,BarCount1 IntInd1S1)...
    我在想這樣的插入代碼 for(int i=(IndicatorCounted()==0)?Bars(symbol,tf)-1-MathMax(IntInd1S2,IntInd1S1 1):1;igt;0;i#8212; ){ int hi=iHighest(symbol,tf,mode,IntInd1S2,i); if(hi!=-1)PerH1=High#91;hi#93;;否則 PerH1=-1; int lo=iLowest(...); if(lo!=-1)PerL1=Low#91;lo#93;;否則 PerL1=-1;}

發布權限

  • 您不可發布新主題
  • 您不可回复
  • 您不可發布附件
  • 您不可編輯您的帖子
  •  
  • BB代碼是打開的
  • 表情符號是打開的
  • [IMG]代碼是打開的
  • [視頻]代碼是打開的
  • HTML代碼是關閉的
forex-pedia網站使用cookie 文字跟蹤
forex-pedia.com網站使用cookie 文字跟蹤,某些設定已經固定。您可以點擊此處閱讀我們的Cookie使用說明。 請點擊右鍵接受我們的cookies。如果您選擇繼續使用forex-pedia.com網站,我們將認為您接受我們的cookies。