Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 649
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
2. What does "more than zero" mean?
Means that there is some price in the buffer, otherwise there is no price in the buffer.
What is shown in the buffer values of this indicator in the data window?
Means that there is some price in the buffer, otherwise there is no price in the buffer.
EMPTY_VALUE is an "empty" buffer value, which many indicators use by default, has a value of DBL_MAX - and this is very much greater than zero. That's why I'm asking.
Try checking if(M_A > 0 && M_A < EMPTY_VALUE)
The EMPTY_VALUE value, the "empty" buffer value that many indicators use by default, has a value of DBL_MAX - which is very much greater than zero. That's why I'm asking.
Try to check if(M_A > 0 && M_A < EMPTY_VALUE)
The signals are so there. Is this it?
So there will be no alert at startup but there will be at appearance of signal on the bar during which the indicator was attached?
I doubt it, at initialisationthe time is already equal to the opening time of the bar.
How to decide?
The signals are so there. Is that all?
So there will be no alert at startup but there will be when the signal appears on the bar during which the indicator was attached?
I doubt it, at initialisation,time already equals bar open time.
How to solve?
Remove initialization time in OnInit()
so everything is already in place, just need to add writing/reading
Does this code work or should it? I have a divergence after retrieving from a global variable with a real ID. And if possible an example in the form of an indicator. Thank you.
My code, it works for me, I can't see your code.
please)
Forum on trading, automated trading systems & strategy testing
Any questions for newbies on MQL4, help and discussion on algorithms and codes
Taras Slobodyanik, 2018.10.05 11:01
well, there's nothing complicated about global variables:
- variable name will be prefix+symbol+period, value = chart id
- When you start, search for variables with your prefix and compare the aidi
- If a chart is not ours, we check whether such a chart exists; if it does not already exist, we delete the variable
- If a chart is ours, we take a symbol and a period from the name and also delete the variable (or rewrite it)
I am trying to help my readers to understand the meaning of variable prefix and its use. Please give me an example how to create such a global variable.
It says that GPTs are stored for 4 weeks, is this even if the terminal is switched off?
I can't find anything in the help about what a variable prefix is or why it's needed. Please give me an example of how to create such a global variable.
It says that GPT are stored for 4 weeks, even if the terminal is turned off?
I meant the prefix in the name to be able to identify where a variable is its own and where it is someone else's, and the prefix can delete all variables at once:
for example:
ps. you can also store/extract information in the name
Now we know what we're talking about.
=variable name is prefix+symbol+period, value = chart id
Why so complicated? If you only want to store the period, you can name it with thechart's id.
Now we know what we're talking about.
=variable name is prefix+symbol+period, value = chart id
Why is it so complicated? If you want to store only a period, you can namea chart id.
i'm just writing it as an example)
if you don't need to remember the symbol, you don't need to remember it.
If the name is just a chart id, how do you delete unnecessary variables?
(if used often, there will be a lot of variables)
If you don't need a prefix - same thing, how do you delete unnecessary variables?