Discussion of article "Implementing a Scalping Market Depth Using the CGraphic Library" - page 3
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Don't the words I wrote in my question mean anything?
Your example
This code is published by the author of the topic in the description of the class https://www.mql5.com/en/articles/3336.
So this question should not be addressed to me at least...
These words don't mean anything to me except one thing - you haven't studied the code of the example.
you give an example of deletion through
m_book_market.SetMarketBookSymbol(Symbol())If we open this method, we will see there a subscription to the passed ticker.
but not subscription deletion )) subscription deletion is done through a function:
Must be copypasta. It happens. The author probably wrote this code partially in the browser.
Instead of
CMarketBook MarketBook.mqh
write
CMarketBook MarketBook;
it was a trick question for your namesake )) he doesn't like to read code, but waits for a ready answer ))
it was a trick question for my namesake )) he doesn't like to read code, but waits for a ready answer ))
That's exactly what I always do, and initially I made the removal of the glass as it should be, as in your example, which is actually required when working with the glass from the help.
But when I use this method,
I get this error
P|S figured out what the problem is, it turns out that if this method is used in the class constructor, it is not necessary to use it in OnDeinit.
I withdraw my question, you can give me a candy.
If you don't use a destructor in a class
This construct works normally
But maybe I just don't know how to use the destructor, or maybe it is implemented in a crooked way and therefore doesn't work as it should.
The subscription function is broadcast, it is guaranteed to delete all subscriptions in OnDeinit, if you have too many objects in your code and there are delays in their deletion, there may not be enough time allocated for OnDeinit processing, which means that some objects will not be deleted.
Here you can either look for a problem in the code, which is more correct, because there is obviously a problem and it will shoot you in the foot one day, or just delete them in OnDeinit and forget about it.
ps.
That's what I always do.
you obviously didn't parse the example, or you've slipped a crooked code from the beginning, like, take it apart and I'll have a laugh ))
With such an object CMarketBook MarketBook.mqh compiler would compile the code? Well, you created an object MarketBook.mqh, the compiler missed this sacrilege, but you are working with an object MarketBook, you would have an error at the stage OnInit, because you did not have such an object.I paid attention to it at once because the example is obviously not working, so I asked you a question, but you dutifully blamed everything on the class developer and his example....
either provide a working code example where this error is reproduced or explain everything at once without unnecessary codes as you have done now, you will save your time, too.
The subscription function is broadcast, it is guaranteed to delete all subscriptions in OnDeinit, if you have too many objects in your code and there are delays in their deletion, there may not be enough time allocated for OnDeinit processing, which means that some objects will not be deleted.
Here you can either look for a problem in the code, which is more correct, because there is obviously a problem and it will shoot you in the foot one day, or just delete them in OnDeinit and forget about it.
ps.
you obviously didn't parse the example, or slipped in a crooked code from the beginning, as if you want me to make fun of it )).
With such an object CMarketBook MarketBook.mqh compiler would compile the code? Well, you created an object MarketBook.mqh, the compiler missed this sacrilege, but you are working with the object MarketBook, you would have an error at the stage OnInit, because you have not created such an object, I immediately gave it to you.I paid attention to it at once because the example is obviously not working, so I asked you a question, but you dutifully dumped everything on the developer of the class....
You should either provide a working code example where this error is reproduced or explain everything at once without unnecessary codes as you have done now, you will save your time, too.
You are just in your repertoire, I don't care what the author has done in the example, what misprints he has made, you need to be a complete idiot not to realise that it is just a misprint.
The question was completely different.
In his example there is initialisation - call of the glass, then there is its updating through the Refresh() method, but there is no its deletion through the
MarketBookReleaseOnDeinit or implementation of the same, but in the class destructor.
That's why I asked the author a question, how it is more correct in his opinion to kill the glass using his class because this work is missing in the main example and in the class itself and it would be good to implement it before, I'm not saying that there is something bad, etc. just this point is missing it seems to me.
The question was asked to the author and normally formulated, why ask and discuss my questions and demagogue for several pages about what I read, what I want to get from anyone, etc. I myself am able to understand everything in my code, which is exactly what I did.... The question was quite different.
Above in the code I added in yellow colour what in my opinion should be present in the attached indicator.
You're just in your repertoire, I don't care what the author did in the example, what misprints he made, you have to be a complete idiot not to realise that it's just a typo.
The question was completely different.
In his example, there is initialisation - call of the glass, then there is its updating through the Refresh() method, but there is no its deletion through the
OnDeinit or implementation of the same, but in the class destructor.
That's why I asked the author a question, how it is more correct in his opinion to kill the glass using his class because this work is missing in his main example and in the class itself and it would be good to implement it before, I'm not saying that there is something bad, etc. just this point is missing it seems to me.
The question was asked to the author and normally formulated, why ask and discuss my questions and demagogy for several pages about what I read, what I want to get from someone, etc. I myself am able to understand everything in my code, which is actually done... the question was completely different
Above in the code added in yellow colour what in my opinion should be present in the attached indicator.
there are no telepaths here, the example you gave in the original question does not reproduce the problem you are writing about, besides, all the mechanisms are present in the class, the solution is given to you, but I don't see anything but reproaches, the dispute is closed.
There are no telepaths here, the example you gave in your original question does not reproduce the problem you are writing about, besides, all the mechanisms are present in the class, the solution is given to you, but I don't see anything but reproaches, the dispute is closed.
- Firstly, there was no problem at all in my question.
- Secondly, I didn't reproach anyone for anything, I just asked a simple question to the author to clarify my guesses... and from you in every message some ridiculous accusations and questions about the code, in my direction, which I didn't write at all, but took from the article description of the class as an example.
The help says:
Destructor is a special function that is called automatically when an object of a class is destroyed. The name of the destructor is written as the class name with a tilde (~). Strings, dynamic arrays and objects that require deinitialisation will be deinitialised anyway, regardless of the presence of a destructor. If a destructor is present, these actions will be performed after the destructor is called.
There is no destructor in the class that would close the price glass by the method
MarketBookReleaseAlso in the indicator itself in
also it is not present, I was asked a simple question - How to correctly make the de-initialisation of the glass.
I expected an answer to this question,
- don't invent anything, the class itself will close everything, even if there is no destructor declared in it.
- Add
Or add a destructor to the class itself.
And you'll be happy... and you started a dimagogy accusing me of some misprints in someone else's code, that it won't compile, which I know without you, that I can't read something there.... in Russian you signed me up as a deer.
Perfect ! Great Perfect ! Great job!New article Implementing a Scalping Market Depth Using the CGraphic Library has been published:
Author: Vasiliy Sokolov
Thank you. This is a great tool. Very easy to modify.