Features of the mql5 language, subtleties and tricks - page 2

 
double Number = (double)"01.23_example"; // 1.23
double Nan = (double)"nan"; // Nan
 
Alexey Volchanskiy:
The same in MT4, it depends on the specific server
Metaquotes-Demo - MT5.
 
fxsaber:

There is no such thing in the scripts. Using the EA+ExpertRemove bunch instead of the script is stupid.

Moreover, OrderSend crashes by timeout if there is no response from the server for 180 seconds. This suggests that the OnTradeTransaction may accumulate tickets that are always pending. And the option of just one order_ticket for OnTradeTransaction, as in your script, is bad. The asynchronous sending is followed by the work with the lists of orders. That's why it's asynchronous - to work with batches. And if there is no work with batches, the asynchrony is never necessary.

It seems that you are still celebrating:)

1. Test_symc_order.mq5 does not use any scripts.

2. Expert Advisor+ExpertRemove is stupid - it is not in the code at all

3. We are talking about the SYNC mode.

4. OnTradeTransaction is a GUARANTEED event

 
prostotrader:

It sounds like you're still celebrating:)

1. Test_symc_order.mq5 does not use any scripts.

2. Expert Advisor+ExpertRemove is silly - it is not in the code at all

3. We are talking about the SYNC mode.

4. OnTradeTransaction is a GUARANTEED event

1. OrderSendAsync+OnTradeTransaction cannot be used in scripts in full. That's why OrderSend is sometimes necessary.

2. I was talking about possible substitution of scripts for Expert Advisors.

It is not a guaranteed event. There may be situations when there will be no response. In these situations OrderSend will crash after 180 seconds by timeout.

 
fxsaber:

1. OrderSendAsync+OnTradeTransaction cannot be fully applied in scripts. That's why OrderSend is sometimes necessary.

2. I was talking about possible substitution of scripts for Expert Advisors.

It is not a guaranteed event. There may be situations when there will be no response. In such situations OrderSend will crash after 180 seconds by timeout.

The confidence with which YOU preach your point of view is commendable!

But I feel sorry for the people who might take advantage of your erroneous inferences :)

Added

In client-server applications (MT5 is such an application) there can be no 100% guarantee at all!

 
prostotrader:

But I feel sorry for the people who might take advantage of your erroneous conclusions:)

Any arguments for your assertions other than emoticons?
 
prostotrader:

In client-server applications (MT5 is such an application) there can be no 100% guarantee at all!

You're going to have to decide whether there is a guarantee or not.
 
Combinator:
You decide whether there is a guarantee or not.

What I meant was that the Internet would go down

Or the broker's server would "crash".

 
fxsaber:
Any arguments for your assertions other than emoticons?
The code is EXTREMELY clear about everything
 
prostotrader:
The code is EXTREMELY clear.

Forum on trading, automated trading systems and trading strategies testing

Peculiarities of mql5 language, tips and tricks

I am a professionaltrader, 2017.02.24 13:27

You don't have to wait a few milliseconds.

The message will come in OnTradeTransaction

see code


What OnTradeTransaction can be in a trade script? Not in your code, but in someone else's trade script.
Reason: