Discussing the article: "Market Simulation: Position View (XI)"

 

Check out the new article: Market Simulation: Position View (XI).

In this article, I will show you, dear reader, how to select the objects we create on the chart and modify the position indicator so that it can perform many more functions than originally intended. We will look at how to implement the ability to move price levels and create price lines directly on the chart. Many people may find this difficult. However, you will see that we'll do this with minimal effort. You just need to give it a little thought.

The result is shown in the following animation.

Please note that the system is now working flawlessly—exactly as expected. Since the code has undergone some changes—many of which are very minor—there is no need to list them separately. However, dear reader, I would like you to pay special attention to two points in this code. The first one is the constructor. Take a look—it is a little different from the previous version. The second procedure is UpdatePrice. Note that the procedures that created the objects, which were previously in the constructor, are now in this procedure. Since the code is fairly simple, there is no need to go into detail. All that was done was to remove what used to be done in the constructor and move it into the UpdatePrice procedure—nothing particularly impressive.


Author: Daniel Jose