Developers! Do you even test what you create? - page 11

 

papaklass, c-4

The existing server response model via OnTradeTransaction

it suits me, and it works in my EA, BUT

my first message was that no message was returned(at all) from the server,

that the deal was done (order was filled by 1) and the second error was

The second error was that instead of a reply that the order was placed a reply that it was partially executed (duplicated).

The problem was not with the handler (I have no claims against it) but with the server's responses ( one response did not come at all and the other was wrong).

The model of working with server's responses in my EA is NOT based on the sequence of server's responses, BUT the response must be and be correct.

Here is what happened (picture from the first post):

The Expert Advisor placed an order with a volume of 3.

The order was executed by one - the server's responses are correct.

Then the Expert Advisor modified the order - the server's response is ORDER_STATE_PARTIAL - and the response should have been ORDER_STATE_PLACED.

Then the order was executed for 1 more time without any message from the server.

A couple of days later (picture below) I repeated this sequence - the result has changed (probably developers have corrected something),

I got a message that transaction occurred (second 21:15:02.232), but the message about modification was still not correct.

It's also very alarming that three replies from the server came at the same time(21:14:53.049)!

It's clear that everything works in the same thread and that messages are piling up, but still.... I'm stopping the EA from running,

to receive messages.

 

papaklass!

The point is that *.ex5 programmes run in a single thread, if

there will be a lot of handlers, it will be even worse.

 
papaklass:

Now I specifically checked OnTrade and OnTradeTransaction operation.

Three OnTrade handlers or four OnTradeTransaction handlers trigger on one trade order to open a market position (a market order). I need only one handler OnPositionOpened to trigger.

For closing a position by a stop loss/stake profit, there are 3 OnTrade handlers or 3 OnTradeTransaction handlers triggered instead of one OnPositionClosed. The redundancy is obvious!

These multiple responses of the existing event handlers (OnTrade/OnTradeTransaction) do not give a clear answer to the question: "What trade event has happened and what is the result of a trade operation? This begs the question: "Why all this trouble?"

With such redundant processing of trade events, collisions of different types can easily occur, which will lead to errors, especially during mass sending of trade orders by clients.

Therefore, what happened in your case or in the case of komposter (timeout) is not surprising to me personally.

The way OnTrade and OnTradeTransaction events are implemented reminded me of an episode that happened 20 years ago... I remember reading reviews of new games for Spectrum, especially memorable one, where it was written: "... the sound in the game is good as you can turn it off...". I have almost the same attitude to OnTrade and OnTradeTransaction events, they are good just because you can not use them.
 
SWA:
The way OnTrade and OnTradeTransaction events are implemented reminded me of an episode 20 years ago... I remember reading reviews of new games for Spectrum, especially memorable was a review of one game, where it was written like this: "... the sound in the game is good as you can turn it off...". I have roughly the same attitude to OnTrade and OnTradeTransaction events, they're only as good as not using them.

I, on the other hand, use (successfully) these two handlers!

If, for some reason, OnTradeTransaction doesn't work, I check

in OnTrade - very convenient because OnTradeTransaction,

and then OnTrade.

 
Mikalas:

I, on the other hand, use (successfully) these two handlers!

If, for some reason, OnTradeTransaction doesn't work, I check

in OnTrade - very convenient because OnTradeTransaction,

and then OnTrade.

I personally think this convenience is questionable: loss of time and overloading the client-server channel with requests for exact information about what happened on the server. It can be a situation, when the hard-won information from the server is no longer up to date and reliable by the time you get it.
It would be really convenient to use these events (at least for me) if the Expert Advisor were to generate a request to the server with the frequency necessary for the trading algorithm like this
bool TradeTransaction(TIME_REQUEST);
bool Trade(TIME_REQUEST);
// где временная метка может принимать значение к примеру TIME_REQUEST=TimeTradeServer или TIME_REQUEST=TimeGMT

And the server would immediately reply to such a request with comprehensive information...

However, assuming that there are "insurmountable objective reasons" that make it impossible to implement such a convenience, I make do with what I have:)

 

Who can do it...:)

By the way, download the Plaza II API from the exchange server and you will understand where the "legs grow" from.

 
Mikalas:

Please don't be rude! By the way, it's already 10!

And you are within your rights not to read what is written here at all!

What's the topic for then? Just to shout?

If you think there is an error, confirm it with logs and code (no one will decipher your pictures).
If you want to find a reliable solution, listen to what they say (abandon the event model and analyse the current state).

I would use OnTradeTransaction orOnTrade only for immediate reaction to trade situation change. But the entire processing would be placed in one handler, as suggested by Vasiliy(OnRefresh()).

Good luck!

 
komposter:

What's the topic for then? Just to shout out?

If you think there is an error, confirm it with logs and code (no one will decode your pictures).
If you want a reliable solution, listen to what they say (abandon the event-driven model and analyse the current state).

I would use OnTradeTransaction orOnTrade only for immediate reaction to trade situation change. But all processing would be placed in one handler, as Vasiliy suggested(OnRefresh()).

Good luck!

komposter!

Either read everything you've written or...

2.Whatever I write on these pages is MY right as a forum participant,

and Rude ANYTHING is nowhere near appropriate!

3. Wherever you handle the error, if the server response is not what it should be - the result will be the same - ERROR!

4. You are probably not trading yourself.

 
Mikalas:
BURNING REMOTE is the answer to a blatant attack! Whatever the question, that's the answer. You could have been a hero... ))
 

pronych and ....

1.>> LUCKY REMOTE is the answer to a blatant attack! Whatever the question, that's the answer. >> Could have been a hero... ))

You probably have just the right perception of the world around you...

2. Are YOU PROGRAMMERS or are YOU "WRITERS"?

3. Someone answer a simple question: What should the server respond to the "Modify Order" command?

4. Why documentation then? Articles? Close your eyes and spit whatever you want! The CUSTOMER PAYS anyway (and he is the one to be drained as well)!

bool CheckMoney()
{
  return(ВАСЯ_ПУПКИН);
}
Reason: