How to work correctly in MT5 with OrderSend

 
Comments not related to "Discussion of the article "Statistical distributions in MQL5 - taking the best of R" have been moved to this topic.
 
Renat Fatkhullin:

But that's off-topic, if you want to discuss these issues, do it in the native threads. This is about R.

And the discussion from your colleagues just isn't there. For example, there is not a single example of how to correctly work in MT5 with OrderSend, in order to navigate a synchronized history.

The situation is as follows. The Expert Advisor sends an OrderSend and then immediately reads the history. It sees that there is no position opened and sends OrderSend again. Where is the example in the documentation where this does not happen?

A100 implies this.

Forum on trading, automated trading systems and strategy testing

Errors, bugs, questions

fxsaber, 2016.10.08 12:13

How to copy (with relative paths saved) all project files to a separate folder.

Here, for example, I want to share a code. It pulls a dozen or so mqh files from different places.

Now I have to search for these files manually, often you can't find all of them or take something unnecessary. How to automate this process to be able to share sources?


Sorry for the offtops, but there's no response.

 

We do a huge amount of work. But we are not going to spoon-feed any programming issue.

Have a conscience and spend your time solving your ideas.
 
Renat Fatkhullin:

We do a huge amount of work. But we are not going to spoon-feed any programming issue.

Have a conscience and spend your time solving your own ideas.

I ask for an example of how to work correctly with OrderSend. The documentation is misleading. The examples that come from you are similar.

Some people come up with crutches. They come up with some hypotheses why it should be this way and not that way.

OrderSend is the main function of the language. Can I have some time to explain how to work with the main function?

Everything you do, I support with both hands. But there are real trading questions.

 
fxsaber:

I ask for an example of how to work correctly with OrderSend. The documentation is misleading. The examples that are coming from you are similar.

Some people come up with crutches. They come up with some hypotheses as to why this is the way it should be and not the other way around.

OrderSend is the main function of the language. Can I have some time to explain how to work with the main function?

Everything you do, I support with both hands. But there are real trading questions.

Sorry, but OrderSend is a synchronous function - send and wait for a response...

What else could it be. Especially since build 1395 changed the way OrderSend works

 
prostotrader:

Sorry, but OrderSend is a synchronous function - send and wait for reply...

What else could it be. Especially since build 1395 has changed the way OrderSend works

Not synchronous

Forum on trading, automated trading systems and trading strategy testing

Discussing the article "Statistical Distributions in MQL5 - Taking the Best of R"

Renat Fatkhullin, 2016.10.10 22:13

You're confusing asynchronous processes with wanting to see synchronicity.

OrderSend's job is to issue the request and get confirmation as quickly as possible. And the system copes with this very well.

But getting the completed transaction/transaction, putting it in the history and then issuing it to you under request is a different process and it has no right to slow down OrderSend.

So everything is correct - the transaction is executed quickly, and then in a millisecond (and actually earlier) in the next packet get the ticket update and work with it.


 
fxsaber:
Not synchronous

You are confusing an ORDER with a trade

Not every order sent will result in a trade

 
fxsaber:
Not synchronous

Absolutely synchronous.

This means that the function waits for a full circle response to its request. And receives a "yes, executed" response. As fast as possible.

You completely misunderstand the environment and confuse the concepts. You are trying to add to the notion OrderSend the process "must get the fully executed structure of a trade or position from the history of trades or open positions ".

 
prostotrader:

You are confusing an ORDER with a trade

Not every order sent will result in a trade

I've been eating my own blood on this one! The point is that OrderSend and the trading environment are out of sync. Which leads to mishaps in real accounts, even if you use SB.
 
Renat Fatkhullin:

Absolutely synchronous.

You completely misunderstand the environment and confuse the concepts.

This is already a terminological argument. The bad situation has been described in detail above. Standard libraries don't even take that into account.
 
fxsaber:
I've been there! It's about OrderSend and the trading environment being out of sync. Which leads to mishaps on real accounts, even if you use SB.

Do you want me to help you bypass these mishaps (from personal experience of trading with MT5 robots on a real account)?

Added

Absolutely free :)

Reason: