
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
Question. Why do you need an accordion? If in one method, one class, in spherical horse, yes, in physical vacuum (well, I'm drunk)))), then yes, it makes sense. And if in a real project, either a class at the global level, or a loner that handles all this trichomudin (sorry for the extra bourbon))))) at the beginning of the handler, and, request directly from it at any place)))
it's a class manager who distributes tasks and gets results from a small herd of subordinate classes ))))
in general, it is difficult to explain in a sober way
but the question is relevant - how addressing of the common fields is performed when reading the values of these fields from different methods and very often
it's a class manager who distributes tasks and gets results from a small herd of subordinate classes ))))
in general, it is difficult to explain in a sober way
but the question is relevant - how addressing of the common fields is performed when reading the values of these fields from different methods and very often
See also. At the beginning of the handler, no matter which, you start gSomeGlobal.SomeEvent(...), or, if single, Alone::SomeEvent(...), in this method you do the required state processing and, then, you just request the required data via getters. As long as you're not a high-frequency scalper, you can screw all speed advocates, although there's no special overhead here)))
mt5 performance is enough for 10500 orders per second, the channel would have been enough
I was looking for the truth, I had to check it... if you want to do something, do it yourself! )))
2020.07.25 18:00:07.293 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=46141
2020.07.25 18:00:45.273 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=37968
2020.07.25 18:01:31.405 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=46141
2020.07.25 18:02:09.423 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=38016
2020.07.25 18:02:55.558 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=46125
2020.07.25 18:03:33.635 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=38078
2020.07.25 18:04:21.969 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=48344
2020.07.25 18:05:00.113 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=38140
2020.07.25 18:05:46.503 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=46391
2020.07.25 18:06:24.573 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=38062
The speed is critical for optimization, that's why I wanted to know about it.
in general, the reference must pass the current price to all methods
UPD:
2020.07.25 19:03:37.210 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=46141
2020.07.25 19:04:15.201 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=38000
2020.07.25 19:04:53.188 class_global (EURUSD,H1) class C : : loops = 10000000000 ms=37984
2020.07.25 19:05:39.321 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=46125
2020.07.25 19:06:17.313 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=38000
2020.07.25 19:06:55.306 class_global (EURUSD,H1) class C : : loops = 10000000000 ms=37985
mt5 performance is enough for 10500 orders per second, the channel would have been enough
I was looking for the truth, I had to check it... if you want to do something, do it yourself! )))
2020.07.25 18:00:07.293 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=46141
2020.07.25 18:00:45.273 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=37968
2020.07.25 18:01:31.405 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=46141
2020.07.25 18:02:09.423 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=38016
2020.07.25 18:02:55.558 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=46125
2020.07.25 18:03:33.635 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=38078
2020.07.25 18:04:21.969 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=48344
2020.07.25 18:05:00.113 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=38140
2020.07.25 18:05:46.503 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=46391
2020.07.25 18:06:24.573 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=38062
The speed is critical for optimization, that's why I wanted to know about it.
in general, the reference must pass the current price to all methods
UPD:
2020.07.25 19:03:37.210 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=46141
2020.07.25 19:04:15.201 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=38000
2020.07.25 19:04:53.188 class_global (EURUSD,H1) class C : : loops = 10000000000 ms=37984
2020.07.25 19:05:39.321 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=46125
2020.07.25 19:06:17.313 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=38000
2020.07.25 19:06:55.306 class_global (EURUSD,H1) class C : : loops = 10000000000 ms=37985
For starters make the same working conditions)))) Because you have inserted an absolutely unnecessary assignment operator (2 pcs), thus creating a knowingly non-optimal code)))
And now a question: what is more convenient to you? Of course, you can drag a chain of links through method parameters, or you can do it nicely. Compare the speeds yourself)))
But you took an absolutely unnecessary assignment operator (2 pcs.), and thus created a knowingly sub-optimal code)))
That wasn't me!
It's IBM Knowledge Center !https://www.ibm.com/support/knowledgecenter/ru/ssw_aix_72/performance/coding_style_best_perf.html
The conditions are the same there, every tick you need to call the class manager (or super-class, I don't know)
and it calls the rest of the classes which work according to their strategies
but for the sake of argument, variant C really wins in speed, so it's the knoelege_center that kind of speaks the truth
I wonder if this is a glitch or a feature)
There is a structure inside the class instance.
I put a dot to see the contents of the structure.
But it is only displayed if I put square brackets.
Although the structure is in a single instance.
the problem is solved if the class is not an array element.
here is the code for "poking around".
try to compile it, even with errors. Sometimes it "wakes up" the editor
that's not me!
it's IBM Knowledge Center !the current price to all methods
UPD:
2020.07.25 19:03:37.210 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=46141
2020.07.25 19:04:15.201 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=38000
2020.07.25 19:04:53.188 class_global (EURUSD,H1) class C : : loops = 10000000000 ms=37984
2020.07.25 19:05:39.321 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=46125
2020.07.25 19:06:17.313 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=38000
2020.07.25 19:06:55.306 class_global (EURUSD,H1) class C : : loops = 10000000000 ms=37985
this is not me !
this is IBM Knowledge Center !https://www.ibm.com/support/knowledgecenter/ru/ssw_aix_72/performance/coding_style_best_perf.html
The conditions are the same there, every tick you need to call the class manager (or superclass, I don't know)
and it calls the rest of the classes which work according to their strategies
but for the point - option C really wins in speed, i.e. it's knoelege_center kinda speaks the truth
Of course it wins.) But not because it's written optimally, but because compilers have become clever.) Pure optimization. There is no assignment of Ask and Bid values in the release code))) But when you have a little less parameters to process, and the business logic of the project will be a little more than opening an order by indicator, then I'll see how you get tired of dragging strings of links through the whole project)))) And yes, I already told you about the sin of excessive optimization. Trust me, you don't need it in 98% of cases.
And yes, I've already told you about the sin of over-optimisation. Trust me, you don't need it 98% of the time.
I do!... but my gut tells me I won't get it until I get it right ))))
Okay, thanks, there's some good sense in this research.
UPD:
2020.07.25 19:03:37.210 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=46141
2020.07.25 19:04:15.201 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=38000
2020.07.25 19:04:53.188 class_global (EURUSD,H1) class C : : loops = 10000000000 ms=37984
2020.07.25 19:05:39.321 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=46125
2020.07.25 19:06:17.313 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=38000
2020.07.25 19:06:55.306 class_global (EURUSD,H1) class C : : loops = 10000000000 ms=37985
Try also this way:
Also try this way:
2020.07.26 09:39:21.350 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=46157
2020.07.26 09:39:59.402 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=38046
2020.07.26 09:40:37.455 class_global (EURUSD,H1) class C : : loops = 10000000000 ms=38063
2020.07.26 09:41:15.485 class_global (EURUSD,H1) class D : : : loops = 10000000000 ms=38031
2020.07.26 09:42:01.749 class_global (EURUSD,H1) class A : : loops = 10000000000 ms=46266
2020.07.26 09:42:39.754 class_global (EURUSD,H1) class B : : loops = 10000000000 ms=38000
2020.07.26 09:43:17.753 class_global (EURUSD,H1) class C : : loops = 10000000000 ms=38000
2020.07.26 09:43:55.743 class_global (EURUSD,H1) class D : : loops = 10000000000 ms=37984