Questions from Beginners MQL5 MT5 MetaTrader 5 - page 959
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
How do I change the input parameter in the custom indicator during trading and apply the changes?
Let's say I had ma 25, now I need ma 33.
As far as I understand the input parameters are only set during initialisation. But I need to change indicator during trading
How do I change the input parameter in the custom indicator during trading and apply the changes?
Let's say I had ma 25, now I need ma 33.
As far as I understand the input parameters are only set during initialisation. But I need to change indicator during trading
Create TWO indicators in advance.
Create TWO indicators in advance.
No, I don't need two indicators. I need to change this one during trading.
I want it to have dynamics, so to speak.
Can I download it and load it with new parameters?
No, I don't need two indicators. I need to change this one during trading.
The dynamics, so to speak.
Can it be unloaded somehow and loaded with new parameters?
Create three indicators :).
In general, you have to think first, create the environment and only then get the data.
Create three indicators :).
In general, you have to think first, create the environment and only then get the data.
Suppose -
At the start of the EA the MA = 25;
With every new tick I change the MA = +1.
I.e. MA = 26;
I won't create 500 handles for different conditions)
How do I change the input parameter in the custom indicator during trading and apply the changes?
Let's say I had ma 25, now I need ma 33.
As far as I understand the input parameters are only set during initialisation. But I need to change indicator during trading
Well, it seems that at changing of values in input parameters of the EA OnInit() is triggered, it means that the new values of parameters are applied. Or am I wrong?
If the values in the input parameters of the EA are changed, OnInit() is triggered, which means that the new values of the parameters are applied. Or am I wrong?
I've tried it this way.
It doesn't work
I tried it like this.
Doesn't work.
Well you can't, you need to callOnInit to re-initialize the indicator.
How often do you change parameters during operation?
Well you can't, you need to callOnInit to re-initialise the indicator.
How often do you change parameters during operation?
I am going to change them often.
So the code should look like this?
I'm going to change it a lot.
So the code should look like this?
You should put a flag to check if the value has changed, so you don't have to yankOnInit on every tick
Something like this: