Discussing the article: "Market Simulation (Part 24): Position View (II)"

 

Check out the new article: Market Simulation (Part 24): Position View (II).

In this article, I will show how to use an indicator to track open positions on the trading server in the simplest and most practical way possible. I am doing this step by step to show that you do not necessarily have to move all of this into an Expert Advisor. Many of you have probably become used to doing that for one reason or another. In fact, that is not really justified, because as this implementation evolves, it will become clear that you can create or implement different types of indicators for this purpose.

In the previous article, Market Simulation: Position View (I), we began discussing the possibility of creating and implementing an indicator that would allow us to visualize open positions directly on the symbol chart. Although many believe this is not necessary because we can rely on MetaTrader 5 for this, that does not apply when using a cross-order execution model. Nor does it apply, as in our specific case, to the replay/simulation system.

As mentioned, when we start working with a large number of objects on the chart, some problems arise, especially when they are connected to each other in one way or another, which makes the overall implementation more complex. Fine, but our goal here is not to dwell on the problems we face, but to show the solution we decided to implement. What we are about to examine, as mentioned some time ago, will be neither the final solution nor the only possible one. My suggestion, dear reader, is to stop and think a little before you start creating tons of code without a clear need.

Since the topic we are going to discuss is quite broad, we will not go into detail in this introduction. My intention is that, by the end of this article, we will have created something slightly better than what was covered in the previous publication. So let us get to work.


Author: Daniel Jose