Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 395

 
    if(B_1 > B_2 && B_1 > B_3)
    {
    Key = Buy_Key;
    }
Is that part of the code wrong?
 
Link_x:
Is this part of the code wrong?


You complained that you cannot use functions from Igor Kim.

This part of the code is not wrong, but you can make it work an order of magnitude faster. But this does not concern your problem.

 
That's right.
I still can't understand the use of this code:
//+----------------------------------------------------------------------------+
//|  Автор    : Ким Игорь В. aka KimIV,  http://www.kimiv.ru                   |
//+----------------------------------------------------------------------------+
//|  Версия   : 19.02.2008                                                     |
//|  Описание : Возвращает тип последней открытой позиции или -1               |
//+----------------------------------------------------------------------------+
//|  Параметры:                                                                |
//|    sy - наименование инструмента   (""   - любой символ,                   |
//|                                     NULL - текущий символ)                 |
//|    mn - MagicNumber                (-1   - любой магик)                    |
//+----------------------------------------------------------------------------+
int GetTypeLastOpenPos(string sy="", int mn=-1) {
  datetime t;
  int      i, k=OrdersTotal(), r=-1;

  if (sy=="0") sy=Symbol();
  for (i=0; i<k; i++) {
    if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
      if ((OrderSymbol()==sy || sy=="") && (mn<0 || OrderMagicNumber()==mn)) {
        if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
          if (t<OrderOpenTime()) {
            t=OrderOpenTime();
            r=OrderType();
          }
        }
      }
    }
  }
  return(r);
}
.
 
Link_x:
That's right.
Still can't understand the use of this code:
.

How are you trying to use it? Give me the code.
 
Link_x:
That's right.
Still can't understand the use of this code:
.
You don't know how functions are used in general or you don't understand this function in particular?
 
I opened a demo account $ 5000, lost 950, have a balance of $ 4050, but can not open orders (Dice and Buy) do not function What do I do?
 
    Buy_Key = 1;
    Sell_Key = -1;
    Null = 0;
    if() //В это место вставляется функция, которая определяет ордера Buy.
    {
    Key = Sell_Key;
    }
    if() // В это место вставляется функция, которая определяет ордера Sell.
    {
    Key = Buy_Key;
    }
    //+----------------------------------------------------------------+
    // Задается условие открытия сделки Sell. 
    if(B_1 > B_2 && B_1 > B_3 && Key < Null)
    {
    Alert("Продажа. Имбирь.");
    OrderSend(Symbol(),OP_SELL,Lots_Typ,Bid,10,0,0,Sell_Key);
    }
    // Задается условие открытия сделки Buy.
    if(B_1 < B_2 && B_1 < B_3 && Key > Null)
    {
    Alert("Покупка. Имбирь.");
    OrderSend(Symbol(),OP_SELL,Lots_Typ,Bid,10,0,0,Sell_Key);
    }
    
Vinin:

How are you trying to use it? Give me the code


A little above.


khorosh:
Do you not know how the functions are used in general or is this function not understood specifically?


I don't understand this particular function.
Which variable in it is responsible for issuing the order type?
 
Link_x:


A little higher.



I don't understand this particular function.
Which variable in it is responsible for issuing the order type?


And where is the function itself (in your code)?
 
4703507:
I opened a demo account $ 5000, lost 950, have a balance of $ 4050, but can not open orders (Dice and Buy) do not function What do I do?

It may be a day off.
 
Vinin:

Where is the function itself (in your code)?

That's the thing, I don't know which side to put it in. :)