Discussion of article "Prices in DoEasy library (part 63): Depth of Market and its abstract request class"

 

New article Prices in DoEasy library (part 63): Depth of Market and its abstract request class has been published:

In the article, I will start developing the functionality for working with the Depth of Market. I will also create the class of the Depth of Market abstract order object and its descendants.

In this article, I will start implementing the functionality for working with the Depth of Market (DOM). Conceptually, classes for working with DOM will not differ from all previously implemented library classes. At the same time, we will have a mold of DOM featuring data about orders stored in DOM. The data is obtained by the MarketBookGet() function when the OnBookEvent() handler is activated. In case of any change in DOM, an event is activated for each of the symbols in the handler having the active subscription to DOM events.

Thus, the DOM class structure is to be as follows:

  1. DOM order object class — the object describing data of one order out of multiple orders obtained from DOM when OnBookEvent() handler is triggered for one symbol;
  2. DOM mold object class — the object describing data on all orders obtained from DOM simultaneously at a single activation of the OnBookEvent() handler for a single symbol — p1 set of objects making up the current DOM mold;
  3. Timeseries class consisting of the p2 object sequence entered into the timeseries list at each OnBookEvent() activation for a single symbol;
  4. Timeseries collection class of DOM data of all used symbols with enabled subscription to DOM events.

Today I will implement the order object class (1) and test obtaining DOM data when OnBookEvent() is activated for the current symbol.

Author: Artyom Trishkin

 

Hello Artyom,

First of all congratulations on the article, simply fantastic!!  One question, from what I could see you do not touch on the position of a specific order (limit order) at a specific price level...For example, if my order is in front of the queue (first) at that level, half the way or really behind all orders.... I am tying to automate a strategy for a very liquid instrument and very low cost of trading where I could enter a position and potentially exit at the same price, for that I would need to have access to the position or my order in the queue of a specific price level...Don't seem to find this discussed anywhere.

Do you know how I would go about retrieving that information, provided the exchange does support that info?

Best Regards

André Oliveira

 
André Dias de Oliveira:

Hello Artyom,

First of all congratulations on the article, simply fantastic!!  One question, from what I could see you do not touch on the position of a specific order (limit order) at a specific price level...For example, if my order is in front of the queue (first) at that level, half the way or really behind all orders.... I am tying to automate a strategy for a very liquid instrument and very low cost of trading where I could enter a position and potentially exit at the same price, for that I would need to have access to the position or my order in the queue of a specific price level...Don't seem to find this discussed anywhere.

Do you know how I would go about retrieving that information, provided the exchange does support that info?

Best Regards

André Oliveira

Thank you.

I didn't understand the question a little - probably the language barrier ...

Here, the library reads all available data that it can read from the Depth of Market using the capabilities provided by MQL.

Try to explain your question with examples, please.

 
Artyom Trishkin:

Thank you.

I didn't understand the question a little - probably the language barrier ...

Here, the library reads all available data that it can read from the Depth of Market using the capabilities provided by MQL.

Try to explain your question with examples, please.

Thanks for the reply Artyom, sure, let me try to better explain.... To simplify and make it easier to understand, let's imagine a hypothetical and very simple "Order Book"  with just one depth of price level, meaning limit orders in the bid side and limit orders in the ask side ... For the example let's imaigne high volume of orders in both sides  (let`s say bid price 1,34 and ask price 1,35). For this example let's imagine this "Order Book" has orders only in this two prices...Nothing else.

I then place a single order in both sides (ask and bid) and my orders will be placed at the very end of the queue in each side (last buy order at 1,34 side and last sell order at 1,35 side)

As the orders in front of mine are consumed or cancelled, my orders will make progress in the queue, and aditional limit orders MIGHT be placed behind my orders at the same price level....I wanted to understand if there is a way to retrieve the position of my orders in the queue, at any given time. See picture I have attached.

Really appreciate your attention and effort to understand my question Artyom, let me know if this is clear, I can try to think of additional examples if this is not a good one. 

Best Regards and once again, really appreciate your comments on this one.


André Oliveira


André Oliveira  

Files:
 
André Dias de Oliveira :

Thanks for the reply Artyom, sure, let me try to better explain.... To simplify and make it easier to understand, let's imagine a hypothetical and very simple "Order Book"  with just one depth of price level, meaning limit orders in the bid side and limit orders in the ask side ... For the example let's imaigne high volume of orders in both sides  (let`s say bid price 1,34 and ask price 1,35). For this example let's imagine this "Order Book" has orders only in this two prices...Nothing else.

I then place a single order in both sides (ask and bid) and my orders will be placed at the very end of the queue in each side (last buy order at 1,34 side and last sell order at 1,35 side)

As the orders in front of mine are consumed or cancelled, my orders will make progress in the queue, and aditional limit orders MIGHT be placed behind my orders at the same price level....I wanted to understand if there is a way to retrieve the position of my orders in the queue, at any given time. See picture I have attached.

Really appreciate your attention and effort to understand my question Artyom, let me know if this is clear, I can try to think of additional examples if this is not a good one. 

Best Regards and once again, really appreciate your comments on this one.


André Oliveira


André Oliveira  

I am afraid that we cannot see the order queue in the Depth of Market. Correct me if I am wrong.

 
Artyom Trishkin:

I am afraid that we cannot see the order queue in the Depth of Market. Correct me if I am wrong.

Once again thanks for looking at the question Artyom.... See, I am very new to mql5 programming, but at least in our Brazillian Exchange apparently this is possible, as this has been implemented in the "Order Book" and "List of Orders" of a trading platform called Profit and by another one called Tryd.. Both these trading platforms are oriented to manual traders and do not emphazise automated trading. 

See attached screenshot, they expose "my order" in yellow and also show all other orders in front and behind... in fact they expose all the brokers and order sizes... it is a very transparent process. 

This is probably not very usual for other exchanges (I am guessing,  as I don't have a lot of experience in other exchanges) and for this reason maybe this is not explored in the mql5 language... I will try to find out how this is exported to these trading platforms (there must be some sort of API), I just thought that MAYBE this was already explored in mql5 too.

Artyom, thank you very much for the comments you have made, much appreciated. Congratulations on your articules, they have extremely high quality content and information.

Best Regards

André Oliveira

 
André Dias de Oliveira :

Once again thanks for looking at the question Artyom.... See, I am very new to mql5 programming, but at least in our Brazillian Exchange apparently this is possible, as this has been implemented in the "Order Book" and "List of Orders" of a trading platform called Profit and by another one called Tryd.. Both these trading platforms are oriented to manual traders and do not emphazise automated trading. 

See attached screenshot, they expose "my order" in yellow and also show all other orders in front and behind... in fact they expose all the brokers and order sizes... it is a very transparent process. 

This is probably not very usual for other exchanges (I am guessing,  as I don't have a lot of experience in other exchanges) and for this reason maybe this is not explored in the mql5 language... I will try to find out how this is exported to these trading platforms (there must be some sort of API), I just thought that MAYBE this was already explored in mql5 too.

Artyom, thank you very much for the comments you have made, much appreciated. Congratulations on your articules, they have extremely high quality content and information.

Best Regards

André Oliveira

I will try to consider this issue in more detail. But as soon as there is time. Unfortunately, I don't have much time.

Reason: