Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1345
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
Again, do you need to change the prefix when loading the next copy?
can you say in words what the purpose is?
buttons can be created and controlled from outside your window.
what will it be?
can you say in words what the purpose is?
The buttons can also be created and controlled outside your window.
what would that be?
I don't know, but it should be like this: Create in your subwindow, and when you click, get the number of this subwindow. You don't need to draw anything, just a button that, when clicked, displays information in Alert about the subwindow number
I don't know, but this is the way to do it: Create in your subwindow, and when you click on it, you get the subwindow number. You don't need to draw anything, just a button that, when clicked, displays information in Alert about the subwindow number
checked on my first source:
alas, everything is as you wrote - if you run multiple copies of this indicator with default parameters, the button will be only on the first indicator in a subwindow
but if you change the parameters during the start, everything is OK
in general, the situation is unclear
I checked it on my first source:
alas, everything is as you write - if you run several copies of this indicator with default parameters, the button will only be on the first indicator in the subwindow
but if you change the parameters during the start, everything is OK
in general, the situation is unclear
So, here is a question: How to change parameters automatically, without going into settings?
Nothing works so far ...
---
P.S. Ideally, but alas
So far it's not working ...
And it won't:
added in:
I put an indicator - I get OnInit in the log, but the next indicator is already silent, i.e. only one copy of the indicator is really running, and the other indicators are just a graphical shell
and it won't work:
added in:
I put the indicator - I get OnInit in the log, but the next indicator is already silent, i.e. only one copy of the indicator is really running, and the other indicators are just a graphical shell
That's how it is. I guess the architecture of mt5 is not right. The mt4 terminal is working fine.
If you have decided to do so in mt5, you would prohibit to run indicator copies with the same input parameters, because it seems to be present but absent.
That's the way it is. The architecture of mt5 must be a mess. Everything works fine in mt4.
If you decided to do so in mt5, you should have banned the launch of indicator copies with the same input parameters, because it seems to be there, but in fact it is not.
The calculation part of the indicator is not the same as the graphical one. Therefore, the calculation part is the same for all of them. There are several graphical ones.
Can't you just search all sub-windows in one indicator and put labels with sub-window number in them? At the same time to catch in the timer the number of subwindows of the chart: increased - add to a new subwindow label. But also search what indicator is placed in it - if it's different, then don't add...
Just an untested idea.
ZS. I don't agree about the "curvature". One calculation part for 20 identical indicators is better than 20 calculation parts for 20 identical indicators.
The calculation part of an indicator is not the same as the graphical part. Therefore, the calculation part is the same for all of them. There are several graphical ones.
Can't we just look for all sub-windows in one indicator, and put labels with sub-window number in them? At the same time to catch in the timer the number of subwindows of the chart: increased - add to a new subwindow label. But also search what indicator is placed in it - if different, then do not add...
Just an untested idea.
ZS. I don't agree about the "curvature". One calculation part for 20 identical indicators is better than 20 calculation parts for 20 identical indicators.
Did, no response to the button - OnChartEvent copy doesn't trigger and doesn't understand the subwindow number.
Anyway, here's what doesn't work and along with it the rest of the code
Forum on Trading, Automated Trading Systems and Strategy Testing
FAQ from Beginners MQL5 MT5 MetaTrader 5
Igor Makanu, 2021.09.12 21:53
you don't:
added to:
int OnInit() { Print(__FUNCTION__);
I put an indicator - I get OnInit in the log, but the next indicator is already silent, i.e. only one copy of the indicator is actually running, and the other indicators are just a graphical shell
Did, no reaction to button - OnChartEvent copy doesn't work and doesn't understand subwindow number.
Anyway, here's what doesn't work and with it the rest of the code
BUT!!! If I make a template with 2-3 of these indicators under the name "Debug.tpl" and start debugging the indicator, then OnInit() works as it should.
In general, I made such an experiment:
I transferred #property to its maximum in OnInit() hoping that while not created indicator will run OnInit() and make a short name for indicator, depending on the number of indicators in the window.
But it didn't help:
I start the first copy
Indicator name 2.........
I start the second copy - indicator name is still 2 for both indicators
I start the debugging and what do I see! The not yet loaded indicator is already printing... read the second and third line...
how can this be?
Further debugging stopped on entry to OnInit(), windows_total variable contains rubbish, short_name is still an empty string...
Hi......... but it's all already printed... how come???
And the short_name has already changed.
As a result, after a full loading of the indicator in debug mode, the indicator has the following names
Perhaps we should draw developers' attention to such bugs...