Discussing the article: "Developing a Replay System — Market simulation (Part 07): First improvements (II)"

 

Check out the new article: Developing a Replay System — Market simulation (Part 07): First improvements (II).

In the previous article, we made some fixes and added tests to our replication system to ensure the best possible stability. We also started creating and using a configuration file for this system.

Here I must warn about a possible flaw of this system. Although the probability of something going wrong is low, you should always know that there is a flaw in the method, and thus prepare for possible problems.

The problem here is that there will be a small gap between reading and writing the variable. Although it is small, it exists when the service can write a value to a global terminal variable before the indicator does. When this kind of event occurs, the value expected by the service when accessing the global terminal variable will differ from what is actually in the variable.

There are ways to get around this flaw, but in this system that works with market replay, it is not critical. So, we can ignore this flaw. However, if you want to use this same mechanism in something more complex, where the stored values are critical, then I advise you to take find about more about how to lock and unlock reading and writing of the shared memory. Well, the terminal global variable is exactly the shared memory.

From the video below, you can get an idea of some of what has been fixed and what remains to be fixed. Now things are becoming more serious.



Author: Daniel Jose

 
I am really strunggling to get this up and running, most of my issues are with the script, can anyone help?
Reason: