Questions from a "dummy" - page 100

 
220Volt:

Good afternoon. There is such a phenomenon as distortion of the last bits in double, please advise what conditions need to be created for such a distortion to occur? Is distortion possible in operations = ? Is distortion possible when storing integers in double? While performing operations?

x=M_PI;
y=sqrt(x);
y=y*y;

What is a variant of distortion?
 

Please advise. Is there any way to find out programmatically (in OnTrade() function) whether a Stop Loss, Take Profit or a pending order has been set, modified or deleted manually (by terminal means)? And a short example, if it is not difficult.

At the moment the listed operations are logged and written to file(s), which are located in directory D:\Metatrader 5\logs\. So I cannot read them programmatically.

Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров - Документация по MQL5
 
tol64:

Please advise. Is there any way to find out programmatically (in OnTrade() function) if a Stop Loss, Take Profit or a pending order has been set, modified or deleted manually (by terminal means)? And a short example, if it is not difficult.

The function has handled events when certain lists were changed before, there were no parameters. If everything is the same, it turns out that events of setting, modifying or deleting must be handled regardless of whether orders are set manually or not. Is this correct? If correct, we can try to find out the ticket of each Trade event (if the event refers to an order) and if we find out that no such ticket was set up programmatically, we can track its fate. It goes something like this.
 
Yedelkin:
Previously, the function handled events when certain lists were changed, there were no parameters. If everything remains the same, then it turns out that set, modify or delete events should be received regardless of whether orders are manually set or not. Is this correct? If correct, we can try to find out the ticket of each Trade event (if the event refers to an order) and if we find out that no such ticket was set up programmatically, we can track its fate in the future. It goes something like this.
Yes, that's correct, but only if the events relate to trades, as far as I understand it. I need to find out if the events of modification of orders in manual mode can be tracked programmatically.
 
tol64:
Yes, everything is correct, but only if the events are related to trades, as far as I understand it. I need to find out if it is possible to track order modification events in manual mode programmatically.

No, no, read the documentation as a matter of urgency :) Or even better articles. The list of deals is only a part of all lists. It means that events should be different... However, I read it myself a long time ago, I may forget.

The article"Handling Trade Events in the Expert Advisor with the OnTrade() Function" and the article"Trade Events in MetaTrader 5" by Roche.

 
Yedelkin:

No, no, read the documentation as a matter of urgency :) At least that part was more or less clear there. The transaction list is only part of all the lists. So the events must be different, too.

And even better: there was an article about this function, and an article by Roche about trade events (if I'm not mistaken in the title.)

)) In OnTrade() I manage to define events like this:

DEAL_ENTRY_IN, DEAL_ENTRY_OUT, DEAL_ENTRY_INOUT.

I can also determine whether one of these events was just a deal or a pending order triggered and what kind of pending order it was. And also whether it was a new position or an increase/decrease of an already existing position.

---

I do not know how to detect modifications of any orders. I have not seen any examples of this in the documentation either. I need a hint. A simple hint from the developers. Is there such a possibility or not? And will this possibility ever be implemented or not, to get rid of this question or try to solve it in some other clever way. :)

---

There's also this section in the documentation: Types of trades. But these events can be identified if they were done programmatically.

 
Yedelkin:

...

Article about this function"Handling trade events in EAs using OnTrade() function".

I found in this article what I was asking about. I have read it once, but completely forgot about it. :)
 
tol64:
I found what I was asking about in this article. I read it once, but had completely forgotten about it. :)

I generally forget all the subtleties after a month. That's why all I do is reread. I read sections of the Handbook and articles :)

Here's another phrase "...change of SL and TP does not change ... and even OnTrade event is not generated, we just overwrite fields SL and TP (like for open position)" may be useful. I myself, however, have not figured out how to do it.

 
tol64:
Yes, that's correct, but only if the events relate to trades, as far as I understand it. I need to find out if order modification events can be tracked programmatically in manual mode.
At least the setting and removal of an order is handled, but without parameters it's all a pain in the ass. I can't say for the change, but it should be handled, too, by idea.
tol64:
I found what I was asking about in this article. I read it once, but have completely forgotten about it. :)
I have thought about it right away. Maybe the solutions described in it are not as ideal and elegant as we would like them to be (especially considering that the parameters are still missing), but in principle they have all the basics.
 

Can you tell me how to get the bid and ask price of another currency pair, not current at the moment, in mt4 there was a marketinfo command, in mt5 there is none.

I have an assumption that we need to move towardsSymbolInfoDouble(Symbol(),SYMBOL_ASK) and here operate withSymbol() value, but I can't figure out how.

Reason: