Discussion of article "Timeseries in DoEasy library (part 36): Object of timeseries for all used symbol periods"

 

New article Timeseries in DoEasy library (part 36): Object of timeseries for all used symbol periods has been published:

In this article, we will consider combining the lists of bar objects for each used symbol period into a single symbol timeseries object. Thus, each symbol will have an object storing the lists of all used symbol timeseries periods.

Launch the EA in the tester's visual mode on M5:


First, the tester downloads historical data for all timeframes, then the EA displays data of the created timeseries. The messages are then sent to the journal notifying of opening new bars on the created timeseries during the test.

All works as intended at this stage of creating the functionality for working with a single symbol timeseries.

Author: Artyom Trishkin

 

Hello! I would like to express a wish that it would be possible to create time series not only by the specified number in the timeseries.SyncData(PERIOD_M15,2) method, but also by date, in the field where the number(2) is set. This can be useful when studying correlation of 2 or more instruments on history, for example, separately on a flat and trend section. And one more thing, is it possible to combine 2 methods into 1 - timeseries.SyncData(PERIOD_M15,2) and timeseries.Create(PERIOD_M15), and just write timeseries.Create(PERIOD_M15,2), because creation of timeseries itself implies synchronisation of data first.

 
Alexander:

Hello! I would like to express a wish that it would be possible to create time series not only by the specified number in the timeseries.SyncData(PERIOD_M15,2) method, but also by date, in the field where the number(2) is set. This can be useful when studying correlation of 2 or more instruments on history, for example, separately on a flat and trend section. And one more thing, is it possible to combine 2 methods into 1 - timeseries.SyncData(PERIOD_M15,2) and timeseries.Create(PERIOD_M15), and just write timeseries.Create(PERIOD_M15,2), because creation of timeseries itself implies synchronisation of data first.

Hello. Timeseries are always created from the zero bar (the rightmost bar on the chart - with the last date) in the specified amount. After all, the programme may need any data other than historical data - and current data too. And creating a database is the most expensive operation, so if you initially create a time series of a section far away in history, and then recreate the time series on demand, it will be too expensive.

But the library allows you to get from the base created once any number of bars of the time series, in any time interval. To do this, it is enough to first get the full list of bars of the time series, and then select the necessary section from it. To do this, you need to use CSelect().

Methods of synchronisation and creation of time series are separated for the reason that synchronisation cannot be expected in indicators so as not to slow down the flow. That's why everything is done separately - examples of getting data in indicators will be later - after creating all the functionality of working with timeseries.

 

The use of a large number of multi-coloured background and text colours reduces the readability of articles. It is mottled in the eyes and distracts from the essence. In the past, article moderators used to stop this....

 
Sergey Pavlov:

The use of a large number of multi-coloured background and text colours reduces the readability of articles. It is mottled in the eyes and distracts from the essence. In the past, article moderators used to stop this....

Often authors of articles are forced to emphasise attention - especially if the article is educational in nature together with informational. And they have to do it by highlighting the described code fragment and its description with the same background colour. I myself am not very pleased to see what I get, but it is a forced measure. If you have a suggestion on how to compare two text sections in any other way than highlighting them with the same background colour, I will gladly listen to your suggestion.

 

There are 2 options: static and dynamic.

Static: reduce the size of each described code fragment to a few lines, so that the context of the description and the code coincide as much as possible. You don't have to show the whole function, you can leave a few important lines for each nuance, and discard the rest by marking it with an ellipsis.

Dynamic: only available with MQs. They can make hotspots in the publication editor, on hovering the mouse cursor over which the corresponding "anchors" will be highlighted in the text (code). When the cursor is not over the hotspot, there is no highlighting. Hotspots are marked in the text as weakly underlined links without colour (some sites have this). If there were such a thing, it would require about the same actions in layout that now require background colouring, only the button in the tool palette would be different. But it is unlikely to be done.

 
Stanislav Korotky:

There are 2 options: static and dynamic.

Static: reduce the size of each described code fragment to a few lines, so that the context of the description and the code coincide as much as possible. You don't have to show the whole function, you can leave a few important lines for each nuance and discard the rest by marking it with an ellipsis.

Dynamic: only available with MQs. They can make hotspots in the publication editor, on hovering the mouse cursor over which the corresponding "anchors" will be highlighted in the text (code). When the cursor is not over the hotspot, there is no highlighting. Hotspots are marked in the text as weakly underlined links without colour (some sites have this). If there were such a thing, it would require about the same actions in layout that now require background colouring, only the button in the tool palette would be different. But they are unlikely to do that.

Yes, the second option is quite preferable.
And the first one is not suitable for the reason that many beginners try to write right in the course of the article.
 
Artyom Trishkin:

And the first one won't work for the reason that many beginners try to write right as the article progresses.

On the contrary. The first option is in the style of a very slow "step by step" guide - it is more preferable for beginners.

 
Stanislav Korotky:

The other way round. The first option is in the style of a very slow "step by step" guide - it is more preferable for beginners.

I understood what you were talking about. But this is a suggestion to cut out a part of the code from the function and concentrate on the important part - and describe it. But then the visible integrity of the function will be broken, and this is bad for a beginner - he/she should see the whole function and the description of each of its parts - what, why, for what and why.

 
Artyom Trishkin:

... and that's bad for a beginner - they need to see the whole function, and a description of each part of it - what, why, for what and why.

Artyom, your "accents" in the form of colour schemes in the text will not help beginner traders-programmers. And something suggests that "beginners" will not understand it anyway (or will not want to understand it).

In this case, I'm on the side of "beginners": how can you put 100500 articles in your head and apply them in your Expert Advisors?

 
Sergey Pavlov:

Artem, your "accents" in the form of colour schemes in the text will not help beginner traders-programmers. And something suggests that "beginners" will not understand it anyway (or will not want to understand it).

In this case, I'm on the side of "beginners": how can you put 100500 articles in your head and apply them in your Expert Advisors?

However, those who want to understand, write in private with questions - that's what I focus on (although I ask them to write directly in the discussion of articles, but they write more in private for some reason - maybe the publicity of the question is embarrassing, I don't know).

And I don't think you need to have +100500 articles in your head.
Say, do you know the reference by heart? I don't. And even not from the first time I can find the interesting point in it for "refresh my memory".
But I search, find, reread and refresh. And I'm not a beginner...
Or, say, how accurately do you remember Kovalyov's textbook?

You don't need to remember and know it by heart. But reading and rereading, parsing and arranging it in your mind, you come to realise something that makes a person not a beginner anymore.
If you pay attention to the style and methods of presentation of material in the first articles and to the style and presentation in the last ones, you can see a change - less chewing up. Simply when a person starts reading and does not know how to do something, then initially you can learn how. But then it is not worth repeating the same thing every time.
And here is something new that has not been described yet - here why not to highlight the accents in colour.... However, if there were other convenient ways of accentuating attention besides highlighting the same colour, I would certainly use them - I do not like this motley.

And to use it in your EAs, you don't have to learn how the library is made. It is enough to read the purpose of public methods and their application in test Expert Advisors. And what is not clear - ask in the discussion of articles.
It's just that if you deviate from the description of the library creation and go deeper into the moments of its use, it will be a completely different topic.
However, upon completion of the library creation there will be a voluminous reference material on all its public methods and ways of their use with examples.