problem closed - thanks for help:)
Please use this to post code . . . it makes it easier to read.

for ( int i = ( OrdersTotal () - 1 ) ; i > = 0 ; i - ) //ZAZNACZAM OSTATNIE ZLECENIE should be for ( int i = OrdersTotal () - 1 ; i >= 0 ; i-- ) //ZAZNACZAM OSTATNIE ZLECENIE
I can't/won't read your code, use some indenting . . . please.
if (!OrderSelect ( i, SELECT_BY_POS, MODE_TRADES ) && OrderOpenPrice >= Oprice ) should be if (!OrderSelect ( i, SELECT_BY_POS, MODE_TRADES ) && OrderOpenPrice() >= Oprice )
You need an extra } above return(0);
Indent your code and you can find your errors yourself. . .