حل التمرين السابق
الطريقة 1
[PHP]
int start()
{
int x,i;
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
x=Bars-counted_bars;
for(i =0 ; i<x ; i++)
{
//من اجل الشمعة 0
double open0=Open[i];
double close0=Close[i];
double high0=High[i];
double low0=Low[i];
//من اجل الشمعة 1
double open1=Open[i+1];
double close1=Close[i+1];
double high1=High[i+1];
double low1=Low[i+1];
}
return(0);
}
[/PHP]
الطريقة 2
[PHP]
int start()
{
int x,i;
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
x=Bars-counted_bars;
for(i =0 ; i<x ; i++)
{
//من اجل الشمعة 0
double open0=iOpen(0,0,i);
double close0=iClose(0,0,i);
double high0=iHigh(0,0,i);
double low0=iLow(0,0,i);
//من اجل الشمعة 1
double open1=iOpen(0,0,i+1);
double close1=iClose(0,0,i+1);
double high1=iHigh(0,0,i+1);
double low1=iLow(0,0,i+1);
}
return(0);
}
[/PHP]