実現したいこと
・コンパイルエラーを解決して、自作インジケーターを使用したい
前提
MQL4で初めてコードを書いた初心者です。
一通りコードを書いて、コンパイルしたのですが、コンパイルエラーが5箇所表示されました。
ネットで調べて、該当しそうな対処方法を行いましたが、コンパイルエラー表示が消えません。
発生している問題・エラーメッセージ
')' - unexpected end of program Ichimoku_Cross.mq4 54 96 '{' - unbalanced parentheses Ichimoku_Cross.mq4 38 13 OnCalculate function not found in custom indicator 1 1 'Shift' - function not defined Ichimoku_Cross.mq4 31 25 'Shift' - function not defined Ichimoku_Cross.mq4 32 25
該当のソースコード
MQL4
1//+------------------------------------------------------------------+ 2//| Ichimoku_Cross.mq4 | 3//| WordBox | 4//| | 5//+------------------------------------------------------------------+ 6#property indicator_chart_window 7#property indicator_buffers 2 8#property indicator_color1 DodgerBlue 9#property indicator_color2 Red 10 11input int ArrowUpColor = DodgerBlue; 12input int ArrowDnColor = Red; 13 14double ichimoku_tenkan[ ]; 15double ichimoku_kijun[ ]; 16double ichimoku_senkouA[ ]; 17double ichimoku_senkouB[ ]; 18double ichimoku_chikou[ ]; 19 20double arrowUpBuffer[ ]; 21double arrowDnBuffer[ ]; 22 23int init() { 24 SetIndexBuffer(0, arrowUpBuffer, INDICATOR_DATA); 25 SetIndexBuffer(1, arrowDnBuffer, INDICATOR_DATA); 26 SetIndexStyle(0, DRAW_ARROW, EMPTY, 3); 27 SetIndexArrow(0, 233); 28 SetIndexStyle(1, DRAW_ARROW, EMPTY, 3); 29 SetIndexArrow(1, 234); 30 IndicatorShortName("Ichimoku with Arrows"); 31 SetIndexDrawBegin(0, Shift()+2); 32 SetIndexDrawBegin(1, Shift()+2); 33 SetIndexEmptyValue(0, 0.0); 34 SetIndexEmptyValue(1, 0.0); 35 return(0); 36} 37 38int start() { 39 int limit = Bars - IndicatorCounted(); 40 for(int i = limit; i >= 0; i--) { 41 ichimoku_tenkan[i] = iCustom(_Symbol, 0, "Ichimoku", 9, 26, 52, 1, 1, i); 42 ichimoku_kijun[i] = iCustom(_Symbol, 0, "Ichimoku", 9, 26, 52, 1, 1, i); 43 ichimoku_senkouA[i] = iCustom(_Symbol, 0, "Ichimoku", 9, 26, 52, 1, 1, i); 44 ichimoku_senkouB[i] = iCustom(_Symbol, 0, "Ichimoku", 9, 26, 52, 1, 2, i); 45 ichimoku_chikou[i] = iCustom(_Symbol, 0, "Ichimoku", 9, 26, 52, 1, 3, i); 46 47 if(ichimoku_chikou[i] > iClose(NULL, 0, i) && ichimoku_chikou[i-1] <= iClose(NULL, 0, i-1) && ichimoku_tenkan[i] < ichimoku_kijun[i] && ichimoku_tenkan[i-1] >= ichimoku_kijun[i-1]) { 48 arrowUpBuffer[i] = iHigh(NULL, 0, i); 49 arrowDnBuffer[i] = 0.0; 50 SetIndexArrow(0, 233); 51 SetIndexBuffer(0, arrowUpBuffer); 52 PlotIndexSetString(0, PLOT_ARROW, "<---"); 53 PlotIndexSetInteger(0, PLOT_ARROW, ArrowUpColor); 54 } else if(ichimoku_chikou[i] < iClose(NULL, 0, i) && ichimoku_chikou[i-1] >= iClose(NULL,) 55 56
>ネットで調べて、該当しそうな対処方法を行いました
行った対処方法を、質問文を編集して、ご提示ください。
