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!
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)
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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.
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.
view -> languages
Man, the girl is not in ruzon, and therefore she has euro windows, not vents :)
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.
try
view -> languages
Since you are communicating on this forum, your computer supports the encoding.
Don't worry about it, the Russian letters are just comments, they start with //
I take it you are checking for both market and pending orders on a particular Magik?!
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)
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.
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?