Question about the OnTradeTransaction function - page 3

 
Mikalas:

:)

1. EXAMPLE for FORTS

2. Can't you put brackpoints?

3. I get the impression that you're reading messages through a line :)

No, I get the impression that you' re writing across the line:

void OnTick()
{
  MqlTick a_tick; //Зачем этот зазор ниже?
                                           
  if ( SymbolInfoTick( _Symbol, a_tick ) )
  {
    PlaceOrder( _Symbol, a_tick.ask, 1, false );   //Устанавливаем ордер
  }     
}

:)) I put breakpoints and I still don't get it. Sorry, but your code is ugly. The order is sent first, and then some meaningless checks are made inOnTradeTransaction and CheckOrder(). The volume is also calculated in the checker.

Let's not torture each other: You give at least a brief annotation of your code (what the author wanted to say so to speak, what goals he sought:) and I will try to make a not superficial analysis of it. I don't want to re-call it as it is now, even under breakpoints.

 
Mikalas:

:)

Let's do it this way.

I'll ask you questions and you answer them, OK?

...

Come on!
Mikalas:

Question 1: How will you know the order ticket (by sending OrderSendAsync command), if TradeTransaction event hasn't come (or isn't used)?

I will recognize the order ticket through the TrackingHistoryOrders function, because sooner or later the order will be executed and it will go to the order history which this function will analyze.

 
C-4:

I get the impression that you are writing through a line:

I put breakpoints and still don't get it. Sorry, but your code is ugly. The order is sent first, and then some meaningless checks are made in OnTradeTransaction and CheckOrder(). The volume is also calculated in the checker.

Let's not torture each other: You give at least a brief annotation of your code (what the author wanted to say so to speak, what goals he sought:) and I will try to make a not superficial analysis of it. I don't want to re-call it in the form in which it is now, even under breakpoints.

:):):)

I'm not a young man anymore (the photo is 9 years old ), and I'm more comfortable making "gaps" in the code for better perception.

And many people also find it more convenient to read code when lines and columns of 100 characters are not written together.

You think it's "ugly" because YOU took the time to invent your own method of

OrderSendAsync command, so you think different code = ugly! :)

The principle is very simple, and you know it, because you participated in the discussion on this subject.

The solution to this problem was suggested by Yurich, which was that for each order of the OrderSendAsync command

command has its own Magic, then this order, if the TradeTransaction event has not arrived, is very easy to find (by magic).

A range of Magic numbers is allocated for each symbol, e.g., for AUDUSD from 1010000 to 1019999,

for EURUSD from 1020000 to 1029999

These unique numbers can be repeated over time

if ( mem_magic >= ( magic_number + 9999 ) ) mem_magic = magic_number;  //Переполнение, начинаем сначала

To avoid "getting" into another order, there is a variable (datetime mem_time;)

which stores the date and time when the order was placed.

Shall we go on with this?

 
C-4:
Come on!

I get the order ticket through the function TrackingHistoryOrders, because sooner or later the order will be executed and will get into the orders history, which will be analyzed by this function.

That is fine, but I need it sooner rather than later (the order can "hang" for a day and it won't BE in the history).

I want to modify it!

I want to delete!

 

All the fuss and a lot of auxiliary code comes from this phrase: In addition,transactions can get lost in delivery from the server to the terminal.

Can anyone clarify the situation? Who can lose a transaction in person (exchange glitches, broker closes, MQ MT5 server halts)?

Why MQ do not want to guarantee the delivery of transactions, who benefits?

 
Serj_Che:

All the fuss and a lot of auxiliary code comes from this phrase: In addition,transactions can get lost in delivery from the server to the terminal.

Can anyone clarify the situation? Who can lose a transaction specifically in persons (exchange glitches, broker closes)?

Why MQ do not want to guarantee the delivery of transactions, who benefits?

No one does, but MQ "can't afford" to do everything at once, and there are many projects, and

talented programmers are scarce, so it's taking too long...

They will, of course. (They already have everything for that, apart from the tracking mechanism itself).

 
Basil, so how do you modify (delete) an OrderSendAsync issued if you do not have a ticket?
 
Mikalas:

No one is benefiting, MQ just can't get their hands on it all at once, and there are a lot of projects, but

talented programmers are scarce, so it's taking too long...

They will, of course. (they already have everything for that, except the tracking mechanism itself).

As far as I understand the exchange gives everything away. It makes no sense for a normal broker to lose anything either.

On MQ it looks like that. MQ has MetaTrader5 and integration with the exchange is not a priority.

 
Serj_Che:

As far as I am concerned, the exchange gives everything away. It doesn't make sense for a normal broker to lose anything either.

This is similar to MQ. MQ has MetaTrader5 and integration with the exchange is not a priority.

Yes, this is because there is no kitchen on the exchange (only commissions), and there are millions of MMM followers on FOREX,

They may have $100, but EVERYONE has! Huge money, there is something to count! :)

 

Vasily, is there going to be an answer?

I don't think so.

Did I win?

Reason: