This article provides a detailed look at creating and positioning the OBJ_CHART object in subwindows, with a particular focus on the differences between the main window and the subwindows. It shows how to integrate indicators using resources (#resource, ChartIndicatorAdd) and identify the desired subwindow by the indicator short name. As a result, the code becomes more stable, portable, and reusable.
In our previous article “From Basic to Intermediate: Resources”, we introduced a very interesting and extremely engaging concept: using data or other information as an embedded resource in the application we are developing. However, what is shown there is only a small and insignificant part of everything we can do using this concept. In practice, the only limitations are your own imagination and your experience in applying the concept described there. And since the goal here is educational—and we aim to present everything in a way that is clear to everyone, even beginners—we will not skip any steps when explaining how certain concepts can and should be understood.
So, in this series of articles, we've already discussed graphical objects and how to handle simple events in those objects. In addition, we were briefly introduced to indicators and discussed how to approach some specific situations related to their use. We have also laid a solid foundation for working with subwindows. However, we haven't yet discussed how to use objects within them. Many people might think, “What’s the point of knowing how to do this? Isn't this the same thing that was already explained when we discussed graphical objects?” Broadly speaking, yes—it's more or less the same thing. However—and this is exactly what I'm about to explain—there are slight differences and nuances between using an object in the main window and using the same object in a subwindow. The most interesting part begins when we start using elements that are supposed to be in the main window but will ultimately be used in a subwindow. If you see it that way, you almost certainly still don't understand what I'm trying to explain.
So, let's start by looking at situations like this: using graphical objects inside subwindows. Let's set aside all distractions and focus on what will be explained in this article, because this topic can truly change the way you think about code.
Check out the new article: From Basic to Intermediate: Objects and Subwindows (I).
In our previous article “From Basic to Intermediate: Resources”, we introduced a very interesting and extremely engaging concept: using data or other information as an embedded resource in the application we are developing. However, what is shown there is only a small and insignificant part of everything we can do using this concept. In practice, the only limitations are your own imagination and your experience in applying the concept described there. And since the goal here is educational—and we aim to present everything in a way that is clear to everyone, even beginners—we will not skip any steps when explaining how certain concepts can and should be understood.
So, in this series of articles, we've already discussed graphical objects and how to handle simple events in those objects. In addition, we were briefly introduced to indicators and discussed how to approach some specific situations related to their use. We have also laid a solid foundation for working with subwindows. However, we haven't yet discussed how to use objects within them. Many people might think, “What’s the point of knowing how to do this? Isn't this the same thing that was already explained when we discussed graphical objects?” Broadly speaking, yes—it's more or less the same thing. However—and this is exactly what I'm about to explain—there are slight differences and nuances between using an object in the main window and using the same object in a subwindow. The most interesting part begins when we start using elements that are supposed to be in the main window but will ultimately be used in a subwindow. If you see it that way, you almost certainly still don't understand what I'm trying to explain.
So, let's start by looking at situations like this: using graphical objects inside subwindows. Let's set aside all distractions and focus on what will be explained in this article, because this topic can truly change the way you think about code.
Author: CODE X