07/11/23 17:23:38.72 Bg54hq2u
このようなもの作ったのですが、メールが大量に送られてくるのです
どのように直せばよいか、アドバイスお願いします
int start()
{
int limit, i, counter;
double fasterLWMAnow, slowerLWMAnow, fasterLWMAprevious, slowerLWMAprevious, fasterLWMAafter, slowerLWMAafter;
double Range, AvgRange;
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;
for(i = 0; i <= limit; i++) {
counter=i;
Range=0;
AvgRange=0;
for (counter=i ;counter<=i+9;counter++) {
AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);
}
Range=AvgRange/10;
fasterLWMAnow = iMA(NULL, 0, 13, 0, MODE_LWMA, PRICE_CLOSE, i);
fasterLWMAprevious = iMA(NULL, 0, 13, 0, MODE_LWMA, PRICE_CLOSE, i+1);
fasterLWMAafter = iMA(NULL, 0, 13, 0, MODE_LWMA, PRICE_CLOSE, i-1);
slowerLWMAnow = iMA(NULL, 0, 21, 0, MODE_LWMA, PRICE_CLOSE, i);
slowerLWMAprevious = iMA(NULL, 0, 21, 0, MODE_LWMA, PRICE_CLOSE, i+1);
slowerLWMAafter = iMA(NULL, 0, 21, 0, MODE_LWMA, PRICE_CLOSE, i-1);
if ((fasterLWMAnow > slowerLWMAnow) && (fasterLWMAprevious < slowerLWMAprevious) && (fasterLWMAafter > slowerLWMAafter)) {
CrossUp[i] = Low[i] - Range*0.5;
Alert(Symbol(), " hit ");
SendMail("Mail Alert", Symbol()+" hitdesu ");
}
}
return(0);