アプリ版:「スタンプのみでお礼する」機能のリリースについて

下の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);
}

A 回答 (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
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!