下の4箇所がコンパイルエラー箇所です。
'iCCI' - wrong parameters count
'iRSI' - wrong parameters count
'iCustom' - wrong parameters count
'iCustom' - wrong parameters count
ここからコード
//---- property
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Magenta
#property indicator_color2 Aqua
//---- input parameters
extern int CCIPeriod = 14;
extern int RSIPeriod = 14;
extern bool Alerts =true;
//---- indicator buffers
double CCI[];
double RSI[];
double BuyArrow[];
double SellArrow[];
//---- indicator parameters
int CCI_Handle;
int RSI_Handle;
//---- initialization function
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,CCI);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,RSI);
SetIndexStyle(2,DRAW_ARROW);
SetIndexArrow(2,159);
SetIndexBuffer(2,BuyArrow);
SetIndexStyle(3,DRAW_ARROW);
SetIndexArrow(3,159);
SetIndexBuffer(3,SellArrow);
//---- indicator handles
CCI_Handle = iCCI(NULL,0,CCIPeriod,PRICE_TYPICAL);
RSI_Handle = iRSI(NULL,0,RSIPeriod,PRICE_CLOSE);
//----
return(0);
}
//---- deinitialization function
int deinit()
{
//----
//----
return(0);
}
//---- calculation function
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//---- main loop
for(int i=0; i<limit; i++)
{
//---- get CCI and RSI values
CCI[i] = iCustom(NULL,0,CCI_Handle,i);
RSI[i] = iCustom(NULL,0,RSI_Handle,i);
//---- check for buy signal
if(CCI[i]<90 && CCI[i+1]>90 && RSI[i]<85 && RSI[i+1]>85)
{
BuyArrow[i] = Low[i]-10*Point; // draw buy arrow below low price
if(Alerts) Alert("Buy signal at bar ",i); // send alert message
}
//---- check for sell signal
if(CCI[i]>-90 && CCI[i+1]<-90 && RSI[i]>15 && RSI[i+1]<15)
{
SellArrow[i] = High[i]+10*Point; // draw sell arrow above high price
if(Alerts) Alert("Sell signal at bar ",i); // send alert message
}
}
//----
return(0);
}
No.1ベストアンサー
- 回答日時:
パラメーターの数が足りないからです。
ちゃんとリファレンス・マニュアルを読みましょう。double iCCI(
string symbol, // symbol
int timeframe, // timeframe
int period, // averaging period
int applied_price, // applied price
int shift // shift
);
shift [in] Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
iCCI(NULL,0,CCIPeriod,PRICE_TYPICAL,1)
に
以下同様
https://docs.mql4.com/indicators/icci
お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!
似たような質問が見つかりました
- C言語・C++・C# バイナリファイルをコピーするのにかかる時間を測りたいのですが実行するとFatel error:gli 2 2022/11/03 01:10
- C言語・C++・C# プログラミングの授業の課題です 1 2023/01/17 22:15
- C言語・C++・C# C言語のエラーについて 2 2022/07/11 13:56
- C言語・C++・C# プログラミング c言語 4 2023/03/07 01:05
- C言語・C++・C# c言語の問題の説明、各所ごとに 5 2023/07/26 11:03
- C言語・C++・C# c言語の問題です 3 2023/01/10 16:15
- C言語・C++・C# C言語 3 2022/11/09 13:27
- C言語・C++・C# C 言語の Gauss Jordan 法について 2 2022/12/28 11:16
- Ruby 【JAVA】数字をひし形に出力するプログラムについて 2 2022/07/11 23:32
- C言語・C++・C# C言語でif文が予想と違う動きをする件について7 4 2023/03/20 00:26
関連するカテゴリからQ&Aを探す
おすすめ情報
デイリーランキングこのカテゴリの人気デイリーQ&Aランキング
-
こんなに円安が進行しているの...
-
円安はどこまで進むと思います...
-
ブビンガを始めとしたバイナリ...
-
詐欺に合いそうになりました。
-
今、円安ですけど なんで韓国と...
-
もしトランプ大統領になったら...
-
政府、日銀による為替介入のせ...
-
fxの確定申告について 僕は3年...
-
米国が利下げし、日本が利上げ...
-
追加証拠金
-
為替 トランプが再選したらドル...
-
トランプ氏が大統領に当選した...
-
マイナス金利を解除すると円安...
-
LINEグループのFX詐欺(疑い)...
-
一時払いドル建て定期預金をし...
-
ハイローオーストラリアで稼ぎ...
-
FX エントリーするとレンジにな...
-
円が1ドル100円くらいに戻る事...
-
投資に詳しい方に質問です。僕...
-
生命保険会社勤務の場合、FXを...
マンスリーランキングこのカテゴリの人気マンスリーQ&Aランキング
-
2回戦止まりは2回戦は勝ってい...
-
mql4のコンパイルエラー箇所の...
-
MT4で時間を指定するにはどのよ...
-
MT4のEAで通貨ペア毎に最...
-
トレーディングストップは利用...
-
MT4におけるトレーリングス...
-
【FX】MT4にてプログラムを作成...
-
FXの自動売買で大儲けした人...
-
FX 最近、エントリーチャンス少...
-
MT4で取引時間を指定する。
-
MT4の売買シグナルをメール受信...
-
MT4 ボリンジャーバンドタッチ...
-
ポジションを同時に2個持つの...
-
2回目のエントリーで時間通りに...
-
メタトレーダ4で自動売買をした...
-
豊島久道著「FXメタトレーダ...
-
MT4によるバックテストの信頼性...
-
メタトレーダーでCloseがある値...
-
Tera Termが途中で切れるのです...
-
為替データをエクセルにダウン...
おすすめ情報