unbalanced parantheses - page 4

 
FAQ:
The editor has nothing to do with it. It's a problem with your Windows. Try installing additional languages, although this does not always help.

Russian is installed. In Word, for example, I can write in Russian. In MetaTrader, I cannot.
 
liana:

Fixed it - still something is wrong.
Could someone please just write me how it would be correct to call these two Kim functions and if there are no orders, to open an order.

int ticket;
int magic=576;

int start()
{ 
//----
    if (!ExistOrders (Symbol(), -1, magic))
    {ticket=OrderSend(Symbol(),OP_SELL,0,1,Bid,3,Bid+20*Point,Bid-40*Point,"",magic,0,Red);}
//----
   return(0);
}
//+----------------------------------------------------------------------------+
//|  Exist Orders. alya aka KimIV,  http://www.kimiv.ru                        |
//+----------------------------------------------------------------------------+
bool ExistOrders(string sy="", int op=-1, int mn=-1, datetime ot=0) {
  int i, k=OrdersTotal(), ty;
 
  if (sy=="0") sy=Symbol();
  for (i=k-1; i>=0; i--) {
    if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
      ty=OrderType();
      if (ty>=0 && ty < 6) {
        if ((OrderSymbol()==sy || sy=="") && (op<0 || ty==op)) {
          if (mn<0 || OrderMagicNumber()==mn) {
            if (ot<=OrderOpenTime()) return(True);
          }
        }
      }
    }
  }
  return(False);
}
I understand you are checking for both market and pending orders on a particular Magik!
 
valenok2003:

view -> languages

Man, the girl is not in ruzon, and therefore she has euro windows, not vents :)
 
liana:

Russian is installed . For example in Word I can write in Russian. In MetaTrader it is not.

You can write in Word because it supports Unicode, but MetaEditor does not.
 
valenok2003:

try
view -> languages

Since you are communicating on this forum, your computer supports the encoding.

UFFFFF Guys, well I'm a dummy in MQL4, but I'm not a moron. Of course I enabled the language.
 
liana:


Don't worry about it, the Russian letters are just comments, they start with //
 
Try copying into an editor that supports Unicode first and then save in vin1251 or ISO. try it with Notpad+.
 
TarasBY:
I take it you are checking for both market and pending orders on a particular Magik?!
Yes, that's right.
But that's how we check only pending ones, isn't it?
Kim's function checks only pending orders and the other one (see my code) checks open positions. That's why I use two functions to check both of them (you can use magik too)
 
liana:
Yes, it is.
But we only check the pending ones that way, don't we?

Is that what you think or do you know?

P.S. I tweaked Kim's function.

 
TarasBY:

Is that what you think or do you know for sure???

P.S. I have tweaked Kim's function.


What if I need both later for checking?

If I need to keep them as they are?