ИванМН
Местный знаток
Вот чёрт! Как он смеет не заполнять, мерзавец???
C-подобный:
//+------------------------------------------------------------------+
char GetSARDirection(int bar)
{
char s;
if (iSAR(_Symbol,PERIOD_CURRENT,0.02,0.2,bar + 1) > Open[bar + 1] && iSAR(_Symbol,PERIOD_CURRENT,0.02,0.2,bar) < Open[bar])
s = 1;
else
if (iSAR(_Symbol,PERIOD_CURRENT,0.02,0.2,bar + 1) < Open[bar + 1] && iSAR(_Symbol,PERIOD_CURRENT,0.02,0.2,bar) > Open[bar])
s = -1;
return(s);
}
//+------------------------------------------------------------------+
void PereborSar()
{
uchar b,s;
for(int i = 0; i < 61; i++)
{
char SAR = GetSARDirection(i);
switch (SAR)
{
case 1:
BarIndexBuy[b] = i;
b++;
break;
case -1:
BarIndexSell[s] = i;
s++;
}
if (b == 3 && s == 3) break;
}
}