زى كده

[/php]
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++)
{
//---- ma_shift set to 0 because SetIndexShift called abowe
double hz = iCustom (Symbol(),PERIOD_M5,"ZigZag",12,5,3,1,i );

double lz = iCustom (Symbol(),PERIOD_M5,"ZigZag",12,5,3,2,i );
[php]