Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1310

 
Порт-моне тв:

the problem is not solved, opened order on one chart, on the second does not want, counts OrdersTotal apparently again on all (if that the magician has changed, even compiled a separate EA)

 double Openone,    //цена открытия первой свечи
Opentwo,    //цена открытия второй свечи
Closeone,   //цена закрытия первой свечи
Closetwo,   //цена закрытия второй свечи
Lowone,     //цена минимальная первой свечи
Lowtwo,     //цена минимальная второй свечи
Lowthree,   //цена минимальная третьей свечи
Openthree,  //цена открытия третьей свечи
Closethree, //цена закрытия третьей свечи
CloseOrder, //закрыть ордер
Highone,    //цена максимальная первой свечи
Hightwo,    //цена максимальная второй свечи
Highthree,    //цена максимальная второй свечи
Highfour,    //цена максимальная второй свечи
Highfive,    //цена максимальная второй свечи
Highsix,    //цена максимальная второй свечи
Highseven,    //цена максимальная второй свечи
Higheight,    //цена максимальная второй свечи
Lowfour,    //цена минимальная четвертой свечи
Lowfive,    //цена минимальная пятой свечи
Lowsix,    //цена минимальная шестой свечи
Lowseven,    //цена минимальная седьмой свечи
Loweight,    //цена минимальная восьмой свечи
Closefour,  //цена закрытия четвертой свечи
Openfour,
Low15,
Low25, 
SLbuy, TPbuy,  SLsell, TPsell,   //цена открытия четвертой свечи
OrderOpenPrice;
int ticket, ticketclose; 
int OrderOfSymbol; 

either rename or delete

 
MakarFX:
Put the function from my post.
It finally worked, but I honestly don't understand what the difference is then, could you explain?
 
Порт-моне тв:
It finally worked, but I honestly don't understand what the difference is, can you explain?

you gave me code where you didn't change OrdersTotal() to OrderOfSymbol

I didn't notice it right away

 
MakarFX:

you gave me code where you didn't change OrdersTotal() to OrderOfSymbol

I didn't notice it right away

But here's the thing, thanks. Another silly question, if there is such a thing in mql, that the price of bought Ask` by order is constantly compared to the current Ask? If there is no needed move after a certain period, then after a period of time I would enable this function to break-even (I know about trawl), I'm interested in current Ask vs purchased Ask, I can't implement it either...
 
Порт-моне тв:
i can see what the problem is, thanks. Another silly question, if there is such a thing in mql, that the price of bought Ask` by an order is permanently compared with the current Ask? So for example I want to write a function, if after a certain period of time there is no desired move, then after a period of time I would switch this function to break-even (I know about trawl), I'm interested in current Ask vs purchased Ask, I can not implement it either...
   for(int pos=0;pos<OrdersTotal();pos++)
      if(OrderSelect(pos,SELECT_BY_POS,MODE_TRADES))
         if(OrderSymbol()==_Symbol)
            if(OrderOpenPrice()+ point < == > Ask)

in yellow the price move you want

blue is your desired comparison with Ask

P.S. But why do you need an Ask when your purchases are closed at Bid ?

 
MakarFX:

in yellow the price move you want

blue is your desired comparison with Ask

P.S. But why do you need an Ask when your purchases are closed at Bid?

Oh, great! All Right, I meant the current price (Bid) in general. I'll try to write. Thanks for the help! Have a great day!
 
Порт-моне тв:
Oh, great! All Right, I meant the current price (Bid) in general. I'll try to write it. Thanks for the help! Have a great day!

add

if(OrderType()==OP_BUY)

 
Why does the DLL not work with the Offline Chart in MT4?
 

Greetings. Can you give me a hint?

OrdersHistoryTotal() returns the number of closed and deleted orders in the current account history loaded in the client terminal,

those are right here .

Question 1: is it possible to get the date "from" or the selected period?

Question 2: can I get more history than what is loaded in the terminal, or can I load it programmatically?

 
Andrey Sokolov:

Greetings. Can you give me a hint?

OrdersHistoryTotal() returns the number of closed and deleted orders in the current account history loaded in the client terminal,

you can see it here .

Question 1: is it possible to get the date "from" or the selected period?

Question 2: can I get more history than what is loaded in the terminal or can I load it programmatically?

Question 1: I don't understand the question(

Question 2: no, you can't