Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 323

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
I'm trying to figure out my counter and rewrite it in classes, but I still can't output the working parallel functions. I think m_pause should be declared differently. How should it be done correctly?
I'm trying to figure out my counter and rewrite it in classes, but I still can't output the working parallel functions. I think m_pause should be declared differently. How should it be done correctly?
You need to check it in the timer.
And there should be two CCounter objects - each for a different counter.
The timer has to be checked.
Thanks, but I don't understand why the timer needs to check? For every tick the Expert Advisor accesses the CCounter and counts the ticks "count++".
Thanks, but I don't understand why the timer needs to be checked? For every tick, the EA accesses the CCounter and counts the ticks "count++".
So it's not in the timer...
And there must be two CCounter objects - each for its counter.
Not sure what you mean by "two CCounter objects". I read the article https://www.mql5.com/ru/articles/351, it says "Once loaded, the class becomes an object". Does it mean I'll have to make copies of classes for each counter? So it turns out the same copies with different names that I can do without classes? The goal was to get rid of copying using classes, because I need more than a hundred of them. I was told that it's possible to do it with a class, so I started messing around with classes. Or what am I saying about "two CCounter objects"?
Stuck, it seems to me, in such a simple place. What to do with global int chekcount=0; int count=0; in case I want to run several counter() functions in parallel?
Just use a class or make copies of functions with different names.
Not sure what you mean by "two CCounter objects". I read the article https://www.mql5.com/ru/articles/351, it says "Once loaded, the class becomes an object". Does it mean I'll have to make copies of classes for each counter? So it turns out the same copies with different names that I can do without classes? The goal was to get rid of copying using classes, because I need more than a hundred of them. I was told that it's possible to do it with a class, so I started messing around with classes. Or what am I saying about "two CCounter objects"?
Only use a class, or make copies of functions with different names.
Just create as many class objects as you need. And use each one for your counting.
Thank you, I will read what this CArrayObj is and try to figure it out. :)
How do I create a one-dimensional array of the prices of all open orders? This is probably a very simple question for you, but please advise)
How do I create a one-dimensional array of the prices of all open orders?
Go through all the orders in a loop and write the open prices into the array.
Go through all the orders in the loop and write the opening prices in the array.
Thank you!